[git commit branch/0.9.33] linux: pread/pwrite: fix 64bit handling

Mike Frysinger vapier at gentoo.org
Mon Feb 17 21:50:27 UTC 2014


commit: http://git.uclibc.org/uClibc/commit/?id=525d31e51fca97051978aabd5a6295ffb8f82a17
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/0.9.33

This is a fix similar to 458076d59ef9849f79d27e21b6094b0b3a85fbb4.
But master has been rewritten heavily, so do a minor backport.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 libc/sysdeps/linux/common/pread_write.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
index 8562ab4..924509e 100644
--- a/libc/sysdeps/linux/common/pread_write.c
+++ b/libc/sysdeps/linux/common/pread_write.c
@@ -43,8 +43,15 @@ extern __typeof(pwrite64) __libc_pwrite64;
 #include <bits/kernel_types.h>
 
 # define __NR___syscall_pread __NR_pread
+
+#if defined(__UCLIBC_SYSCALL_ALIGN_64BIT__)
+static __inline__ _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf,
+		 size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo)
+# define __syscall_pread(fd, buf, count, ...) __syscall_pread(fd, buf, count, 0, __VA_ARGS__)
+#else
 static __inline__ _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,
 		size_t, count, off_t, offset_hi, off_t, offset_lo)
+#endif
 
 ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
 {
@@ -75,8 +82,14 @@ weak_alias(__libc_pread64,pread64)
 #endif
 
 # define __NR___syscall_pwrite __NR_pwrite
+#if defined(__UCLIBC_SYSCALL_ALIGN_64BIT__)
+static __inline__ _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf,
+		size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo)
+# define __syscall_pwrite(fd, buf, count, ...) __syscall_pwrite(fd, buf, count, 0, __VA_ARGS__)
+#else
 static __inline__ _syscall5(ssize_t, __syscall_pwrite, int, fd, const void *, buf,
 		size_t, count, off_t, offset_hi, off_t, offset_lo)
+#endif
 
 ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
 {


More information about the uClibc-cvs mailing list