summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/pwrite64.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/pwrite64.c
parentdc95d1588775854fd5f7e617bfcb6f362bf3a923 (diff)
downloadglibc-088b991767b9a60cf36d7eb1d3b0db337ebf3a4e.tar.gz
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/pwrite64.c')
-rw-r--r--sysdeps/unix/sysv/linux/pwrite64.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/pwrite64.c b/sysdeps/unix/sysv/linux/pwrite64.c
index 91e3370673..71eac41a48 100644
--- a/sysdeps/unix/sysv/linux/pwrite64.c
+++ b/sysdeps/unix/sysv/linux/pwrite64.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,15 @@ __libc_pwrite64 (fd, buf, count, offset)
ssize_t result;
/* First try the syscall. */
- result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, (off_t) (offset >> 32),
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+ result = INLINE_SYSCALL (pwrite, 5, fd, buf, count,
+ (off_t) (offset & 0xffffffff),
+ (off_t) (offset >> 32));
+# elif __BYTE_ORDER == __BIG_ENDIAN
+ result = INLINE_SYSCALL (pwrite, 5, fd, buf, count,
+ (off_t) (offset >> 32),
(off_t) (offset & 0xffffffff));
+# endif
# if __ASSUME_PWRITE_SYSCALL == 0
if (result == -1 && errno == ENOSYS)
/* No system call available. Use the emulation. */