From: Roland McGrath Date: Wed, 10 Sep 2003 23:39:29 +0000 (+0000) Subject: * sysdeps/unix/sysv/linux/mips/pread64.c (__libc_pread64): Fix X-Git-Tag: cvs/glibc-2_3_3~233 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1fe4d5652dc109d04c3ef14985d37123a7dd6d9f;p=thirdparty%2Fglibc.git * sysdeps/unix/sysv/linux/mips/pread64.c (__libc_pread64): Fix syscall invocation. * sysdeps/unix/sysv/linux/mips/pwrite64.c (__libc_pwrite64): Likewise. * sysdeps/unix/sysv/linux/mips/pread.c (__libc_pread): Likewise. Also, only assert off_t size is 4 for N32 and O32, and clean up white space. * sysdeps/unix/sysv/linux/mips/pwrite.c (__libc_pwrite): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 5f8d661dc9f..f650f78ee84 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2003-09-10 Chris Demetriou + + * sysdeps/unix/sysv/linux/mips/pread64.c (__libc_pread64): Fix + syscall invocation. + * sysdeps/unix/sysv/linux/mips/pwrite64.c (__libc_pwrite64): Likewise. + * sysdeps/unix/sysv/linux/mips/pread.c (__libc_pread): Likewise. + Also, only assert off_t size is 4 for N32 and O32, and clean up + white space. + * sysdeps/unix/sysv/linux/mips/pwrite.c (__libc_pwrite): Likewise. + 2003-09-10 Roland McGrath * sysdeps/unix/sysv/linux/tcgetattr.c (__tcgetattr): diff --git a/sysdeps/unix/sysv/linux/mips/pread.c b/sysdeps/unix/sysv/linux/mips/pread.c index 86d47e9b7a5..7a9b0860bac 100644 --- a/sysdeps/unix/sysv/linux/mips/pread.c +++ b/sysdeps/unix/sysv/linux/mips/pread.c @@ -51,32 +51,33 @@ __libc_pread (fd, buf, count, offset) { ssize_t result; +#if (defined _ABI64 && _MIPS_SIM != _ABI64) + assert (sizeof (offset) == 4); +#endif + if (SINGLE_THREAD_P) { - /* First try the syscall. */ - assert (sizeof (offset) == 4); -#if defined _ABI64 && _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pread, 5, fd, CHECK_N (buf, count), count, 0, - offset); + /* First try the syscall. */ +#if (defined _ABIN32 && _MIPS_SIM == _ABIN32) || (defined _ABI64 && _MIPS_SIM == _ABI64) + result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, + offset); #else - result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR (offset >> 31, offset)); + result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR (offset >> 31, offset)); #endif # if __ASSUME_PREAD_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pread (fd, buf, count, offset); + if (result == -1 && errno == ENOSYS) + /* No system call available. Use the emulation. */ + result = __emulate_pread (fd, buf, count, offset); # endif - return result; + return result; } int oldtype = LIBC_CANCEL_ASYNC (); /* First try the syscall. */ - assert (sizeof (offset) == 4); -#if defined _ABI64 && _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pread, 5, fd, CHECK_N (buf, count), count, 0, - offset); +#if (defined _ABIN32 && _MIPS_SIM == _ABIN32) || (defined _ABI64 && _MIPS_SIM == _ABI64) + result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, offset); #else result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, __LONG_LONG_PAIR (offset >> 31, offset)); diff --git a/sysdeps/unix/sysv/linux/mips/pread64.c b/sysdeps/unix/sysv/linux/mips/pread64.c index 9a20987b92f..25f80df8ed2 100644 --- a/sysdeps/unix/sysv/linux/mips/pread64.c +++ b/sysdeps/unix/sysv/linux/mips/pread64.c @@ -54,8 +54,8 @@ __libc_pread64 (fd, buf, count, offset) if (SINGLE_THREAD_P) { /* First try the syscall. */ -#if defined _ABI64 && _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pread, 5, fd, CHECK_N (buf, count), count, 0, +#if (defined _ABIN32 && _MIPS_SIM == _ABIN32) || (defined _ABI64 && _MIPS_SIM == _ABI64) + result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, offset); #else result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, @@ -73,9 +73,8 @@ __libc_pread64 (fd, buf, count, offset) int oldtype = LIBC_CANCEL_ASYNC (); /* First try the syscall. */ -#if defined _ABI64 && _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pread, 5, fd, CHECK_N (buf, count), count, 0, - offset); +#if (defined _ABIN32 && _MIPS_SIM == _ABIN32) || (defined _ABI64 && _MIPS_SIM == _ABI64) + result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, offset); #else result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, __LONG_LONG_PAIR ((off_t) (offset >> 32), diff --git a/sysdeps/unix/sysv/linux/mips/pwrite.c b/sysdeps/unix/sysv/linux/mips/pwrite.c index 6fb74534cca..3c0eba57578 100644 --- a/sysdeps/unix/sysv/linux/mips/pwrite.c +++ b/sysdeps/unix/sysv/linux/mips/pwrite.c @@ -51,33 +51,33 @@ __libc_pwrite (fd, buf, count, offset) { ssize_t result; +#if (defined _ABI64 && _MIPS_SIM != _ABI64) + assert (sizeof (offset) == 4); +#endif + if (SINGLE_THREAD_P) { /* First try the syscall. */ - assert (sizeof (offset) == 4); -#if defined _ABI64 && _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pwrite, 5, fd, CHECK_N (buf, count), count, 0, - offset); +#if (defined _ABIN32 && _MIPS_SIM == _ABIN32) || (defined _ABI64 && _MIPS_SIM == _ABI64) + result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, + offset); #else - result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, - __LONG_LONG_PAIR (offset >> 31, offset)); + result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, + __LONG_LONG_PAIR (offset >> 31, offset)); #endif # if __ASSUME_PWRITE_SYSCALL == 0 - if (result == -1 && errno == ENOSYS) - /* No system call available. Use the emulation. */ - result = __emulate_pwrite (fd, buf, count, offset); + if (result == -1 && errno == ENOSYS) + /* No system call available. Use the emulation. */ + result = __emulate_pwrite (fd, buf, count, offset); # endif - return result; } int oldtype = LIBC_CANCEL_ASYNC (); /* First try the syscall. */ - assert (sizeof (offset) == 4); -#if defined _ABI64 && _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pwrite, 5, fd, CHECK_N (buf, count), count, 0, - offset); +#if (defined _ABIN32 && _MIPS_SIM == _ABIN32) || (defined _ABI64 && _MIPS_SIM == _ABI64) + result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset); #else result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, __LONG_LONG_PAIR (offset >> 31, offset)); diff --git a/sysdeps/unix/sysv/linux/mips/pwrite64.c b/sysdeps/unix/sysv/linux/mips/pwrite64.c index 3ac4233fa09..fef333bcb12 100644 --- a/sysdeps/unix/sysv/linux/mips/pwrite64.c +++ b/sysdeps/unix/sysv/linux/mips/pwrite64.c @@ -53,8 +53,8 @@ __libc_pwrite64 (fd, buf, count, offset) if (SINGLE_THREAD_P) { /* First try the syscall. */ -#if defined _ABI64 && _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pwrite, 5, fd, CHECK_N (buf, count), count, 0, +#if (defined _ABIN32 && _MIPS_SIM == _ABIN32) || (defined _ABI64 && _MIPS_SIM == _ABI64) + result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset); #else result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, @@ -73,9 +73,8 @@ __libc_pwrite64 (fd, buf, count, offset) int oldtype = LIBC_CANCEL_ASYNC (); /* First try the syscall. */ -#if defined _ABI64 && _MIPS_SIM == _ABI64 - result = INLINE_SYSCALL (pwrite, 5, fd, CHECK_N (buf, count), count, 0, - offset); +#if (defined _ABIN32 && _MIPS_SIM == _ABIN32) || (defined _ABI64 && _MIPS_SIM == _ABI64) + result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset); #else result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, __LONG_LONG_PAIR ((off_t) (offset >> 32),