about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/pread64.c
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2000-05-26 15:46:14 +0000
committerAndreas Jaeger <aj@suse.de>2000-05-26 15:46:14 +0000
commit088b991767b9a60cf36d7eb1d3b0db337ebf3a4e (patch)
tree1cd149e28bfe2a8f09f5e54b7d85c5273fb59dec /sysdeps/unix/sysv/linux/pread64.c
parentdc95d1588775854fd5f7e617bfcb6f362bf3a923 (diff)
downloadglibc-088b991767b9a60cf36d7eb1d3b0db337ebf3a4e.tar.gz
glibc-088b991767b9a60cf36d7eb1d3b0db337ebf3a4e.tar.xz
glibc-088b991767b9a60cf36d7eb1d3b0db337ebf3a4e.zip
Update.
	* sysdeps/unix/sysv/linux/i386/pread64.c: Removed, we can use the
	normal version now.
	* sysdeps/unix/sysv/linux/arm/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/arm/pwrite64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/pread64.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise.

	* sysdeps/unix/sysv/linux/pwrite64.c (__libc_pwrite64): Check
	endianness to check how to pass argument.
	* sysdeps/unix/sysv/linux/pread64.c (__libc_pread64): Likewise.
Diffstat (limited to 'sysdeps/unix/sysv/linux/pread64.c')
-rw-r--r--sysdeps/unix/sysv/linux/pread64.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/pread64.c b/sysdeps/unix/sysv/linux/pread64.c
index b7b5f019c8..628fd430fb 100644
--- a/sysdeps/unix/sysv/linux/pread64.c
+++ b/sysdeps/unix/sysv/linux/pread64.c
@@ -18,6 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <errno.h>
+#include <endian.h>
 #include <unistd.h>
 
 #include <sysdep.h>
@@ -46,8 +47,16 @@ __libc_pread64 (fd, buf, count, offset)
   ssize_t result;
 
   /* First try the syscall.  */
-  result = INLINE_SYSCALL (pread, 5, fd, buf, count, (off_t) (offset >> 32),
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+  result = INLINE_SYSCALL (pread, 5, fd, buf, count,
+			   (off_t) (offset >> 32),
 			   (off_t) (offset & 0xffffffff));
+# elif __BYTE_ORDER == __BIG_ENDIAN
+  result = INLINE_SYSCALL (pread, 5, fd, buf, count,
+			   (off_t) (offset & 0xffffffff),
+			   (off_t) (offset >> 32));
+# endif
+
 # if __ASSUME_PREAD_SYSCALL == 0
   if (result == -1 && errno == ENOSYS)
     /* No system call available.  Use the emulation.  */