aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/pwrite.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/pwrite.c')
-rw-r--r--sysdeps/unix/sysv/linux/pwrite.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/pwrite.c b/sysdeps/unix/sysv/linux/pwrite.c
index ceafef838a..6a68adcdbd 100644
--- a/sysdeps/unix/sysv/linux/pwrite.c
+++ b/sysdeps/unix/sysv/linux/pwrite.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -17,6 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <assert.h>
#include <errno.h>
#include <endian.h>
#include <unistd.h>
@@ -49,8 +50,9 @@ __libc_pwrite (fd, buf, count, offset)
ssize_t result;
/* First try the syscall. */
+ assert (sizeof (offset) == 4);
result = INLINE_SYSCALL (pwrite, 5, fd, CHECK_N (buf, count), count,
- __LONG_LONG_PAIR (0, offset));
+ __LONG_LONG_PAIR (offset >> 31, offset));
# if __ASSUME_PWRITE_SYSCALL == 0
if (result == -1 && errno == ENOSYS)
/* No system call available. Use the emulation. */