diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-11-11 11:15:58 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-12-15 11:09:11 -0800 |
commit | 833c86ce15cee2a84a37ae71015f236fd32615d9 (patch) | |
tree | 48981b51f6411b1b66d1900be98c69a067c494d2 /src | |
parent | 935f0b4d6983f77c4f35e6d492f9f2c2d1ed57f9 (diff) |
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
This helps it compile on latest musl C library based systems where these
functions are put under _LARGEFILE64_SOURCE which is to be removed once
all packages start using 64bit off_t, it works with glibc becuase
_GNU_SOURCE feature macro also defines _LARGEFILE64_SOURCE, thats not
the case with musl
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/linux_sysfs.c | 4 |
1 files 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. |