From d7fafc1a39a9fe939ab108c47396cce866de812f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 17 Jul 2002 20:42:56 +0000 Subject: [PATCH] Sign extend offset. --- sysdeps/unix/sysv/linux/mips/pread.c | 6 ++++-- sysdeps/unix/sysv/linux/mips/pwrite.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 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 , 1997. @@ -17,6 +17,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include #include #include #include @@ -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 , 1997. @@ -17,6 +17,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include #include #include #include @@ -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. */ -- 2.7.4