From: Khem Raj <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Khem Raj <raj.khem@gmail.com>
Subject: [PATCH 5/6] libpciaccess: Do not use 64bit functions for largefile support
Date: Thu, 1 Dec 2022 11:02:47 -0800 [thread overview]
Message-ID: <20221201190248.175753-5-raj.khem@gmail.com> (raw)
In-Reply-To: <20221201190248.175753-1-raj.khem@gmail.com>
Using -D_FILE_OFFSET_BITS=64 already makes the normal function behave
like 64bit variants. Moreover it makes them portable across libc
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
...pwrite-pread-instead-of-64bit-versio.patch | 39 +++++++++++++++++++
.../xorg-lib/libpciaccess_0.17.bb | 2 +
2 files changed, 41 insertions(+)
create mode 100644 meta/recipes-graphics/xorg-lib/libpciaccess/0001-linux_sysfs-Use-pwrite-pread-instead-of-64bit-versio.patch
diff --git a/meta/recipes-graphics/xorg-lib/libpciaccess/0001-linux_sysfs-Use-pwrite-pread-instead-of-64bit-versio.patch b/meta/recipes-graphics/xorg-lib/libpciaccess/0001-linux_sysfs-Use-pwrite-pread-instead-of-64bit-versio.patch
new file mode 100644
index 0000000000..cd9c2d3991
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libpciaccess/0001-linux_sysfs-Use-pwrite-pread-instead-of-64bit-versio.patch
@@ -0,0 +1,39 @@
+From d20ff4f2e4feaafa6a6191b9cae3815b85617943 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 11 Nov 2022 11:15:58 -0800
+Subject: [PATCH] linux_sysfs: Use pwrite/pread instead of 64bit versions
+
+pread64/pwrite64 are aliased to pread/pwrite when largefile support is
+enabled e.g. using _FILE_OFFSET_BITS=64 macro
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/linux_sysfs.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c
+index d62f48c..20c800e 100644
+--- a/src/linux_sysfs.c
++++ b/src/linux_sysfs.c
+@@ -462,7 +462,7 @@ pci_device_linux_sysfs_read( struct pci_device * dev, void * data,
+
+
+ while ( temp_size > 0 ) {
+- const ssize_t bytes = pread64( fd, data_bytes, temp_size, offset );
++ const ssize_t bytes = pread( fd, data_bytes, temp_size, offset );
+
+ /* If zero bytes were read, then we assume it's the end of the
+ * config file.
+@@ -522,7 +522,7 @@ pci_device_linux_sysfs_write( struct pci_device * dev, const void * data,
+
+
+ while ( temp_size > 0 ) {
+- const ssize_t bytes = pwrite64( fd, data_bytes, temp_size, offset );
++ const ssize_t bytes = pwrite( fd, data_bytes, temp_size, offset );
+
+ /* If zero bytes were written, then we assume it's the end of the
+ * config file.
+--
+2.38.1
+
diff --git a/meta/recipes-graphics/xorg-lib/libpciaccess_0.17.bb b/meta/recipes-graphics/xorg-lib/libpciaccess_0.17.bb
index 06c30384ab..309354e872 100644
--- a/meta/recipes-graphics/xorg-lib/libpciaccess_0.17.bb
+++ b/meta/recipes-graphics/xorg-lib/libpciaccess_0.17.bb
@@ -5,6 +5,8 @@ PCI bus and devices in a platform-independent way."
require xorg-lib-common.inc
+SRC_URI += "file://0001-linux_sysfs-Use-pwrite-pread-instead-of-64bit-versio.patch"
+
XORG_EXT = "tar.xz"
SRC_URI[sha256sum] = "74283ba3c974913029e7a547496a29145b07ec51732bbb5b5c58d5025ad95b73"
--
2.38.1
next prev parent reply other threads:[~2022-12-01 19:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-01 19:02 [PATCH 1/6] mdadm: Use _FILE_OFFSET_BITS to use largefile support Khem Raj
2022-12-01 19:02 ` [PATCH 2/6] acl: Enable largefile support by default Khem Raj
2022-12-06 15:27 ` [OE-core] " Richard Purdie
2022-12-01 19:02 ` [PATCH 3/6] btrfs-tools: Do not use 64bit functions for largefile support Khem Raj
2022-12-01 19:07 ` [OE-core] " Alexander Kanavin
[not found] ` <172CC0ECD8B86688.27320@lists.openembedded.org>
2022-12-06 14:58 ` Alexander Kanavin
2022-12-06 15:29 ` Richard Purdie
2022-12-06 16:09 ` Alexander Kanavin
2022-12-01 19:02 ` [PATCH 4/6] e2fsprogs: " Khem Raj
2022-12-01 19:02 ` Khem Raj [this message]
2022-12-01 19:02 ` [PATCH 6/6] pseudo: Disable LFS on 32bit arches Khem Raj
2022-12-01 19:12 ` [OE-core] " Richard Purdie
2022-12-01 23:05 ` Alexandre Belloni
2022-12-01 23:07 ` Khem Raj
2022-12-01 23:20 ` Richard Purdie
2022-12-01 23:22 ` Khem Raj
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221201190248.175753-5-raj.khem@gmail.com \
--to=raj.khem@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox