blob: 512a473e20137ee270143705366fb9b75c66651d [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001From d20ff4f2e4feaafa6a6191b9cae3815b85617943 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 11 Nov 2022 11:15:58 -0800
4Subject: [PATCH] linux_sysfs: Use pwrite/pread instead of 64bit versions
5
6pread64/pwrite64 are aliased to pread/pwrite when largefile support is
7enabled e.g. using _FILE_OFFSET_BITS=64 macro
8
9Upstream-Status: Submitted [https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/merge_requests/26]
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 src/linux_sysfs.c | 4 ++--
13 1 file changed, 2 insertions(+), 2 deletions(-)
14
15diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c
16index 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--
382.38.1
39