From cd682e15d9d2045ad3bdd1a2719573c6c987b3f8 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 17 Jul 2002 20:44:55 +0000 Subject: Update. 2002-07-17 Andreas Schwab Ulrich Drepper * 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. --- sysdeps/unix/sysv/linux/pread.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sysdeps/unix/sysv/linux/pread.c') diff --git a/sysdeps/unix/sysv/linux/pread.c b/sysdeps/unix/sysv/linux/pread.c index da664887fe..2d5af618ac 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 , 1997. @@ -17,6 +17,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include #include #include #include @@ -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. */ -- cgit 1.4.1