diff options
-rw-r--r-- | ChangeLog | 33 | ||||
-rw-r--r-- | ports/ChangeLog.m68k | 5 | ||||
-rw-r--r-- | ports/ChangeLog.tile | 5 | ||||
-rw-r--r-- | ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h | 1 | ||||
-rw-r--r-- | ports/sysdeps/unix/sysv/linux/tile/kernel-features.h | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/posix_fadvise64.S | 69 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/kernel-features.h | 8 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/posix_fadvise64.c | 27 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise64.c | 26 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c | 27 |
10 files changed, 50 insertions, 152 deletions
diff --git a/ChangeLog b/ChangeLog index 12e5b4c2df..e5870d5d74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,36 @@ +2012-08-21 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/kernel-features.h + (__ASSUME_FADVISE64_64_SYSCALL): Remove. + * sysdeps/unix/sysv/linux/i386/posix_fadvise64.S: Do not include + <kernel-features.h>. + [__NR_fadvise64_64]: Make code unconditional. + [!__ASSUME_FADVISE64_64_SYSCALL]: Remove conditional code. + [__NR_fadvise64 && (!__ASSUME_FADVISE64_64_SYSCALL || + !__NR_fadvise64_64)]: Likewise. + [!(__NR_fadvise64 && (!__ASSUME_FADVISE64_64_SYSCALL || + !__NR_fadvise64_64))]: Likewise. + [__NR_fadvise64]: Make code unconditional. + [!__NR_fadvise64]: Remove conditional code. + * sysdeps/unix/sysv/linux/posix_fadvise64.c: Do not include + <kernel-features.h>. + (__posix_fadvise64_l64) [__NR_fadvise64_64]: Make code + unconditional. + (_posix_fadvise64_l64) [!__ASSUME_FADVISE64_64_SYSCALL]: Remove + conditional code. + * sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise64.c: Do + not include <kernel-features.h>. + (__posix_fadvise64_l64) [__NR_fadvise64_64]: Make code + unconditional. + (_posix_fadvise64_l64) [!__ASSUME_FADVISE64_64_SYSCALL]: Remove + conditional code. + * sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c: Do not + include <kernel-features.h>. + (__posix_fadvise64_l64) [__NR_fadvise64_64]: Make code + unconditional. + (_posix_fadvise64_l64) [!__ASSUME_FADVISE64_64_SYSCALL]: Remove + conditional code. + 2012-08-21 Will Schmidt <will_schmidt@vnet.ibm.com> * sysdeps/powerpc/powerpc64/power7/memchr.S: Unrolled short loop and diff --git a/ports/ChangeLog.m68k b/ports/ChangeLog.m68k index 5cdbe37a30..b438631cad 100644 --- a/ports/ChangeLog.m68k +++ b/ports/ChangeLog.m68k @@ -1,3 +1,8 @@ +2012-08-21 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/m68k/kernel-features.h + (__ASSUME_FADVISE64_64_SYSCALL): Remove. + 2012-08-20 Joseph Myers <joseph@codesourcery.com> * sysdeps/unix/sysv/linux/m68k/kernel-features.h diff --git a/ports/ChangeLog.tile b/ports/ChangeLog.tile index 7e5cc6f3e8..10acc1ece5 100644 --- a/ports/ChangeLog.tile +++ b/ports/ChangeLog.tile @@ -1,3 +1,8 @@ +2012-08-21 Joseph Myers <joseph@codesourcery.com> + + * sysdeps/unix/sysv/linux/tile/kernel-features.h + (__ASSUME_FADVISE64_64_SYSCALL): Remove. + 2012-08-20 Joseph Myers <joseph@codesourcery.com> * sysdeps/unix/sysv/linux/tile/kernel-features.h diff --git a/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h index 701600e8fd..3df653c48e 100644 --- a/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/ports/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -22,7 +22,6 @@ /* Many syscalls were added in 2.6.10 for m68k. */ #define __ASSUME_UTIMES 1 -#define __ASSUME_FADVISE64_64_SYSCALL 1 #include_next <kernel-features.h> diff --git a/ports/sysdeps/unix/sysv/linux/tile/kernel-features.h b/ports/sysdeps/unix/sysv/linux/tile/kernel-features.h index 04634484e8..cebfac4961 100644 --- a/ports/sysdeps/unix/sysv/linux/tile/kernel-features.h +++ b/ports/sysdeps/unix/sysv/linux/tile/kernel-features.h @@ -20,7 +20,6 @@ /* TILE glibc support starts with 2.6.36, guaranteeing many kernel features. */ #define __ASSUME_STAT64_SYSCALL 1 #define __ASSUME_UTIMES 1 -#define __ASSUME_FADVISE64_64_SYSCALL 1 #define __ASSUME_O_CLOEXEC 1 #define __ASSUME_SOCK_CLOEXEC 1 #define __ASSUME_IN_NONBLOCK 1 diff --git a/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S b/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S index 79fc071d2b..00e6a4194d 100644 --- a/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S +++ b/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S @@ -1,5 +1,4 @@ -/* Copyright (C) 1995-2000,2002,2003,2004,2005,2006 - Free Software Foundation, Inc. +/* Copyright (C) 1995-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,8 +19,6 @@ #include <bp-sym.h> #include <bp-asm.h> -#include <kernel-features.h> - #define EINVAL 22 #define ENOSYS 38 #define EOVERFLOW 75 @@ -38,8 +35,6 @@ .text ENTRY (BP_SYM (__posix_fadvise64_l64)) -#ifdef __NR_fadvise64_64 - /* Save registers. */ pushl %ebp cfi_adjust_cfa_offset (4) @@ -78,11 +73,6 @@ ENTRY (BP_SYM (__posix_fadvise64_l64)) cfi_adjust_cfa_offset (-4) cfi_restore (ebp) -#ifndef __ASSUME_FADVISE64_64_SYSCALL - cmpl $-ENOSYS, %eax - je 1f -#endif - /* The function returns zero, or the error number. So all we have to do is negate the value passed back from the kernel. */ /* If 0 > %eax > -4096 there was an error. */ @@ -90,72 +80,15 @@ ENTRY (BP_SYM (__posix_fadvise64_l64)) /* Successful; return the syscall's value. */ ret -#endif - -#if defined __NR_fadvise64 \ - && (!defined __ASSUME_FADVISE64_64_SYSCALL || !defined __NR_fadvise64_64) -1: /* Save registers. */ - pushl %ebx - cfi_adjust_cfa_offset (4) - pushl %esi - cfi_adjust_cfa_offset (4) - pushl %edi - cfi_adjust_cfa_offset (4) - - /* Overflow check. */ - cmpl $0, LENHI(%esp) - movl $-EOVERFLOW, %eax - jne L(overflow) - - movl FD(%esp), %ebx - cfi_rel_offset (ebx, 8) - movl OFFLO(%esp), %ecx - movl OFFHI(%esp), %edx - movl LENLO(%esp), %esi - cfi_rel_offset (esi, 4) - movl FLAGS(%esp), %edi - cfi_rel_offset (edi, 0) - - movl $SYS_ify(fadvise64), %eax - ENTER_KERNEL - - /* Restore registers. */ -L(overflow): - popl %edi - cfi_adjust_cfa_offset (-4) - cfi_restore (edi) - popl %esi - cfi_adjust_cfa_offset (-4) - cfi_restore (esi) - popl %ebx - cfi_adjust_cfa_offset (-4) - cfi_restore (ebx) - - /* If 0 > %eax > -4096 there was an error. */ - negl %eax - - /* Successful; return the syscall's value. */ - ret -#else - movl $ENOSYS, %eax - ret -#endif END (BP_SYM (__posix_fadvise64_l64)) -#ifdef __NR_fadvise64 .section .text.compat, "ax" ENTRY (__posix_fadvise64_l32) DO_CALL (fadvise64, 5) negl %eax ret PSEUDO_END_ERRVAL (__posix_fadvise64_l32) -#else -ENTRY (BP_SYM (__posix_fadvise64_l32)) - movl $ENOSYS, %eax - ret -END (BP_SYM (__posix_fadvise64_l32)) -#endif default_symbol_version (__posix_fadvise64_l64, posix_fadvise64, GLIBC_2.3.3) symbol_version (__posix_fadvise64_l32, posix_fadvise64, GLIBC_2.2) diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 2e459150cf..281faad94d 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -98,14 +98,6 @@ # define __ASSUME_UTIMES 1 #endif -/* The fixed version of the posix_fadvise64 syscall appeared in - 2.6.0-test3. At least for x86 and sparc. Powerpc support appeared - in 2.6.2, but for 32-bit userspace only. */ -#if (defined __i386__ || defined __sparc__ \ - || (defined __powerpc__ && !defined __powerpc64__)) -# define __ASSUME_FADVISE64_64_SYSCALL 1 -#endif - /* On sparc64 stat64/lstat64/fstat64 syscalls were introduced in 2.6.12. */ #if defined __sparc__ && defined __arch64__ # define __ASSUME_STAT64_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/posix_fadvise64.c b/sysdeps/unix/sysv/linux/posix_fadvise64.c index 5d51cf2430..3eea6deac8 100644 --- a/sysdeps/unix/sysv/linux/posix_fadvise64.c +++ b/sysdeps/unix/sysv/linux/posix_fadvise64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,7 +18,6 @@ #include <errno.h> #include <fcntl.h> #include <sysdep.h> -#include <kernel-features.h> int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise); int __posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise); @@ -29,7 +28,6 @@ int __posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise); int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise) { -#ifdef __NR_fadvise64_64 INTERNAL_SYSCALL_DECL (err); int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd, __LONG_LONG_PAIR ((long) (offset >> 32), @@ -39,28 +37,7 @@ __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise) advise); if (!INTERNAL_SYSCALL_ERROR_P (ret, err)) return 0; -# ifndef __ASSUME_FADVISE64_64_SYSCALL - if (INTERNAL_SYSCALL_ERRNO (ret, err) != ENOSYS) -# endif - return INTERNAL_SYSCALL_ERRNO (ret, err); -#endif -#ifndef __ASSUME_FADVISE64_64_SYSCALL -# ifdef __NR_fadvise64 - if (len != (off_t) len) - return EOVERFLOW; - - INTERNAL_SYSCALL_DECL (err2); - int ret2 = INTERNAL_SYSCALL (fadvise64, err2, 5, fd, - __LONG_LONG_PAIR ((long) (offset >> 32), - (long) offset), - (off_t) len, advise); - if (!INTERNAL_SYSCALL_ERROR_P (ret2, err2)) - return 0; - return INTERNAL_SYSCALL_ERRNO (ret2, err2); -# else - return ENOSYS; -# endif -#endif + return INTERNAL_SYSCALL_ERRNO (ret, err); } #include <shlib-compat.h> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise64.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise64.c index 2ffaec6751..5b11e28ba8 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise64.c +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,7 +18,6 @@ #include <errno.h> #include <fcntl.h> #include <sysdep.h> -#include <kernel-features.h> int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise); int __posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise); @@ -29,34 +28,13 @@ int __posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise); int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise) { -#ifdef __NR_fadvise64_64 INTERNAL_SYSCALL_DECL (err); int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd, advise, __LONG_LONG_PAIR ((long)(offset >> 32), (long)offset), __LONG_LONG_PAIR ((long)(len >> 32), (long)len)); if (!INTERNAL_SYSCALL_ERROR_P (ret, err)) return 0; -# ifndef __ASSUME_FADVISE64_64_SYSCALL - if (INTERNAL_SYSCALL_ERRNO (ret, err) != ENOSYS) -# endif - return INTERNAL_SYSCALL_ERRNO (ret, err); -#endif -#ifndef __ASSUME_FADVISE64_64_SYSCALL -# ifdef __NR_fadvise64 - if (len != (off_t) len) - return EOVERFLOW; - - INTERNAL_SYSCALL_DECL (err2); - int ret2 = INTERNAL_SYSCALL (fadvise64, err2, 6, fd, 0, - __LONG_LONG_PAIR ((long)(offset >> 32), (long)offset), - (off_t) len, advise); - if (!INTERNAL_SYSCALL_ERROR_P (ret2, err2)) - return 0; - return INTERNAL_SYSCALL_ERRNO (ret2, err2); -# else - return ENOSYS; -# endif -#endif + return INTERNAL_SYSCALL_ERRNO (ret, err); } #include <shlib-compat.h> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c b/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c index 05b81ecbcb..480b92fcbe 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c +++ b/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2003-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -18,7 +18,6 @@ #include <errno.h> #include <fcntl.h> #include <sysdep.h> -#include <kernel-features.h> int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise); int __posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise); @@ -37,7 +36,6 @@ struct fadvise64_64_layout int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise) { -#ifdef __NR_fadvise64_64 struct fadvise64_64_layout parameters; INTERNAL_SYSCALL_DECL (err); @@ -48,28 +46,7 @@ __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise) int ret = INTERNAL_SYSCALL (fadvise64_64, err, 1, ¶meters); if (!INTERNAL_SYSCALL_ERROR_P (ret, err)) return 0; -# ifndef __ASSUME_FADVISE64_64_SYSCALL - if (INTERNAL_SYSCALL_ERRNO (ret, err) != ENOSYS) -# endif - return INTERNAL_SYSCALL_ERRNO (ret, err); -#endif -#ifndef __ASSUME_FADVISE64_64_SYSCALL -# ifdef __NR_fadvise64 - if (len != (off_t) len) - return EOVERFLOW; - - INTERNAL_SYSCALL_DECL (err2); - int ret2 = INTERNAL_SYSCALL (fadvise64, err2, 5, fd, - __LONG_LONG_PAIR ((long) (offset >> 32), - (long) offset), - (off_t) len, advise); - if (!INTERNAL_SYSCALL_ERROR_P (ret2, err2)) - return 0; - return INTERNAL_SYSCALL_ERRNO (ret2, err2); -# else - return ENOSYS; -# endif -#endif + return INTERNAL_SYSCALL_ERRNO (ret, err); } #include <shlib-compat.h> |