aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-07-17 20:44:55 +0000
committerUlrich Drepper <drepper@redhat.com>2002-07-17 20:44:55 +0000
commitcd682e15d9d2045ad3bdd1a2719573c6c987b3f8 (patch)
tree0b65c34eed933dc1da577a08cf238cb424c55cfe /sysdeps
parent11fa51b8f64823ae4acb844d782540d72e130f40 (diff)
downloadglibc-cd682e15d9d2045ad3bdd1a2719573c6c987b3f8.zip
glibc-cd682e15d9d2045ad3bdd1a2719573c6c987b3f8.tar.gz
glibc-cd682e15d9d2045ad3bdd1a2719573c6c987b3f8.tar.bz2
Update.
2002-07-17 Andreas Schwab <schwab@suse.de> Ulrich Drepper <drepper@redhat.com> * sysdeps/unix/sysv/linux/pread.c: Sign extend offset. * sysdeps/unix/sysv/linux/pwrite.c: Likewise. * sysdeps/unix/sysv/linux/mips/pread.c: Likewise. * sysdeps/unix/sysv/linux/mips/pwrite.c: Likewise.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/mips/pread.c6
-rw-r--r--sysdeps/unix/sysv/linux/mips/pwrite.c6
-rw-r--r--sysdeps/unix/sysv/linux/pread.c6
-rw-r--r--sysdeps/unix/sysv/linux/pwrite.c6
4 files changed, 16 insertions, 8 deletions
diff --git a/sysdeps/unix/sysv/linux/mips/pread.c b/sysdeps/unix/sysv/linux/mips/pread.c
index b1c1c0d..45305d2 100644
--- a/sysdeps/unix/sysv/linux/mips/pread.c
+++ b/sysdeps/unix/sysv/linux/mips/pread.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 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 <unistd.h>
#include <endian.h>
@@ -48,8 +49,9 @@ __libc_pread (fd, buf, count, offset)
ssize_t result;
/* First try the syscall. */
+ assert (sizeof (offset) == 4);
result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
- __LONG_LONG_PAIR (0, offset));
+ __LONG_LONG_PAIR (offset >> 31, offset));
# if __ASSUME_PREAD_SYSCALL == 0
if (result == -1 && errno == ENOSYS)
/* No system call available. Use the emulation. */
diff --git a/sysdeps/unix/sysv/linux/mips/pwrite.c b/sysdeps/unix/sysv/linux/mips/pwrite.c
index 40b2c8b..44f9d30 100644
--- a/sysdeps/unix/sysv/linux/mips/pwrite.c
+++ b/sysdeps/unix/sysv/linux/mips/pwrite.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 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 <unistd.h>
#include <endian.h>
@@ -47,8 +48,9 @@ __libc_pwrite (fd, buf, count, offset)
ssize_t result;
/* First try the syscall. */
+ assert (sizeof (offset) == 4);
result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
- __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. */
diff --git a/sysdeps/unix/sysv/linux/pread.c b/sysdeps/unix/sysv/linux/pread.c
index da66488..2d5af61 100644
--- a/sysdeps/unix/sysv/linux/pread.c
+++ b/sysdeps/unix/sysv/linux/pread.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_pread (fd, buf, count, offset)
ssize_t result;
/* First try the syscall. */
+ assert (sizeof (offset) == 4);
result = INLINE_SYSCALL (pread, 5, fd, CHECK_N (buf, count), count,
- __LONG_LONG_PAIR (0, offset));
+ __LONG_LONG_PAIR (offset >> 31, offset));
# if __ASSUME_PREAD_SYSCALL == 0
if (result == -1 && errno == ENOSYS)
/* No system call available. Use the emulation. */
diff --git a/sysdeps/unix/sysv/linux/pwrite.c b/sysdeps/unix/sysv/linux/pwrite.c
index ceafef8..6a68adc 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. */