Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 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 | |