about summary refs log tree commit diff
path: root/sysdeps/unix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/i386/posix_fadvise64.S69
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h8
-rw-r--r--sysdeps/unix/sysv/linux/posix_fadvise64.c27
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/posix_fadvise64.c26
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c27
5 files changed, 7 insertions, 150 deletions
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, &parameters);
   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>