diff options
| author | Khem Raj <raj.khem@gmail.com> | 2022-12-15 00:45:44 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-21 10:16:31 +0000 |
| commit | f702fd113aa4ab2ca5bc7940ce88cbd302eaca8b (patch) | |
| tree | b7ab10eb00627fffdf9ed2e3462e42ce037083b5 | |
| parent | 0e2c1d3cfcdde38e4e0dc143cc1940a5ba73d0da (diff) | |
| download | poky-f702fd113aa4ab2ca5bc7940ce88cbd302eaca8b.tar.gz | |
libpciaccess: Do not use 64bit functions for largefile support
Using -D_FILE_OFFSET_BITS=64 already makes the normal function behave
like 64bit variants. Moreover it makes them portable across libc
(From OE-Core rev: 41da2fb965b31a6ee5d825cf799b14fcf99e70db)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-graphics/xorg-lib/libpciaccess/0001-linux_sysfs-Use-pwrite-pread-instead-of-64bit-versio.patch | 39 | ||||
| -rw-r--r-- | meta/recipes-graphics/xorg-lib/libpciaccess_0.17.bb | 2 |
2 files changed, 41 insertions, 0 deletions
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..512a473e20 --- /dev/null +++ b/meta/recipes-graphics/xorg-lib/libpciaccess/0001-linux_sysfs-Use-pwrite-pread-instead-of-64bit-versio.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | From d20ff4f2e4feaafa6a6191b9cae3815b85617943 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Fri, 11 Nov 2022 11:15:58 -0800 | ||
| 4 | Subject: [PATCH] linux_sysfs: Use pwrite/pread instead of 64bit versions | ||
| 5 | |||
| 6 | pread64/pwrite64 are aliased to pread/pwrite when largefile support is | ||
| 7 | enabled e.g. using _FILE_OFFSET_BITS=64 macro | ||
| 8 | |||
| 9 | Upstream-Status: Submitted [https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/merge_requests/26] | ||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | --- | ||
| 12 | src/linux_sysfs.c | 4 ++-- | ||
| 13 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c | ||
| 16 | index d62f48c..20c800e 100644 | ||
| 17 | --- a/src/linux_sysfs.c | ||
| 18 | +++ b/src/linux_sysfs.c | ||
| 19 | @@ -462,7 +462,7 @@ pci_device_linux_sysfs_read( struct pci_device * dev, void * data, | ||
| 20 | |||
| 21 | |||
| 22 | while ( temp_size > 0 ) { | ||
| 23 | - const ssize_t bytes = pread64( fd, data_bytes, temp_size, offset ); | ||
| 24 | + const ssize_t bytes = pread( fd, data_bytes, temp_size, offset ); | ||
| 25 | |||
| 26 | /* If zero bytes were read, then we assume it's the end of the | ||
| 27 | * config file. | ||
| 28 | @@ -522,7 +522,7 @@ pci_device_linux_sysfs_write( struct pci_device * dev, const void * data, | ||
| 29 | |||
| 30 | |||
| 31 | while ( temp_size > 0 ) { | ||
| 32 | - const ssize_t bytes = pwrite64( fd, data_bytes, temp_size, offset ); | ||
| 33 | + const ssize_t bytes = pwrite( fd, data_bytes, temp_size, offset ); | ||
| 34 | |||
| 35 | /* If zero bytes were written, then we assume it's the end of the | ||
| 36 | * config file. | ||
| 37 | -- | ||
| 38 | 2.38.1 | ||
| 39 | |||
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." | |||
| 5 | 5 | ||
| 6 | require xorg-lib-common.inc | 6 | require xorg-lib-common.inc |
| 7 | 7 | ||
| 8 | SRC_URI += "file://0001-linux_sysfs-Use-pwrite-pread-instead-of-64bit-versio.patch" | ||
| 9 | |||
| 8 | XORG_EXT = "tar.xz" | 10 | XORG_EXT = "tar.xz" |
| 9 | SRC_URI[sha256sum] = "74283ba3c974913029e7a547496a29145b07ec51732bbb5b5c58d5025ad95b73" | 11 | SRC_URI[sha256sum] = "74283ba3c974913029e7a547496a29145b07ec51732bbb5b5c58d5025ad95b73" |
| 10 | 12 | ||
