]> sourceware.org Git - glibc.git/commitdiff
Remove pre-2.2 Linux kernel support.
authorJoseph Myers <joseph@codesourcery.com>
Mon, 14 May 2012 14:11:02 +0000 (14:11 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Mon, 14 May 2012 14:11:02 +0000 (14:11 +0000)
40 files changed:
ChangeLog
NEWS
sysdeps/unix/sysv/linux/configure
sysdeps/unix/sysv/linux/configure.in
sysdeps/unix/sysv/linux/getcwd.c
sysdeps/unix/sysv/linux/i386/chown.c
sysdeps/unix/sysv/linux/i386/fchownat.c
sysdeps/unix/sysv/linux/i386/sigaction.c
sysdeps/unix/sysv/linux/if_index.c
sysdeps/unix/sysv/linux/ifreq.c
sysdeps/unix/sysv/linux/kernel-features.h
sysdeps/unix/sysv/linux/poll.c
sysdeps/unix/sysv/linux/powerpc/chown.c
sysdeps/unix/sysv/linux/powerpc/fchownat.c
sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c
sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c
sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c
sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c
sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c
sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c
sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c
sysdeps/unix/sysv/linux/pread.c
sysdeps/unix/sysv/linux/pread64.c
sysdeps/unix/sysv/linux/ptsname.c
sysdeps/unix/sysv/linux/pwrite.c
sysdeps/unix/sysv/linux/pwrite64.c
sysdeps/unix/sysv/linux/sh/pread.c
sysdeps/unix/sysv/linux/sh/pread64.c
sysdeps/unix/sysv/linux/sh/pwrite.c
sysdeps/unix/sysv/linux/sh/pwrite64.c
sysdeps/unix/sysv/linux/sigaction.c
sysdeps/unix/sysv/linux/sigpending.c
sysdeps/unix/sysv/linux/sigprocmask.c
sysdeps/unix/sysv/linux/sigsuspend.c
sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
sysdeps/unix/sysv/linux/syslog.c
sysdeps/unix/sysv/linux/testrtsig.h
sysdeps/unix/sysv/linux/ttyname.c
sysdeps/unix/sysv/linux/ttyname_r.c

index 2c6a699ce97928b0de3ba030f720bbce781cbff9..371795616d8a49e20828a8e24f91fefe6da6c975 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,127 @@
+2012-05-14  Joseph Myers  <joseph@codesourcery.com>
+
+       [BZ #13717]
+       * sysdeps/unix/sysv/linux/configure.in (arch_minimum_kernel): Set
+       to 2.2.0 where earlier.
+       * sysdeps/unix/sysv/linux/configure: Regenerated.
+       * sysdeps/unix/sysv/linux/getcwd.c [!__ASSUME_GETCWD_SYSCALL]:
+       Remove conditional code.
+       [__ASSUME_GETCWD_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/i386/chown.c [!__ASSUME_LCHOWN_SYSCALL]:
+       Remove conditional code.
+       [!__NR_lchown]: Likewise.
+       [__ASSUME_LCHOWN_SYSCALL]: Make code unconditional.
+       [__NR_lchown]: Likewise.
+       * sysdeps/unix/sysv/linux/i386/fchownat.c (fchownat): Remove
+       comment referencing __ASSUME_LCHOWN_SYSCALL.
+       * sysdeps/unix/sysv/linux/i386/sigaction.c
+       [!__ASSUME_REALTIME_SIGNALS]: Remove conditional code.
+       [__ASSUME_REALTIME_SIGNALS]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/if_index.c [!__ASSUME_SIOCGIFNAME]:
+       Remove conditional code.
+       [__ASSUME_SIOCGIFNAME ]: Make code unconditional.
+       (__protocol_available): Remove #if 0 code.
+       * sysdeps/unix/sysv/linux/ifreq.c [!__ASSUME_SIOCGIFNAME]: Remove
+       conditional code.
+       [__ASSUME_SIOCGIFNAME]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/kernel-features.h
+       (__ASSUME_GETCWD_SYSCALL): Don't define.
+       (__ASSUME_REALTIME_SIGNALS): Likewise.
+       (__ASSUME_PREAD_SYSCALL): Likewise.
+       (__ASSUME_PWRITE_SYSCALL): Likewise.
+       (__ASSUME_POLL_SYSCALL): Likewise.
+       (__ASSUME_LCHOWN_SYSCALL): Likewise.
+       (__ASSUME_SETRESUID_SYSCALL): Define for all kernel versions for
+       non-SPARC.
+       (__ASSUME_SIOCGIFNAME): Don't define.
+       (__ASSUME_MSG_NOSIGNAL): Likewise.
+       (__ASSUME_SENDFILE): Define unconditionally.
+       (__ASSUME_PROC_SELF_FD_SYMLINK): Don't define.
+       * sysdeps/unix/sysv/linux/poll.c [!__ASSUME_POLL_SYSCALL]: Remove
+       conditional code.
+       [__ASSUME_POLL_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/powerpc/chown.c (__chown)
+       [!__ASSUME_LCHOWN_SYSCALL]: Remove conditional code.
+       (__chown) [__ASSUME_LCHOWN_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/powerpc/fchownat.c (fchownat)
+       [!__ASSUME_LCHOWN_SYSCALL]: Remove conditional code.
+       (fchownat) [__ASSUME_LCHOWN_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c
+       [!__ASSUME_PREAD_SYSCALL]: Remove conditional code.
+       [__ASSUME_PREAD_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
+       [!__ASSUME_PREAD_SYSCALL]: Remove conditional code.
+       [__ASSUME_PREAD_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c
+       [!__ASSUME_PWRITE_SYSCALL]: Remove conditional code.
+       [__ASSUME_PWRITE_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c
+       [!__ASSUME_PWRITE_SYSCALL]: Remove conditional code.
+       [__ASSUME_PWRITE_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c
+       [!__ASSUME_PREAD_SYSCALL]: Remove conditional code.
+       [__ASSUME_PREAD_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c
+       [!__ASSUME_PREAD_SYSCALL]: Remove conditional code.
+       [__ASSUME_PREAD_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c
+       [!__ASSUME_PWRITE_SYSCALL]: Remove conditional code.
+       [__ASSUME_PWRITE_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c
+       [!__ASSUME_PWRITE_SYSCALL]: Remove conditional code.
+       [__ASSUME_PWRITE_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/pread.c [!__ASSUME_PREAD_SYSCALL]:
+       Remove conditional code.
+       [__ASSUME_PREAD_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/pread64.c [!__ASSUME_PREAD_SYSCALL]:
+       Remove conditional code.
+       [__ASSUME_PREAD_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/ptsname.c (__ptsname_internal)
+       [__LINUX_KERNEL_VERSION < 131443]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/pwrite.c [!__ASSUME_PWRITE_SYSCALL]:
+       Remove conditional code.
+       [__ASSUME_PWRITE_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/pwrite64.c [!__ASSUME_PWRITE_SYSCALL]:
+       Remove conditional code.
+       [__ASSUME_PWRITE_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/sh/pread.c [!__ASSUME_PREAD_SYSCALL]:
+       Remove conditional code.
+       [__ASSUME_PREAD_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/sh/pread64.c [!__ASSUME_PREAD_SYSCALL]:
+       Remove conditional code.
+       [__ASSUME_PREAD_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/sh/pwrite.c [!__ASSUME_PWRITE_SYSCALL]:
+       Remove conditional code.
+       [__ASSUME_PWRITE_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/sh/pwrite64.c
+       [!__ASSUME_PWRITE_SYSCALL]: Remove conditional code.
+       [__ASSUME_PWRITE_SYSCALL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/sigaction.c
+       [!__ASSUME_REALTIME_SIGNALS]: Remove conditional code.
+       [__ASSUME_REALTIME_SIGNALS]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/sigpending.c
+       [!__ASSUME_REALTIME_SIGNALS]: Remove conditional code.
+       [__ASSUME_REALTIME_SIGNALS]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/sigprocmask.c
+       [!__ASSUME_REALTIME_SIGNALS]: Remove conditional code.
+       [__ASSUME_REALTIME_SIGNALS]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/sigsuspend.c
+       [!__ASSUME_REALTIME_SIGNALS]: Remove conditional code.
+       [__ASSUME_REALTIME_SIGNALS]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c
+       (__libc_missing_rt_sigs): Remove.
+       (__libc_sigaction) [__NR_rt_sigaction]: Make code unconditional.
+       (__libc_sigaction): Do not handle ENOSYS from rt_sigaction.
+       * sysdeps/unix/sysv/linux/syslog.c [!__ASSUME_MSG_NOSIGNAL]:
+       Remove conditional code.
+       [__ASSUME_MSG_NOSIGNAL]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/testrtsig.h (kernel_has_rtsig): Always
+       return 1.
+       * sysdeps/unix/sysv/linux/ttyname.c (ttyname)
+       [!__ASSUME_PROC_SELF_FD_SYMLINK]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/ttyname_r.c (__ttyname_r)
+       [!__ASSUME_PROC_SELF_FD_SYMLINK]: Likewise.
+
 2012-05-14  Andreas Jaeger  <aj@suse.de>
 
        * manual/string.texi (Copying and Concatenation): Add missing
diff --git a/NEWS b/NEWS
index 4e75d4935a5c46ad91898c8d0db4b4435ee67f4d..5e48976ad3507b9c2c2cf14ac4000ed8d08e56b3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -63,6 +63,10 @@ Version 2.16
   version 2.14.  This option will be removed at some time in the future
   after the TI-RPC library becomes fully sufficient for the needs of
   existing applications.
+
+* Compatibility code for Linux kernel versions before 2.2 has been removed.
+  Note that glibc is not expected to work with any Linux kernel version
+  before 2.6.
 \f
 Version 2.15
 
index d571d0b62be431076e8cce61e2e08c8d315c06f9..8235068a18e4e65edd6063c7d77565afd1cf652c 100644 (file)
@@ -284,11 +284,11 @@ test -n "$arch_minimum_kernel" ||
 case "$machine" in
   i386*)
     libc_cv_gcc_unwind_find_fde=yes
-    arch_minimum_kernel=2.0.10
+    arch_minimum_kernel=2.2.0
     ;;
   powerpc/powerpc32)
     libc_cv_gcc_unwind_find_fde=yes
-    arch_minimum_kernel=2.0.10
+    arch_minimum_kernel=2.2.0
     ;;
   powerpc/powerpc64)
     arch_minimum_kernel=2.4.21
@@ -311,13 +311,13 @@ case "$machine" in
     ;;
   sparc*)
     libc_cv_gcc_unwind_find_fde=yes
-    arch_minimum_kernel=2.0.10
+    arch_minimum_kernel=2.2.0
     ;;
   x86_64*)
     arch_minimum_kernel=2.4.0
     ;;
   *)
-    arch_minimum_kernel=2.0.10
+    arch_minimum_kernel=2.2.0
     ;;
 esac
 if test -n "$minimum_kernel"; then
@@ -331,7 +331,7 @@ $as_echo "$as_me: WARNING: minimum kernel version reset to $arch_minimum_kernel"
     minimum_kernel=$arch_minimum_kernel
   fi
 else
-  if test $arch_minimum_kernel != '2.0.10'; then
+  if test $arch_minimum_kernel != '2.2.0'; then
     minimum_kernel=$arch_minimum_kernel
   fi
 fi
index 916d64a60533e7f7b4e2437eb33144e26fa65a44..1ce14f294fee0b39e6ce8afc04f5c91caa3e2b4a 100644 (file)
@@ -41,11 +41,11 @@ test -n "$arch_minimum_kernel" ||
 case "$machine" in
   i386*)
     libc_cv_gcc_unwind_find_fde=yes
-    arch_minimum_kernel=2.0.10
+    arch_minimum_kernel=2.2.0
     ;;
   powerpc/powerpc32)
     libc_cv_gcc_unwind_find_fde=yes
-    arch_minimum_kernel=2.0.10
+    arch_minimum_kernel=2.2.0
     ;;
   powerpc/powerpc64)
     arch_minimum_kernel=2.4.21
@@ -68,13 +68,13 @@ case "$machine" in
     ;;
   sparc*)
     libc_cv_gcc_unwind_find_fde=yes
-    arch_minimum_kernel=2.0.10
+    arch_minimum_kernel=2.2.0
     ;;
   x86_64*)
     arch_minimum_kernel=2.4.0
     ;;
   *)
-    arch_minimum_kernel=2.0.10
+    arch_minimum_kernel=2.2.0
     ;;
 esac
 if test -n "$minimum_kernel"; then
@@ -87,7 +87,7 @@ if test -n "$minimum_kernel"; then
     minimum_kernel=$arch_minimum_kernel
   fi
 else
-  if test $arch_minimum_kernel != '2.0.10'; then
+  if test $arch_minimum_kernel != '2.2.0'; then
     minimum_kernel=$arch_minimum_kernel
   fi
 fi
index 6e3c5e06440b485954872ee6cbbccda45d618b42..8f884808c32a3790fdaaf51f475e52c5ba5f0f4f 100644 (file)
 #endif
 
 
-#if __ASSUME_GETCWD_SYSCALL > 0
-/* Kernel 2.1.92 introduced a third way to get the current working
-   directory: a syscall.  We've got to be careful that even when
-   compiling under 2.1.92+ the libc still runs under older kernels. */
-# define no_syscall_getcwd 0
-# define have_new_dcache 1
-#else
-# if __NR_getcwd
-/* Kernel 2.1.92 introduced a third way to get the current working
-   directory: a syscall.  We've got to be careful that even when
-   compiling under 2.1.92+ the libc still runs under older kernels.
-   An additional problem is that the system call does not return
-   the path of directories longer than one page.  */
-static int no_syscall_getcwd;
-static int have_new_dcache;
-# else
-#  define no_syscall_getcwd 1
-static int have_new_dcache = 1;
-# endif
-#endif
-
 /* The "proc" filesystem provides an easy method to retrieve the value.
    For each process, the corresponding directory contains a symbolic link
    named `cwd'.  Reading the content of this link immediate gives us the
@@ -73,9 +52,6 @@ __getcwd (char *buf, size_t size)
   int n;
   char *result;
 
-  if (no_syscall_getcwd && !have_new_dcache)
-    return generic_getcwd (buf, size);
-
 #ifndef NO_ALLOCATION
   size_t alloc_size = size;
   if (size == 0)
@@ -101,138 +77,59 @@ __getcwd (char *buf, size_t size)
 #endif
     path = buf;
 
-#if defined __NR_getcwd || __LINUX_GETCWD_SYSCALL > 0
-  if (!no_syscall_getcwd)
-    {
-      int retval;
-
-      retval = INLINE_SYSCALL (getcwd, 2, CHECK_STRING (path), alloc_size);
-      if (retval >= 0)
-       {
-# ifndef NO_ALLOCATION
-         if (buf == NULL && size == 0)
-           /* Ensure that the buffer is only as large as necessary.  */
-           buf = realloc (path, (size_t) retval);
-
-         if (buf == NULL)
-           /* Either buf was NULL all along, or `realloc' failed but
-              we still have the original string.  */
-           buf = path;
-# endif
-
-         return buf;
-       }
-
-      /* The system call cannot handle paths longer than a page.
-        Neither can the magic symlink in /proc/self.  Just use the
-        generic implementation right away.  */
-      if (errno == ENAMETOOLONG)
-       {
-# ifndef NO_ALLOCATION
-         if (buf == NULL && size == 0)
-           {
-             free (path);
-             path = NULL;
-           }
-# endif
-
-         result = generic_getcwd (path, size);
-
-# ifndef NO_ALLOCATION
-         if (result == NULL && buf == NULL && size != 0)
-           free (path);
-# endif
-
-         return result;
-       }
+  int retval;
 
-# if __ASSUME_GETCWD_SYSCALL
-      /* It should never happen that the `getcwd' syscall failed because
-        the buffer is too small if we allocated the buffer ourselves
-        large enough.  */
-      assert (errno != ERANGE || buf != NULL || size != 0);
+  retval = INLINE_SYSCALL (getcwd, 2, CHECK_STRING (path), alloc_size);
+  if (retval >= 0)
+    {
+#ifndef NO_ALLOCATION
+      if (buf == NULL && size == 0)
+       /* Ensure that the buffer is only as large as necessary.  */
+       buf = realloc (path, (size_t) retval);
 
-#  ifndef NO_ALLOCATION
       if (buf == NULL)
-       free (path);
-#  endif
+       /* Either buf was NULL all along, or `realloc' failed but
+          we still have the original string.  */
+       buf = path;
+#endif
 
-      return NULL;
-# else
-      if (errno == ENOSYS)
-       {
-          no_syscall_getcwd = 1;
-          have_new_dcache = 1; /* Now we will try the /proc method.  */
-       }
-      else if (errno != ERANGE || buf != NULL)
-       {
-#  ifndef NO_ALLOCATION
-         if (buf == NULL)
-           free (path);
-#  endif
-         return NULL;
-       }
-# endif
+      return buf;
     }
-#endif
 
-  n = __readlink ("/proc/self/cwd", path, alloc_size - 1);
-  if (n != -1)
+  /* The system call cannot handle paths longer than a page.
+     Neither can the magic symlink in /proc/self.  Just use the
+     generic implementation right away.  */
+  if (errno == ENAMETOOLONG)
     {
-      if (path[0] == '/')
-       {
-         if ((size_t) n >= alloc_size - 1)
-           {
 #ifndef NO_ALLOCATION
-             if (buf == NULL)
-               free (path);
-#endif
-             return NULL;
-           }
-
-         path[n] = '\0';
-#ifndef NO_ALLOCATION
-         if (buf == NULL && size == 0)
-           /* Ensure that the buffer is only as large as necessary.  */
-           buf = realloc (path, (size_t) n + 1);
-         if (buf == NULL)
-           /* Either buf was NULL all along, or `realloc' failed but
-              we still have the original string.  */
-           buf = path;
-#endif
-
-         return buf;
+      if (buf == NULL && size == 0)
+       {
+         free (path);
+         path = NULL;
        }
-#ifndef have_new_dcache
-      else
-       have_new_dcache = 0;
 #endif
-    }
 
-#if __ASSUME_GETCWD_SYSCALL == 0
-  /* Set to have_new_dcache only if error indicates that proc doesn't
-     exist.  */
-  if (errno != EACCES && errno != ENAMETOOLONG)
-    have_new_dcache = 0;
-#endif
+      result = generic_getcwd (path, size);
 
 #ifndef NO_ALLOCATION
-  /* Don't put restrictions on the length of the path unless the user does.  */
-  if (buf == NULL && size == 0)
-    {
-      free (path);
-      path = NULL;
-    }
+      if (result == NULL && buf == NULL && size != 0)
+       free (path);
 #endif
 
-  result = generic_getcwd (path, size);
+      return result;
+    }
+
+  /* It should never happen that the `getcwd' syscall failed because
+     the buffer is too small if we allocated the buffer ourselves
+     large enough.  */
+  assert (errno != ERANGE || buf != NULL || size != 0);
 
 #ifndef NO_ALLOCATION
-  if (result == NULL && buf == NULL && size != 0)
+  if (buf == NULL)
     free (path);
 #endif
 
-  return result;
+  return NULL;
 }
 weak_alias (__getcwd, getcwd)
 
index b87605f60267b09bb7f98970475ab7f91828d547..c8e53e4e00c52de4c66ec1579c7a1ad2bb62de70 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1998,1999,2000,2002,2003,2004,2006
-       Free Software Foundation, Inc.
+/* Copyright (C) 1998-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
@@ -42,64 +41,22 @@ extern int __chown_is_lchown (const char *__file, uid_t __owner,
 extern int __real_chown (const char *__file, uid_t __owner, gid_t __group);
 
 
-#if defined __NR_lchown || __ASSUME_LCHOWN_SYSCALL > 0
-/* Running under Linux > 2.1.80.  */
-
-# ifdef __NR_chown32
+#ifdef __NR_chown32
 #  if __ASSUME_32BITUIDS == 0
 /* This variable is shared with all files that need to check for 32bit
    uids.  */
 extern int __libc_missing_32bit_uids;
-#  endif
-# endif /* __NR_chown32 */
+# endif
+#endif /* __NR_chown32 */
 
 int
 __real_chown (const char *file, uid_t owner, gid_t group)
 {
-# if __ASSUME_LCHOWN_SYSCALL == 0
-  static int __libc_old_chown;
-  int result;
-
-  if (!__libc_old_chown)
-    {
-      int saved_errno = errno;
-#  ifdef __NR_chown32
-      if (__libc_missing_32bit_uids <= 0)
-       {
-         int result;
-         int saved_errno = errno;
-
-         result = INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
-         if (result == 0 || errno != ENOSYS)
-           return result;
-
-         __set_errno (saved_errno);
-         __libc_missing_32bit_uids = 1;
-       }
-#  endif /* __NR_chown32 */
-      if (((owner + 1) > (uid_t) ((__kernel_uid_t) -1U))
-         || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
-       {
-         __set_errno (EINVAL);
-         return -1;
-       }
-
-      result = INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group);
-
-      if (result >= 0 || errno != ENOSYS)
-       return result;
-
-      __set_errno (saved_errno);
-      __libc_old_chown = 1;
-    }
-
-  return __lchown (file, owner, group);
-# elif __ASSUME_32BITUIDS
-  /* This implies __ASSUME_LCHOWN_SYSCALL.  */
+#if __ASSUME_32BITUIDS
   return INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
-# else
-  /* !__ASSUME_32BITUIDS && ASSUME_LCHOWN_SYSCALL  */
-#  ifdef __NR_chown32
+#else
+  /* !__ASSUME_32BITUIDS */
+# ifdef __NR_chown32
   if (__libc_missing_32bit_uids <= 0)
     {
       int result;
@@ -112,7 +69,7 @@ __real_chown (const char *file, uid_t owner, gid_t group)
       __set_errno (saved_errno);
       __libc_missing_32bit_uids = 1;
     }
-#  endif /* __NR_chown32 */
+# endif /* __NR_chown32 */
   if (((owner + 1) > (uid_t) ((__kernel_uid_t) -1U))
       || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
     {
@@ -121,19 +78,11 @@ __real_chown (const char *file, uid_t owner, gid_t group)
     }
 
   return INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group);
-# endif
-}
 #endif
+}
 
 
-#if !defined __NR_lchown && __ASSUME_LCHOWN_SYSCALL == 0
-/* Compiling under older kernels.  */
-int
-__chown_is_lchown (const char *file, uid_t owner, gid_t group)
-{
-  return INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group);
-}
-#elif SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
 /* Compiling for compatibiity.  */
 int
 attribute_compat_text_section
@@ -147,12 +96,6 @@ __chown_is_lchown (const char *file, uid_t owner, gid_t group)
 compat_symbol (libc, __chown_is_lchown, chown, GLIBC_2_0);
 #endif
 
-#ifdef __NR_lchown
 versioned_symbol (libc, __real_chown, chown, GLIBC_2_1);
 strong_alias (__real_chown, __chown)
-#else
-strong_alias (__chown_is_lchown, __chown_is_lchown21)
-versioned_symbol (libc, __chown_is_lchown21, chown, GLIBC_2_1);
-strong_alias (__chown_is_lchown, __chown)
-#endif
 libc_hidden_def (__chown)
index 573a9b33c8e0e816623db9d8552dfe503846a480..6b748d16ba48c17798965b711ab8348152b0e0a5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2005-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
@@ -84,7 +84,6 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
     }
 
 # if __ASSUME_32BITUIDS > 0
-  /* This implies __ASSUME_LCHOWN_SYSCALL.  */
   INTERNAL_SYSCALL_DECL (err);
 
   if (flag & AT_SYMLINK_NOFOLLOW)
index 6424c7c24b7582789cf7b8354bf6ba839e4e7575..df5c235e5ac271dc550071354be97eb2ee17ee25 100644 (file)
@@ -1,5 +1,5 @@
 /* POSIX.1 `sigaction' call for Linux/i386.
-   Copyright (C) 1991,1995-2000,2002-2005,2006 Free Software Foundation, Inc.
+   Copyright (C) 1991-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
 #define SA_RESTORER 0x04000000
 
 
-#if __ASSUME_REALTIME_SIGNALS == 0
-/* The variable is shared between all wrappers around signal handling
-   functions which have RT equivalents.  */
-int __libc_missing_rt_sigs;
-#endif
-
 /* Using the hidden attribute here does not change the code but it
    helps to avoid warnings.  */
 #ifdef __NR_rt_sigaction
@@ -56,92 +50,39 @@ extern void restore (void) asm ("__restore") attribute_hidden;
 int
 __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 {
-#if __ASSUME_REALTIME_SIGNALS == 0
-  struct old_kernel_sigaction k_newact, k_oldact;
-#endif
   int result;
 
-#ifdef __NR_rt_sigaction
+  struct kernel_sigaction kact, koact;
 
-  /* First try the RT signals.  */
-# if __ASSUME_REALTIME_SIGNALS == 0
-  if (!__libc_missing_rt_sigs)
-# endif
+  if (act)
     {
-      struct kernel_sigaction kact, koact;
-# if __ASSUME_REALTIME_SIGNALS == 0
-      int saved_errno = errno;
-# endif
+      kact.k_sa_handler = act->sa_handler;
+      kact.sa_flags = act->sa_flags;
+      memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
 
-      if (act)
+      if (GLRO(dl_sysinfo_dso) == NULL)
        {
-         kact.k_sa_handler = act->sa_handler;
-         kact.sa_flags = act->sa_flags;
-         memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
+         kact.sa_flags |= SA_RESTORER;
 
-         if (GLRO(dl_sysinfo_dso) == NULL)
-           {
-             kact.sa_flags |= SA_RESTORER;
-
-             kact.sa_restorer = ((act->sa_flags & SA_SIGINFO)
-                                 ? &restore_rt : &restore);
-           }
-       }
-
-      /* XXX The size argument hopefully will have to be changed to the
-        real size of the user-level sigset_t.  */
-      result = INLINE_SYSCALL (rt_sigaction, 4,
-                              sig, act ? __ptrvalue (&kact) : NULL,
-                              oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
-
-# if __ASSUME_REALTIME_SIGNALS == 0
-      if (result >= 0 || errno != ENOSYS)
-# endif
-       {
-         if (oact && result >= 0)
-           {
-             oact->sa_handler = koact.k_sa_handler;
-             memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
-             oact->sa_flags = koact.sa_flags;
-             oact->sa_restorer = koact.sa_restorer;
-           }
-         return result;
+         kact.sa_restorer = ((act->sa_flags & SA_SIGINFO)
+                             ? &restore_rt : &restore);
        }
-
-# if __ASSUME_REALTIME_SIGNALS == 0
-      __set_errno (saved_errno);
-      __libc_missing_rt_sigs = 1;
-# endif
-    }
-#endif
-
-#if __ASSUME_REALTIME_SIGNALS == 0
-  if (act)
-    {
-      k_newact.k_sa_handler = act->sa_handler;
-      k_newact.sa_mask = act->sa_mask.__val[0];
-      k_newact.sa_flags = act->sa_flags | SA_RESTORER;
-
-      k_newact.sa_restorer = &restore;
     }
 
-  result = INLINE_SYSCALL (sigaction, 3, sig,
-                          act ? __ptrvalue (&k_newact) : 0,
-                          oact ? __ptrvalue (&k_oldact) : 0);
-
-  if (result < 0)
-    return -1;
+  /* XXX The size argument hopefully will have to be changed to the
+     real size of the user-level sigset_t.  */
+  result = INLINE_SYSCALL (rt_sigaction, 4,
+                          sig, act ? __ptrvalue (&kact) : NULL,
+                          oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
 
-  if (oact)
+  if (oact && result >= 0)
     {
-      oact->sa_handler = k_oldact.k_sa_handler;
-      oact->sa_mask.__val[0] = k_oldact.sa_mask;
-      oact->sa_flags = k_oldact.sa_flags;
-      oact->sa_restorer = k_oldact.sa_restorer;
+      oact->sa_handler = koact.k_sa_handler;
+      memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
+      oact->sa_flags = koact.sa_flags;
+      oact->sa_restorer = koact.sa_restorer;
     }
-
-  return 0;
-#endif
+  return result;
 }
 libc_hidden_def (__libc_sigaction)
 
index 8d9b4871ecdf6b664c5a75685eecc753abb3e8cf..3c86bb865458a8c5940311231b193110332d87cd 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2007
-   Free Software Foundation, Inc.
+/* Copyright (C) 1997-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
 #include "netlinkaccess.h"
 
 
-/* Variable to signal whether SIOCGIFCONF is not available.  */
-# if __ASSUME_SIOCGIFNAME == 0
-static int old_siocgifconf;
-#else
-# define old_siocgifconf 0
-#endif
-
-
 unsigned int
 if_nametoindex (const char *ifname)
 {
@@ -101,38 +92,20 @@ if_nameindex_ioctl (void)
 
   /* We may be able to get the needed buffer size directly, rather than
      guessing.  */
-  if (! old_siocgifconf)
-    {
-      ifc.ifc_buf = NULL;
-      ifc.ifc_len = 0;
-      if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0 || ifc.ifc_len == 0)
-       {
-# if __ASSUME_SIOCGIFNAME == 0
-         old_siocgifconf = 1;
-# endif
-         rq_len = RQ_IFS * sizeof (struct ifreq);
-       }
-      else
-       rq_len = ifc.ifc_len;
-    }
-  else
+  ifc.ifc_buf = NULL;
+  ifc.ifc_len = 0;
+  if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0 || ifc.ifc_len == 0)
     rq_len = RQ_IFS * sizeof (struct ifreq);
+  else
+    rq_len = ifc.ifc_len;
 
   /* Read all the interfaces out of the kernel.  */
   ifc.ifc_buf = alloca (rq_len);
   ifc.ifc_len = rq_len;
-  while (1)
+  if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0)
     {
-        if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0)
-       {
-         close_not_cancel_no_status (fd);
-         return NULL;
-       }
-      if (ifc.ifc_len < rq_len || ! old_siocgifconf)
-       break;
-
-      ifc.ifc_buf = extend_alloca (ifc.ifc_buf, rq_len, 2 * rq_len);
-      ifc.ifc_len = rq_len;
+      close_not_cancel_no_status (fd);
+      return NULL;
     }
 
   nifs = ifc.ifc_len / sizeof (struct ifreq);
@@ -314,161 +287,31 @@ libc_hidden_def (if_nameindex)
 char *
 if_indextoname (unsigned int ifindex, char *ifname)
 {
-#if !defined SIOCGIFINDEX && __ASSUME_SIOCGIFNAME == 0
-  __set_errno (ENOSYS);
-  return NULL;
-#else
-# if __ASSUME_SIOCGIFNAME == 0
-  struct if_nameindex *idx;
-  struct if_nameindex *p;
-  char *result = NULL;
-# endif
-
-# if defined SIOCGIFNAME || __ASSUME_SIOCGIFNAME > 0
   /* We may be able to do the conversion directly, rather than searching a
      list.  This ioctl is not present in kernels before version 2.1.50.  */
   struct ifreq ifr;
   int fd;
-#  if __ASSUME_SIOCGIFNAME == 0
-  static int siocgifname_works_not;
-
-  if (!siocgifname_works_not)
-#  endif
-    {
-#  if __ASSUME_SIOCGIFNAME == 0
-      int serrno = errno;
-#  endif
-      int status;
-
-      fd = __opensock ();
-
-      if (fd < 0)
-       return NULL;
-
-      ifr.ifr_ifindex = ifindex;
-      status = __ioctl (fd, SIOCGIFNAME, &ifr);
-
-      close_not_cancel_no_status (fd);
+  int status;
 
-      if (status  < 0)
-       {
-#  if __ASSUME_SIOCGIFNAME == 0
-         if (errno == EINVAL)
-           siocgifname_works_not = 1; /* Don't make the same mistake twice. */
-         else
-#  endif
-           {
-             if (errno == ENODEV)
-               /* POSIX requires ENXIO.  */
-               __set_errno (ENXIO);
+  fd = __opensock ();
 
-             return NULL;
-           }
-       }
-      else
-       return strncpy (ifname, ifr.ifr_name, IFNAMSIZ);
+  if (fd < 0)
+    return NULL;
 
-#  if __ASSUME_SIOCGIFNAME == 0
-      __set_errno (serrno);
-#  endif
-    }
-# endif
+  ifr.ifr_ifindex = ifindex;
+  status = __ioctl (fd, SIOCGIFNAME, &ifr);
 
-# if __ASSUME_SIOCGIFNAME == 0
-  idx = if_nameindex ();
+  close_not_cancel_no_status (fd);
 
-  if (idx != NULL)
+  if (status  < 0)
     {
-      for (p = idx; p->if_index || p->if_name; ++p)
-       if (p->if_index == ifindex)
-         {
-           result = strncpy (ifname, p->if_name, IFNAMSIZ);
-           break;
-         }
-
-      if_freenameindex (idx);
-
-      if (result == NULL)
+      if (errno == ENODEV)
+       /* POSIX requires ENXIO.  */
        __set_errno (ENXIO);
-    }
-  return result;
-# endif
-#endif
-}
-libc_hidden_def (if_indextoname)
-
-
-#if 0
-void
-internal_function
-__protocol_available (int *have_inet, int *have_inet6)
-{
-  int fd = __opensock ();
-  unsigned int nifs;
-  int rq_len;
-  struct ifconf ifc;
-# define RQ_IFS        4
 
-  /* Wirst case assumption.  */
-  *have_inet = 0;
-  *have_inet6 = 0;
-
-  if (fd < 0)
-    /* We cannot open the socket.  No networking at all?  */
-    return;
-
-  /* We may be able to get the needed buffer size directly, rather than
-     guessing.  */
-  if (! old_siocgifconf)
-    {
-      ifc.ifc_buf = NULL;
-      ifc.ifc_len = 0;
-      if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0 || ifc.ifc_len == 0)
-       {
-# if __ASSUME_SIOCGIFNAME == 0
-         old_siocgifconf = 1;
-# endif
-         rq_len = RQ_IFS * sizeof (struct ifreq);
-       }
-      else
-       rq_len = ifc.ifc_len;
+      return NULL;
     }
   else
-    rq_len = RQ_IFS * sizeof (struct ifreq);
-
-  /* Read all the interfaces out of the kernel.  */
-  do
-    {
-      ifc.ifc_buf = alloca (ifc.ifc_len = rq_len);
-      if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0)
-       {
-         close_not_cancel_no_status (fd);
-         return;
-       }
-      rq_len *= 2;
-    }
-  while (ifc.ifc_len == rq_len && old_siocgifconf);
-
-  nifs = ifc.ifc_len / sizeof (struct ifreq);
-
-  /* Go through all the interfaces and get the address.  */
-  while (nifs-- > 0)
-    if (__ioctl (fd, SIOCGIFADDR, &ifc.ifc_req[nifs]) >= 0)
-      {
-       /* We successfully got information about this interface.  Now
-          test whether it is an IPv4 or IPv6 address.  */
-       if (ifc.ifc_req[nifs].ifr_addr.sa_family == AF_INET)
-         *have_inet = 1;
-       else if (ifc.ifc_req[nifs].ifr_addr.sa_family == AF_INET6)
-         *have_inet6 = 1;
-
-       /* Note, this is & not &&.  It works since the values are always
-          0 or 1.  */
-       if (*have_inet & *have_inet6)
-         /* We can stop early.  */
-         break;
-      }
-
-  close_not_cancel_no_status (fd);
+    return strncpy (ifname, ifr.ifr_name, IFNAMSIZ);
 }
-#endif
+libc_hidden_def (if_indextoname)
index bd0d17e5d577608619c4c3a3d84d8b1cf9958697..551af725b09ca183ffeef61052d9e25c0a0ea0eb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999,2002,2003,2004,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>.
 
 #include "ifreq.h"
 #include <kernel-features.h>
 
-/* Variable to signal whether SIOCGIFCONF is not available.  */
-#if __ASSUME_SIOCGIFNAME == 0 || 1
-static int old_siocgifconf;
-#else
-# define old_siocgifconf 0
-#endif
-
 
 void
 __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd)
@@ -49,45 +42,27 @@ __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd)
 
   /* We may be able to get the needed buffer size directly, rather than
      guessing.  */
-  if (! old_siocgifconf)
-    {
-      ifc.ifc_buf = NULL;
-      ifc.ifc_len = 0;
-      if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0 || ifc.ifc_len == 0)
-       {
-# if __ASSUME_SIOCGIFNAME == 0
-         old_siocgifconf = 1;
-# endif
-         rq_len = RQ_IFS * sizeof (struct ifreq);
-       }
-      else
-       rq_len = ifc.ifc_len;
-    }
-  else
+  ifc.ifc_buf = NULL;
+  ifc.ifc_len = 0;
+  if (__ioctl (fd, SIOCGIFCONF, &ifc) < 0 || ifc.ifc_len == 0)
     rq_len = RQ_IFS * sizeof (struct ifreq);
+  else
+    rq_len = ifc.ifc_len;
 
   /* Read all the interfaces out of the kernel.  */
-  while (1)
+  ifc.ifc_len = rq_len;
+  void *newp = realloc (ifc.ifc_buf, ifc.ifc_len);
+  if (newp == NULL
+      || (ifc.ifc_buf = newp, __ioctl (fd, SIOCGIFCONF, &ifc)) < 0)
     {
-      ifc.ifc_len = rq_len;
-      void *newp = realloc (ifc.ifc_buf, ifc.ifc_len);
-      if (newp == NULL
-         || (ifc.ifc_buf = newp, __ioctl (fd, SIOCGIFCONF, &ifc)) < 0)
-       {
-         free (ifc.ifc_buf);
+      free (ifc.ifc_buf);
 
-         if (fd != sockfd)
-           __close (fd);
+      if (fd != sockfd)
+       __close (fd);
 
-         *num_ifs = 0;
-         *ifreqs = NULL;
-         return;
-       }
-
-      if (!old_siocgifconf || ifc.ifc_len < rq_len)
-       break;
-
-      rq_len *= 2;
+      *num_ifs = 0;
+      *ifreqs = NULL;
+      return;
     }
 
   nifs = ifc.ifc_len / sizeof (struct ifreq);
index ffaae5d14446daea054572529f6177bac7a694bc..1090f8a809d7d14986722f796f96a75df4f7074d 100644 (file)
    version given by __LINUX_KERNEL_VERSION.  We are not always exactly
    recording the correct versions in which the features were
    introduced.  If somebody cares these values can afterwards be
-   corrected.  Most of the numbers here are set corresponding to
-   2.2.0.  */
+   corrected.  */
 
-/* `getcwd' system call.  */
-#if __LINUX_KERNEL_VERSION >= 131584
-# define __ASSUME_GETCWD_SYSCALL       1
-#endif
-
-/* Real-time signal became usable in 2.1.70.  */
-#if __LINUX_KERNEL_VERSION >= 131398
-# define __ASSUME_REALTIME_SIGNALS     1
-#endif
-
-/* When were the `pread'/`pwrite' syscalls introduced?  */
-#if __LINUX_KERNEL_VERSION >= 131584
-# define __ASSUME_PREAD_SYSCALL                1
-# define __ASSUME_PWRITE_SYSCALL       1
-#endif
-
-/* When was `poll' introduced?  */
-#if __LINUX_KERNEL_VERSION >= 131584
-# define __ASSUME_POLL_SYSCALL         1
-#endif
-
-/* The `lchown' syscall was introduced in 2.1.80.  */
-#if __LINUX_KERNEL_VERSION >= 131408
-# define __ASSUME_LCHOWN_SYSCALL       1
-#endif
-
-/* When did the `setresuid' syscall became available?  */
-#if __LINUX_KERNEL_VERSION >= 131584 && !defined __sparc__
+/* When did the `setresuid' syscall became available?  By 2.2.0 except
+   on SPARC.  */
+#if !defined __sparc__
 # define __ASSUME_SETRESUID_SYSCALL    1
 #endif
 
-/* The SIOCGIFNAME ioctl is available starting with 2.1.50.  */
-#if __LINUX_KERNEL_VERSION >= 131408
-# define __ASSUME_SIOCGIFNAME          1
-#endif
-
-/* MSG_NOSIGNAL was at least available with Linux 2.2.0.  */
-#if __LINUX_KERNEL_VERSION >= 131584
-# define __ASSUME_MSG_NOSIGNAL         1
-#endif
-
 /* The sendfile syscall was introduced in 2.2.0.  */
-#if __LINUX_KERNEL_VERSION >= 131584
-# define __ASSUME_SENDFILE             1
-#endif
-
-/* Only very old kernels had no real symlinks for terminal descriptors
-   in /proc/self/fd.  */
-#if __LINUX_KERNEL_VERSION >= 131584
-# define __ASSUME_PROC_SELF_FD_SYMLINK 1
-#endif
+#define __ASSUME_SENDFILE              1
 
 /* On x86 another `getrlimit' syscall was added in 2.3.25.  */
 #if __LINUX_KERNEL_VERSION >= 131865 && defined __i386__
index c8f5e6deb198b8d876681d210ffbe22befc8600b..0abdad03995fe3859cc0ddec880f03dcf091eb54 100644 (file)
@@ -1,6 +1,5 @@
-/* Poll system call, with emulation if it is not available.
-   Copyright (C) 1997,1998,1999,2000,2001,2002,2006
-       Free Software Foundation, Inc.
+/* Poll system call.
+   Copyright (C) 1997-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
 
 #include <kernel-features.h>
 
-#if defined __NR_poll || __ASSUME_POLL_SYSCALL > 0
-
-# if __ASSUME_POLL_SYSCALL == 0
-static int __emulate_poll (struct pollfd *fds, nfds_t nfds,
-                          int timeout) internal_function;
-# endif
-
-
-# if __ASSUME_POLL_SYSCALL == 0
-/* For loser kernels.  */
-static int
-loser_poll (struct pollfd *fds, nfds_t nfds, int timeout)
-{
-  static int must_emulate;
-
-  if (!must_emulate)
-    {
-      int errno_saved = errno;
-      int retval = INLINE_SYSCALL (poll, 3, CHECK_N (fds, nfds), nfds,
-                                  timeout);
-
-      if (retval >= 0 || errno != ENOSYS)
-       return retval;
-
-      __set_errno (errno_saved);
-      must_emulate = 1;
-    }
-
-  return __emulate_poll (fds, nfds, timeout);
-}
-# endif
-
-
-/* The real implementation.  */
 int
 __poll (fds, nfds, timeout)
      struct pollfd *fds;
      nfds_t nfds;
      int timeout;
 {
-# if __ASSUME_POLL_SYSCALL == 0
-  if (SINGLE_THREAD_P)
-    return loser_poll (CHECK_N (fds, nfds), nfds, timeout);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = loser_poll (CHECK_N (fds, nfds), nfds, timeout);
-
-   LIBC_CANCEL_RESET (oldtype);
-
-  return result;
-# else
   if (SINGLE_THREAD_P)
     return INLINE_SYSCALL (poll, 3, CHECK_N (fds, nfds), nfds, timeout);
 
@@ -88,17 +41,7 @@ __poll (fds, nfds, timeout)
    LIBC_CANCEL_RESET (oldtype);
 
   return result;
-# endif
 }
 libc_hidden_def (__poll)
 weak_alias (__poll, poll)
 strong_alias (__poll, __libc_poll)
-
-/* Get the emulation code.  */
-# define __poll(fds, nfds, timeout) \
-  static internal_function __emulate_poll (fds, nfds, timeout)
-#endif
-
-#if __ASSUME_POLL_SYSCALL == 0
-# include <sysdeps/unix/bsd/poll.c>
-#endif
index 33bb4921c6a845ab64557a64c5c22cd39dd477d2..be6a828f9b58caadcd2de3c20fc971b02bbe15cb 100644 (file)
@@ -1,5 +1,5 @@
 /* chown() compatibility.
-   Copyright (C) 1998, 2000, 2002, 2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1998-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
 int
 __chown (const char *file, uid_t owner, gid_t group)
 {
-#if __ASSUME_LCHOWN_SYSCALL
   return INLINE_SYSCALL (chown, 3, file, owner, group);
-#else
-  int err;
-  int old_errno;
-  char link[PATH_MAX + 2];
-  char path[2 * PATH_MAX + 4];
-  int loopct;
-  size_t filelen;
-  static int libc_old_chown = 0 /* -1=old linux, 1=new linux, 0=unknown */;
-
-  if (libc_old_chown == 1)
-    return INLINE_SYSCALL (chown, 3, __ptrvalue (file), owner, group);
-
-  old_errno = errno;
-
-# ifdef __NR_lchown
-  if (libc_old_chown == 0)
-    {
-      err = INLINE_SYSCALL (chown, 3, __ptrvalue (file), owner, group);
-      if (err != -1 || errno != ENOSYS)
-       {
-         libc_old_chown = 1;
-         return err;
-       }
-      libc_old_chown = -1;
-    }
-# endif
-
-  err = __readlink (file, link, PATH_MAX + 1);
-  if (err == -1)
-    {
-      __set_errno (old_errno);
-      return __lchown (file, owner, group);
-    }
-
-  filelen = strlen (file) + 1;
-  if (filelen > sizeof (path))
-    {
-      __set_errno (ENAMETOOLONG);
-      return -1;
-    }
-  memcpy (path, file, filelen);
-
-  /* 'The system has an arbitrary limit...'  In practise, we'll hit
-     ENAMETOOLONG before this, usually.  */
-  for (loopct = 0; loopct < 128; ++loopct)
-    {
-      size_t linklen;
-
-      if (err >= PATH_MAX + 1)
-       {
-         __set_errno (ENAMETOOLONG);
-         return -1;
-       }
-
-      link[err] = 0;  /* Null-terminate string, just-in-case.  */
-
-      linklen = strlen (link) + 1;
-
-      if (link[0] == '/')
-       memcpy (path, link, linklen);
-      else
-       {
-         filelen = strlen (path);
-
-         while (filelen > 1 && path[filelen - 1] == '/')
-           --filelen;
-         while (filelen > 0 && path[filelen - 1] != '/')
-           --filelen;
-         if (filelen + linklen > sizeof (path))
-           {
-             errno = ENAMETOOLONG;
-             return -1;
-           }
-         memcpy (path + filelen, link, linklen);
-       }
-
-      err = __readlink (path, link, PATH_MAX + 1);
-
-      if (err == -1)
-       {
-         __set_errno (old_errno);
-         return __lchown (path, owner, group);
-       }
-    }
-  __set_errno (ELOOP);
-  return -1;
-#endif
 }
 libc_hidden_def (__chown)
 
index 16aacb36f7df50d1d997cfae04d1722a0c303e8a..b92e35a9e7ddd6cf6187c657d92e010baca75dfc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2005-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
@@ -86,7 +86,6 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
       file = buf;
     }
 
-# if __ASSUME_LCHOWN_SYSCALL
   INTERNAL_SYSCALL_DECL (err);
 
   if (flag & AT_SYMLINK_NOFOLLOW)
@@ -99,15 +98,6 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
       __atfct_seterrno (INTERNAL_SYSCALL_ERRNO (result, err), fd, buf);
       return -1;
     }
-# else
-  /* Don't inline the rest to avoid unnecessary code duplication.  */
-  if (flag & AT_SYMLINK_NOFOLLOW)
-    result = __lchown (file, owner, group);
-  else
-    result = __chown (file, owner, group);
-  if (result < 0)
-    __atfct_seterrno (errno, fd, buf);
-# endif
 
   return result;
 
index 9229aa4c7f69cdcb9d483fb47e2aa5b8148df48e..364834f1d0c717e7ac5ab30a29e706448f2346bc 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
-       Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 
 #include <kernel-features.h>
 
-#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-
-# if __ASSUME_PREAD_SYSCALL == 0
-static ssize_t __emulate_pread (int fd, void *buf, size_t count,
-                               off_t offset) internal_function;
-# endif
-
-
 ssize_t
 __libc_pread (fd, buf, count, offset)
      int fd;
@@ -49,11 +40,6 @@ __libc_pread (fd, buf, count, offset)
       /* On PPC32 64bit values are aligned in odd/even register pairs.  */
       result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count,
                               0, offset >> 31, offset);
-# if __ASSUME_PREAD_SYSCALL == 0
-      if (result == -1 && errno == ENOSYS)
-       /* No system call available.  Use the emulation.  */
-       result = __emulate_pread (fd, buf, count, offset);
-# endif
 
       return result;
     }
@@ -63,11 +49,6 @@ __libc_pread (fd, buf, count, offset)
   /* On PPC32 64bit values are aligned in odd/even register pairs.  */
   result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count,
                               0, offset >> 31, offset);
-# if __ASSUME_PREAD_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use the emulation.  */
-    result = __emulate_pread (fd, buf, count, offset);
-# endif
 
   LIBC_CANCEL_RESET (oldtype);
 
@@ -76,11 +57,3 @@ __libc_pread (fd, buf, count, offset)
 
 strong_alias (__libc_pread, __pread)
 weak_alias (__libc_pread, pread)
-
-# define __libc_pread(fd, buf, count, offset) \
-     static internal_function __emulate_pread (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PREAD_SYSCALL == 0
-# include <sysdeps/posix/pread.c>
-#endif
index 21c1f7b95cc84396075863a22e79558782f375e9..5b1445ff23ef9ab4c1a4a50edd0b145c45d04ad0 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
-       Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 
 #include <kernel-features.h>
 
-#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-
-# if __ASSUME_PREAD_SYSCALL == 0
-static ssize_t __emulate_pread64 (int fd, void *buf, size_t count,
-                                 off64_t offset) internal_function;
-# endif
-
 
 ssize_t
 __libc_pread64 (fd, buf, count, offset)
@@ -49,11 +41,6 @@ __libc_pread64 (fd, buf, count, offset)
       result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count,
                               0, (long) (offset >> 32),
                               (long) offset);
-# if __ASSUME_PREAD_SYSCALL == 0
-      if (result == -1 && errno == ENOSYS)
-       /* No system call available.  Use the emulation.  */
-       result = __emulate_pread64 (fd, buf, count, offset);
-# endif
 
       return result;
     }
@@ -64,11 +51,6 @@ __libc_pread64 (fd, buf, count, offset)
   result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count,
                           0, (long) (offset >> 32),
                           (long) offset);
-# if __ASSUME_PREAD_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use the emulation.  */
-    result = __emulate_pread64 (fd, buf, count, offset);
-# endif
 
   LIBC_CANCEL_RESET (oldtype);
 
@@ -77,11 +59,3 @@ __libc_pread64 (fd, buf, count, offset)
 
 weak_alias (__libc_pread64, __pread64)
 weak_alias (__libc_pread64, pread64)
-
-# define __libc_pread64(fd, buf, count, offset) \
-     static internal_function __emulate_pread64 (fd, buf, count, offset)
-#endif
-
-# if __ASSUME_PREAD_SYSCALL == 0
-# include <sysdeps/posix/pread64.c>
-#endif
index bf0e3414c279b7059382b20fee39086da153631e..ed1878bc5ee94a5ec9b1dad1b014de38796f897a 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
-       Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 
 #include <kernel-features.h>
 
-#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
-
-# if __ASSUME_PWRITE_SYSCALL == 0
-static ssize_t __emulate_pwrite (int fd, const void *buf, size_t count,
-                                off_t offset) internal_function;
-# endif
-
 
 ssize_t
 __libc_pwrite (fd, buf, count, offset)
@@ -49,11 +41,6 @@ __libc_pwrite (fd, buf, count, offset)
       /* On PPC32 64bit values are aligned in odd/even register pairs.  */
       result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count,
                               0, offset >> 31, offset);
-# if __ASSUME_PWRITE_SYSCALL == 0
-      if (result == -1 && errno == ENOSYS)
-       /* No system call available.  Use the emulation.  */
-       result = __emulate_pwrite (fd, buf, count, offset);
-# endif
 
       return result;
     }
@@ -63,11 +50,6 @@ __libc_pwrite (fd, buf, count, offset)
   /* On PPC32 64bit values are aligned in odd/even register pairs.  */
   result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count,
                           0, offset >> 31, offset);
-# if __ASSUME_PWRITE_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use the emulation.  */
-    result = __emulate_pwrite (fd, buf, count, offset);
-# endif
 
   LIBC_CANCEL_RESET (oldtype);
 
@@ -76,11 +58,3 @@ __libc_pwrite (fd, buf, count, offset)
 
 strong_alias (__libc_pwrite, __pwrite)
 weak_alias (__libc_pwrite, pwrite)
-
-# define __libc_pwrite(fd, buf, count, offset) \
-     static internal_function __emulate_pwrite (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PWRITE_SYSCALL == 0
-# include <sysdeps/posix/pwrite.c>
-#endif
index 0162d88395e38e5119fc105fa1d70ae01ce2c005..dedeb7e97d8ed14b191b8dc00473f341dde5b4c6 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
-       Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 
 #include <kernel-features.h>
 
-#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
-
-# if __ASSUME_PWRITE_SYSCALL == 0
-static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count,
-                                  off64_t offset) internal_function;
-# endif
-
 
 ssize_t
 __libc_pwrite64 (fd, buf, count, offset)
@@ -49,11 +41,6 @@ __libc_pwrite64 (fd, buf, count, offset)
       result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count,
                               0, (long) (offset >> 32),
                               (long) offset);
-# if __ASSUME_PWRITE_SYSCALL == 0
-      if (result == -1 && errno == ENOSYS)
-       /* No system call available.  Use the emulation.  */
-       result = __emulate_pwrite64 (fd, buf, count, offset);
-# endif
 
       return result;
     }
@@ -64,11 +51,6 @@ __libc_pwrite64 (fd, buf, count, offset)
   result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count,
                           0, (long) (offset >> 32),
                           (long) offset);
-# if __ASSUME_PWRITE_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use the emulation.  */
-    result = __emulate_pwrite64 (fd, buf, count, offset);
-# endif
 
   LIBC_CANCEL_RESET (oldtype);
 
@@ -78,11 +60,3 @@ __libc_pwrite64 (fd, buf, count, offset)
 weak_alias (__libc_pwrite64, __pwrite64)
 libc_hidden_weak (__pwrite64)
 weak_alias (__libc_pwrite64, pwrite64)
-
-# define __libc_pwrite64(fd, buf, count, offset) \
-     static internal_function __emulate_pwrite64 (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PWRITE_SYSCALL == 0
-# include <sysdeps/posix/pwrite64.c>
-#endif
index 6b8f3ea4f10fb261019ae9a5f5bae71b501384ef..e06de3bfe49766a974352025a89d7ee27658206b 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
-       Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 
 #include <kernel-features.h>
 
-#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-
-# if __ASSUME_PREAD_SYSCALL == 0
-static ssize_t __emulate_pread (int fd, void *buf, size_t count,
-                               off_t offset) internal_function;
-# endif
-
 
 ssize_t
 __libc_pread (fd, buf, count, offset)
@@ -48,11 +40,6 @@ __libc_pread (fd, buf, count, offset)
     {
       result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count,
                                 offset);
-# if __ASSUME_PREAD_SYSCALL == 0
-      if (result == -1 && errno == ENOSYS)
-       /* No system call available.  Use the emulation.  */
-       result = __emulate_pread (fd, buf, count, offset);
-# endif
 
       return result;
     }
@@ -61,11 +48,6 @@ __libc_pread (fd, buf, count, offset)
 
   result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count,
                             offset);
-# if __ASSUME_PREAD_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use the emulation.  */
-    result = __emulate_pread (fd, buf, count, offset);
-# endif
 
   LIBC_CANCEL_RESET (oldtype);
 
@@ -74,11 +56,3 @@ __libc_pread (fd, buf, count, offset)
 
 strong_alias (__libc_pread, __pread)
 weak_alias (__libc_pread, pread)
-
-# define __libc_pread(fd, buf, count, offset) \
-     static internal_function __emulate_pread (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PREAD_SYSCALL == 0
-# include <sysdeps/posix/pread.c>
-#endif
index 0933806b07aada59f64753c6e4a88dd4e689aac9..80c2d2c8a3c49a8d6e9acf313b5bd39ccae52810 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
-       Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 
 #include <kernel-features.h>
 
-#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-
-# if __ASSUME_PREAD_SYSCALL == 0
-static ssize_t __emulate_pread64 (int fd, void *buf, size_t count,
-                                 off64_t offset) internal_function;
-# endif
-
 
 ssize_t
 __libc_pread64 (fd, buf, count, offset)
@@ -47,11 +39,6 @@ __libc_pread64 (fd, buf, count, offset)
     {
       result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count,
                                 offset);
-# if __ASSUME_PREAD_SYSCALL == 0
-      if (result == -1 && errno == ENOSYS)
-       /* No system call available.  Use the emulation.  */
-       result = __emulate_pread64 (fd, buf, count, offset);
-# endif
 
       return result;
     }
@@ -60,11 +47,6 @@ __libc_pread64 (fd, buf, count, offset)
 
    result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count,
                             offset);
-# if __ASSUME_PREAD_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use the emulation.  */
-    result = __emulate_pread64 (fd, buf, count, offset);
-# endif
 
   LIBC_CANCEL_RESET (oldtype);
 
@@ -73,11 +55,3 @@ __libc_pread64 (fd, buf, count, offset)
 
 weak_alias (__libc_pread64, __pread64)
 weak_alias (__libc_pread64, pread64)
-
-# define __libc_pread64(fd, buf, count, offset) \
-     static internal_function __emulate_pread64 (fd, buf, count, offset)
-#endif
-
-# if __ASSUME_PREAD_SYSCALL == 0
-# include <sysdeps/posix/pread64.c>
-#endif
index b956b48ba0f3d4e107c27f3e5daadfd2c8388806..57458b43c565292d801cd05c1e81ee4b58f934ff 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
-       Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 
 #include <kernel-features.h>
 
-#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
-
-# if __ASSUME_PWRITE_SYSCALL == 0
-static ssize_t __emulate_pwrite (int fd, const void *buf, size_t count,
-                                off_t offset) internal_function;
-# endif
-
 
 ssize_t
 __libc_pwrite (fd, buf, count, offset)
@@ -48,11 +40,6 @@ __libc_pwrite (fd, buf, count, offset)
     {
       result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count,
                               offset);
-# if __ASSUME_PWRITE_SYSCALL == 0
-      if (result == -1 && errno == ENOSYS)
-       /* No system call available.  Use the emulation.  */
-       result = __emulate_pwrite (fd, buf, count, offset);
-# endif
 
       return result;
     }
@@ -61,11 +48,6 @@ __libc_pwrite (fd, buf, count, offset)
 
   result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count,
                                             offset);
-# if __ASSUME_PWRITE_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use the emulation.  */
-    result = __emulate_pwrite (fd, buf, count, offset);
-# endif
 
   LIBC_CANCEL_RESET (oldtype);
 
@@ -74,11 +56,3 @@ __libc_pwrite (fd, buf, count, offset)
 
 strong_alias (__libc_pwrite, __pwrite)
 weak_alias (__libc_pwrite, pwrite)
-
-# define __libc_pwrite(fd, buf, count, offset) \
-     static internal_function __emulate_pwrite (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PWRITE_SYSCALL == 0
-# include <sysdeps/posix/pwrite.c>
-#endif
index ec9bba53cbd02f4700c466e28079d59b1d57661f..75344dfd26864d32ad7e5b48a48e8ed79912c6f1 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
-       Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 
 #include <kernel-features.h>
 
-#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
-
-# if __ASSUME_PWRITE_SYSCALL == 0
-static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count,
-                                  off64_t offset) internal_function;
-# endif
-
 
 ssize_t
 __libc_pwrite64 (fd, buf, count, offset)
@@ -47,11 +39,6 @@ __libc_pwrite64 (fd, buf, count, offset)
     {
       result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count,
                                 offset);
-# if __ASSUME_PWRITE_SYSCALL == 0
-      if (result == -1 && errno == ENOSYS)
-       /* No system call available.  Use the emulation.  */
-       result = __emulate_pwrite64 (fd, buf, count, offset);
-# endif
 
       return result;
     }
@@ -60,11 +47,6 @@ __libc_pwrite64 (fd, buf, count, offset)
 
   result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count,
                             offset);
-# if __ASSUME_PWRITE_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use the emulation.  */
-    result = __emulate_pwrite64 (fd, buf, count, offset);
-# endif
 
   LIBC_CANCEL_RESET (oldtype);
 
@@ -74,11 +56,3 @@ __libc_pwrite64 (fd, buf, count, offset)
 weak_alias (__libc_pwrite64, __pwrite64)
 libc_hidden_weak (__pwrite64)
 weak_alias (__libc_pwrite64, pwrite64)
-
-# define __libc_pwrite64(fd, buf, count, offset) \
-     static internal_function __emulate_pwrite64 (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PWRITE_SYSCALL == 0
-# include <sysdeps/posix/pwrite64.c>
-#endif
index dd8c5e767ed2fa80c6ea833689b375efcf6c4f64..4ea67fcb0b04c2715df13b77fb63abb27c0d8796 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2000,2002,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 # define __NR_pread __NR_pread64
 #endif
 
-#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-
-# if __ASSUME_PREAD_SYSCALL == 0
-static ssize_t __emulate_pread (int fd, void *buf, size_t count,
-                               off_t offset) internal_function;
-# endif
-
 
 static ssize_t
 #ifdef NO_CANCELLATION
@@ -50,15 +43,9 @@ do_pread (int fd, void *buf, size_t count, off_t 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 (offset >> 31, offset));
-# if __ASSUME_PREAD_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use the emulation.  */
-    result = __emulate_pread (fd, buf, count, offset);
-# endif
 
   return result;
 }
@@ -85,11 +72,3 @@ __libc_pread (fd, buf, count, offset)
 
 strong_alias (__libc_pread, __pread)
 weak_alias (__libc_pread, pread)
-
-# define __libc_pread(fd, buf, count, offset) \
-     static internal_function __emulate_pread (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PREAD_SYSCALL == 0
-# include <sysdeps/posix/pread.c>
-#endif
index 8d2d02bfe5df3f72ccc95bc2f6912fd4c4fdc177..897b5674a75c23be869e9a8781511e65b3815045 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
-       Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 # define __NR_pread __NR_pread64
 #endif
 
-#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-
-# if __ASSUME_PREAD_SYSCALL == 0
-static ssize_t __emulate_pread64 (int fd, void *buf, size_t count,
-                                 off64_t offset) internal_function;
-# endif
-
 
 static ssize_t
 do_pread64 (int fd, void *buf, size_t count, off64_t offset)
 {
   ssize_t result;
 
-  /* First try the syscall.  */
   result = INLINE_SYSCALL (pread, 5, fd, CHECK_N (buf, count), count,
                           __LONG_LONG_PAIR ((off_t) (offset >> 32),
                                             (off_t) (offset & 0xffffffff)));
-# if __ASSUME_PREAD_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use the emulation.  */
-    result = __emulate_pread64 (fd, buf, count, offset);
-# endif
 
   return result;
 }
@@ -82,11 +68,3 @@ __libc_pread64 (fd, buf, count, offset)
 
 weak_alias (__libc_pread64, __pread64)
 weak_alias (__libc_pread64, pread64)
-
-# define __libc_pread64(fd, buf, count, offset) \
-     static internal_function __emulate_pread64 (fd, buf, count, offset)
-#endif
-
-# if __ASSUME_PREAD_SYSCALL == 0
-# include <sysdeps/posix/pread64.c>
-#endif
index fb097698fb3a28179140c5a26f476cfd0789ce29..bf8ca864a2f3be29b455080eaef982cd83d31e45 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000, 2001, 2002, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1998.
 
@@ -127,12 +127,6 @@ __ptsname_internal (int fd, char *buf, size_t buflen, struct stat64 *stp)
        }
 
       ptyno = minor (stp->st_rdev);
-#if __LINUX_KERNEL_VERSION < 131443
-      /* This is for the old BSD pseudo terminals.  As of Linux
-        2.1.115 these are no longer supported.  */
-      if (major (stp->st_rdev) == 4)
-       ptyno -= 128;
-#endif
 
       if (ptyno / 16 >= strlen (__libc_ptyname1))
        {
index 6d1ab8624236f7264c00477ca8fde5f049271ae3..c4940fcdd09b07268ca8910818131e4ecaa56b8b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2000,2002,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 # define __NR_pwrite __NR_pwrite64
 #endif
 
-#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
-
-# if __ASSUME_PWRITE_SYSCALL == 0
-static ssize_t __emulate_pwrite (int fd, const void *buf, size_t count,
-                                off_t offset) internal_function;
-# endif
-
 
 static ssize_t
 #ifdef NO_CANCELLATION
@@ -50,15 +43,9 @@ do_pwrite (int fd, const void *buf, size_t count, off_t offset)
 {
   ssize_t result;
 
-  /* First try the syscall.  */
   assert (sizeof (offset) == 4);
   result = INLINE_SYSCALL (pwrite, 5, fd, CHECK_N (buf, count), count,
                           __LONG_LONG_PAIR (offset >> 31, offset));
-# if __ASSUME_PWRITE_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use the emulation.  */
-    result = __emulate_pwrite (fd, buf, count, offset);
-# endif
 
   return result;
 }
@@ -85,11 +72,3 @@ __libc_pwrite (fd, buf, count, offset)
 
 strong_alias (__libc_pwrite, __pwrite)
 weak_alias (__libc_pwrite, pwrite)
-
-# define __libc_pwrite(fd, buf, count, offset) \
-     static internal_function __emulate_pwrite (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PWRITE_SYSCALL == 0
-# include <sysdeps/posix/pwrite.c>
-#endif
index 5deab9d649a31e9cc3b48dea758f59c1dc59c11a..ad945a2903a44714a98b41e3f8879d263c3c1b7b 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002,2003,2006
-       Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 # define __NR_pwrite __NR_pwrite64
 #endif
 
-#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
-
-# if __ASSUME_PWRITE_SYSCALL == 0
-static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count,
-                                  off64_t offset) internal_function;
-# endif
-
 
 static ssize_t
 do_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
 {
   ssize_t result;
 
-  /* First try the syscall.  */
   result = INLINE_SYSCALL (pwrite, 5, fd, CHECK_N (buf, count), count,
                           __LONG_LONG_PAIR ((off_t) (offset >> 32),
                                             (off_t) (offset & 0xffffffff)));
-# if __ASSUME_PWRITE_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use the emulation.  */
-    result = __emulate_pwrite64 (fd, buf, count, offset);
-# endif
 
   return result;
 }
@@ -83,11 +69,3 @@ __libc_pwrite64 (fd, buf, count, offset)
 weak_alias (__libc_pwrite64, __pwrite64)
 libc_hidden_weak (__pwrite64)
 weak_alias (__libc_pwrite64, pwrite64)
-
-# define __libc_pwrite64(fd, buf, count, offset) \
-     static internal_function __emulate_pwrite64 (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PWRITE_SYSCALL == 0
-# include <sysdeps/posix/pwrite64.c>
-#endif
index 30cbec63a085231c92b2c267bb3ceb236c468779..3e7702f10d26c347e83e40a5ba2c118643cd266e 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004, 2006
-   Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 # define __NR_pread __NR_pread64
 #endif
 
-#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-
-# if __ASSUME_PREAD_SYSCALL == 0
-static ssize_t __emulate_pread (int fd, void *buf, size_t count,
-                               off_t offset) internal_function;
-# endif
 
 ssize_t
 __libc_pread (fd, buf, count, offset)
@@ -53,27 +46,15 @@ __libc_pread (fd, buf, count, offset)
 
   if (SINGLE_THREAD_P)
     {
-      /* First try the syscall.  */
       result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
                               __LONG_LONG_PAIR (offset >> 31, offset));
-# if __ASSUME_PREAD_SYSCALL == 0
-      if (result == -1 && errno == ENOSYS)
-        /* No system call available.  Use the emulation.  */
-        result = __emulate_pread (fd, buf, count, offset);
-# endif
       return result;
     }
 
   int oldtype = LIBC_CANCEL_ASYNC ();
 
-  /* First try the syscall.  */
   result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
                           __LONG_LONG_PAIR (offset >> 31, offset));
-# if __ASSUME_PREAD_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use the emulation.  */
-    result = __emulate_pread (fd, buf, count, offset);
-# endif
 
   LIBC_CANCEL_RESET (oldtype);
 
@@ -82,11 +63,3 @@ __libc_pread (fd, buf, count, offset)
 
 strong_alias (__libc_pread, __pread)
 weak_alias (__libc_pread, pread)
-
-# define __libc_pread(fd, buf, count, offset) \
-     static internal_function __emulate_pread (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PREAD_SYSCALL == 0
-# include <sysdeps/posix/pread.c>
-#endif
index 6c0bf5d2f699985bdbd6f9ca7852e7030024277b..523ed7f82f5e5de7145bbce00e78a392c38a678b 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004, 2006
-   Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 # define __NR_pread __NR_pread64
 #endif
 
-#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
-
-# if __ASSUME_PREAD_SYSCALL == 0
-static ssize_t __emulate_pread64 (int fd, void *buf, size_t count,
-                                 off64_t offset) internal_function;
-# endif
 
 ssize_t
 __libc_pread64 (fd, buf, count, offset)
@@ -52,29 +45,17 @@ __libc_pread64 (fd, buf, count, offset)
 
   if (SINGLE_THREAD_P)
     {
-     /* First try the syscall.  */
      result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
                              __LONG_LONG_PAIR ((off_t) (offset >> 32),
                              (off_t) (offset & 0xffffffff)));
-# if __ASSUME_PREAD_SYSCALL == 0
-     if (result == -1 && errno == ENOSYS)
-     /* No system call available.  Use the emulation.  */
-     result = __emulate_pread64 (fd, buf, count, offset);
-# endif
      return result;
     }
 
   int oldtype = LIBC_CANCEL_ASYNC ();
 
-  /* First try the syscall.  */
   result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
                           __LONG_LONG_PAIR ((off_t) (offset >> 32),
                                             (off_t) (offset & 0xffffffff)));
-# if __ASSUME_PREAD_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use the emulation.  */
-    result = __emulate_pread64 (fd, buf, count, offset);
-# endif
 
   LIBC_CANCEL_RESET (oldtype);
 
@@ -83,11 +64,3 @@ __libc_pread64 (fd, buf, count, offset)
 
 weak_alias (__libc_pread64, __pread64)
 weak_alias (__libc_pread64, pread64)
-
-# define __libc_pread64(fd, buf, count, offset) \
-     static internal_function __emulate_pread64 (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PREAD_SYSCALL == 0
-# include <sysdeps/posix/pread64.c>
-#endif
index 75e0e9850ba942a894136cc4779ee842cee19c05..e8052757aae56afe41bbb124f5e6d05c4b92d80e 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004, 2006
-   Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 # define __NR_pwrite __NR_pwrite64
 #endif
 
-#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
-
-# if __ASSUME_PWRITE_SYSCALL == 0
-static ssize_t __emulate_pwrite (int fd, const void *buf, size_t count,
-                                off_t offset) internal_function;
-# endif
 
 ssize_t
 __libc_pwrite (fd, buf, count, offset)
@@ -53,27 +46,15 @@ __libc_pwrite (fd, buf, count, offset)
 
   if (SINGLE_THREAD_P)
     {
-      /* First try the syscall.  */
       result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
                               __LONG_LONG_PAIR (offset >> 31, offset));
-# if __ASSUME_PWRITE_SYSCALL == 0
-      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.  */
   result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
                           __LONG_LONG_PAIR (offset >> 31, offset));
-# if __ASSUME_PWRITE_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use the emulation.  */
-    result = __emulate_pwrite (fd, buf, count, offset);
-# endif
 
   LIBC_CANCEL_RESET (oldtype);
 
@@ -82,11 +63,3 @@ __libc_pwrite (fd, buf, count, offset)
 
 strong_alias (__libc_pwrite, __pwrite)
 weak_alias (__libc_pwrite, pwrite)
-
-# define __libc_pwrite(fd, buf, count, offset) \
-     static internal_function __emulate_pwrite (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PWRITE_SYSCALL == 0
-# include <sysdeps/posix/pwrite.c>
-#endif
index 0fd21af12f1205d50fd33a0f641abe1657fc762f..8f80fea49501ed2b0c8667679d933875e60cfbbd 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004, 2006
-   Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ralf Baechle <ralf@gnu.org>, 1998.
 
 # define __NR_pwrite __NR_pwrite64
 #endif
 
-#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
-
-# if __ASSUME_PWRITE_SYSCALL == 0
-static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count,
-                                  off64_t offset) internal_function;
-# endif
 
 ssize_t
 __libc_pwrite64 (fd, buf, count, offset)
@@ -52,30 +45,18 @@ __libc_pwrite64 (fd, buf, count, offset)
 
   if (SINGLE_THREAD_P)
     {
-     /* First try the syscall.  */
      result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
                              __LONG_LONG_PAIR ((off_t) (offset >> 32),
                             (off_t) (offset & 0xffffffff)));
-# if __ASSUME_PWRITE_SYSCALL == 0
-     if (result == -1 && errno == ENOSYS)
-     /* No system call available.  Use the emulation.  */
-     result = __emulate_pwrite64 (fd, buf, count, offset);
-# endif
 
      return result;
     }
 
   int oldtype = LIBC_CANCEL_ASYNC ();
 
-  /* First try the syscall.  */
   result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0,
                           __LONG_LONG_PAIR ((off_t) (offset >> 32),
                                             (off_t) (offset & 0xffffffff)));
-# if __ASSUME_PWRITE_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use the emulation.  */
-    result = __emulate_pwrite64 (fd, buf, count, offset);
-# endif
 
   LIBC_CANCEL_RESET (oldtype);
 
@@ -85,11 +66,3 @@ __libc_pwrite64 (fd, buf, count, offset)
 weak_alias (__libc_pwrite64, __pwrite64)
 libc_hidden_weak (__pwrite64)
 weak_alias (__libc_pwrite64, pwrite64)
-
-# define __libc_pwrite64(fd, buf, count, offset) \
-     static internal_function __emulate_pwrite64 (fd, buf, count, offset)
-#endif
-
-#if __ASSUME_PWRITE_SYSCALL == 0
-# include <sysdeps/posix/pwrite64.c>
-#endif
index 37f7a2c149538ef765ca4134decca5af0ca968b7..01fb16e5573491c547b05bad7848eade1cfe0417 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2000,2002,2003,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997-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
    translate it here.  */
 #include <kernel_sigaction.h>
 
-#if __ASSUME_REALTIME_SIGNALS == 0
-/* The variable is shared between all wrappers around signal handling
-   functions which have RT equivalents.  This is the definition.  */
-int __libc_missing_rt_sigs;
-#endif
-
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
    If OACT is not NULL, put the old action for SIG in *OACT.  */
@@ -44,87 +38,36 @@ __libc_sigaction (sig, act, oact)
      const struct sigaction *act;
      struct sigaction *oact;
 {
-#if __ASSUME_REALTIME_SIGNALS == 0
-  struct old_kernel_sigaction k_sigact, k_osigact;
-#endif
   int result;
 
-#if defined __NR_rt_sigaction || __ASSUME_REALTIME_SIGNALS > 0
-  /* First try the RT signals.  */
-# if __ASSUME_REALTIME_SIGNALS == 0
-  if (!__libc_missing_rt_sigs)
-# endif
-    {
-      struct kernel_sigaction kact, koact;
-      /* Save the current error value for later.  We need not do this
-        if we are guaranteed to have realtime signals.  */
-# if __ASSUME_REALTIME_SIGNALS == 0
-      int saved_errno = errno;
-# endif
-
-      if (act)
-       {
-         kact.k_sa_handler = act->sa_handler;
-         memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
-         kact.sa_flags = act->sa_flags;
-# ifdef HAVE_SA_RESTORER
-         kact.sa_restorer = act->sa_restorer;
-# endif
-       }
-
-      /* XXX The size argument hopefully will have to be changed to the
-        real size of the user-level sigset_t.  */
-      result = INLINE_SYSCALL (rt_sigaction, 4, sig,
-                              act ? __ptrvalue (&kact) : NULL,
-                              oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
+  struct kernel_sigaction kact, koact;
 
-# if __ASSUME_REALTIME_SIGNALS == 0
-      if (result >= 0 || errno != ENOSYS)
-# endif
-       {
-         if (oact && result >= 0)
-           {
-             oact->sa_handler = koact.k_sa_handler;
-             memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
-             oact->sa_flags = koact.sa_flags;
-# ifdef HAVE_SA_RESTORER
-             oact->sa_restorer = koact.sa_restorer;
-# endif
-           }
-         return result;
-       }
-
-# if __ASSUME_REALTIME_SIGNALS == 0
-      __set_errno (saved_errno);
-      __libc_missing_rt_sigs = 1;
-# endif
-    }
-#endif
-
-#if __ASSUME_REALTIME_SIGNALS == 0
   if (act)
     {
-      k_sigact.k_sa_handler = act->sa_handler;
-      k_sigact.sa_mask = act->sa_mask.__val[0];
-      k_sigact.sa_flags = act->sa_flags;
-# ifdef HAVE_SA_RESTORER
-      k_sigact.sa_restorer = act->sa_restorer;
-# endif
+      kact.k_sa_handler = act->sa_handler;
+      memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
+      kact.sa_flags = act->sa_flags;
+#ifdef HAVE_SA_RESTORER
+      kact.sa_restorer = act->sa_restorer;
+#endif
     }
-  result = INLINE_SYSCALL (sigaction, 3, sig,
-                          act ? __ptrvalue (&k_sigact) : NULL,
-                          oact ? __ptrvalue (&k_osigact) : NULL);
+
+  /* XXX The size argument hopefully will have to be changed to the
+     real size of the user-level sigset_t.  */
+  result = INLINE_SYSCALL (rt_sigaction, 4, sig,
+                          act ? __ptrvalue (&kact) : NULL,
+                          oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
+
   if (oact && result >= 0)
     {
-      oact->sa_handler = k_osigact.k_sa_handler;
-      oact->sa_mask.__val[0] = k_osigact.sa_mask;
-      oact->sa_flags = k_osigact.sa_flags;
-# ifdef HAVE_SA_RESTORER
-      oact->sa_restorer = k_osigact.sa_restorer;
-# endif
+      oact->sa_handler = koact.k_sa_handler;
+      memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
+      oact->sa_flags = koact.sa_flags;
+#ifdef HAVE_SA_RESTORER
+      oact->sa_restorer = koact.sa_restorer;
+#endif
     }
   return result;
-#endif
 }
 libc_hidden_def (__libc_sigaction)
 
index 91d08db17d76c2bc3f9dee12f7abbeab3b794a89..7174b4ae3a791f863ff79bc63e9914c4c2be13e0 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2003,2006
-       Free Software Foundation, Inc.
+/* Copyright (C) 1997-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
 #include <kernel-features.h>
 
 
-/* The variable is shared between all wrappers around signal handling
-   functions which have RT equivalents.  The definition is in sigaction.c.  */
-extern int __libc_missing_rt_sigs;
-
-
 /* Change the set of blocked signals to SET,
    wait until a signal arrives, and restore the set of blocked signals.  */
 int
 sigpending (set)
      sigset_t *set;
 {
-#if __ASSUME_REALTIME_SIGNALS > 0
   return INLINE_SYSCALL (rt_sigpending, 2, CHECK_SIGSET (set), _NSIG / 8);
-#else
-# ifdef __NR_rt_sigpending
-  /* First try the RT signals.  */
-  if (!__libc_missing_rt_sigs)
-    {
-      /* XXX The size argument hopefully will have to be changed to the
-        real size of the user-level sigset_t.  */
-      int saved_errno = errno;
-      int result = INLINE_SYSCALL (rt_sigpending, 2, CHECK_SIGSET (set), _NSIG / 8);
-
-      if (result >= 0 || errno != ENOSYS)
-       return result;
-
-      __set_errno (saved_errno);
-      __libc_missing_rt_sigs = 1;
-    }
-# endif
-
-  return INLINE_SYSCALL (sigpending, 1, CHECK_SIGSET (set));
-#endif
 }
index 2e91660f9b0bca0b849adecf9e2f7ce85c723f2c..a5ac4dd501964dff7cc40044aedff3ac184d515a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2001,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997-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
 #include <kernel-features.h>
 
 
-/* The variable is shared between all wrappers around signal handling
-   functions which have RT equivalents.  The definition is in sigaction.c.  */
-extern int __libc_missing_rt_sigs;
-
-
 /* Get and/or change the set of blocked signals.  */
 int
 __sigprocmask (how, set, oset)
@@ -60,31 +55,7 @@ __sigprocmask (how, set, oset)
     }
 #endif
 
-#if __ASSUME_REALTIME_SIGNALS > 0
   return INLINE_SYSCALL (rt_sigprocmask, 4, how, CHECK_SIGSET_NULL_OK (set),
                         CHECK_SIGSET_NULL_OK (oset), _NSIG / 8);
-#else
-# ifdef __NR_rt_sigprocmask
-  /* First try the RT signals.  */
-  if (!__libc_missing_rt_sigs)
-    {
-      /* XXX The size argument hopefully will have to be changed to the
-        real size of the user-level sigset_t.  */
-      int saved_errno = errno;
-      int result = INLINE_SYSCALL (rt_sigprocmask, 4, how,
-                                  CHECK_SIGSET_NULL_OK (set),
-                                  CHECK_SIGSET_NULL_OK (oset), _NSIG / 8);
-
-      if (result >= 0 || errno != ENOSYS)
-       return result;
-
-      __set_errno (saved_errno);
-      __libc_missing_rt_sigs = 1;
-    }
-# endif
-
-  return INLINE_SYSCALL (sigprocmask, 3, how, CHECK_SIGSET_NULL_OK (set),
-                        CHECK_SIGSET_NULL_OK (oset));
-#endif
 }
 weak_alias (__sigprocmask, sigprocmask)
index 30b8b585b1e02a01ac350100fdb94e197fbb2e1e..e1ee87b29fa258ee6a87461438e602a7f3e5fe63 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1996,1997,1998,1999,2000,2002,2003,2006
-       Free Software Foundation, Inc.
+/* Copyright (C) 1996-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
 #include <kernel-features.h>
 
 
-#if !__ASSUME_REALTIME_SIGNALS
-/* The variable is shared between all wrappers around signal handling
-   functions which have RT equivalents.  The definition is in sigaction.c.  */
-extern int __libc_missing_rt_sigs;
-
-
-static int
-do_sigsuspend (const sigset_t *set)
-{
-# ifdef __NR_rt_sigsuspend
-  /* First try the RT signals.  */
-  if (!__libc_missing_rt_sigs)
-    {
-      /* XXX The size argument hopefully will have to be changed to the
-        real size of the user-level sigset_t.  */
-      int saved_errno = errno;
-      int result = INLINE_SYSCALL (rt_sigsuspend, 2,
-                                  CHECK_SIGSET (set), _NSIG / 8);
-      if (result >= 0 || errno != ENOSYS)
-       return result;
-
-      __set_errno (saved_errno);
-      __libc_missing_rt_sigs = 1;
-    }
-# endif
-
-  return INLINE_SYSCALL (sigsuspend, 3, 0, 0, set->__val[0]);
-}
-#else
 static inline int __attribute__ ((always_inline))
 do_sigsuspend (const sigset_t *set)
 {
   return INLINE_SYSCALL (rt_sigsuspend, 2, CHECK_SIGSET (set), _NSIG / 8);
 }
-#endif
 
 /* Change the set of blocked signals to SET,
    wait until a signal arrives, and restore the set of blocked signals.  */
index c3201b8a9e77728d1f591b272741eba06472e577..7bdf5e0bdd108e22d93285c7f0389bb1f99f01d2 100644 (file)
 static void __rt_sigreturn_stub (void);
 static void __sigreturn_stub (void);
 
-/* The variable is shared between all wrappers around signal handling
-   functions which have RT equivalents.  */
-int __libc_missing_rt_sigs;
-
 int
 __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 {
   struct old_kernel_sigaction k_sigact, k_osigact;
   int ret;
 
-#ifdef __NR_rt_sigaction
-  /* First try the RT signals.  */
-  if (!__libc_missing_rt_sigs)
-    {
-      struct kernel_sigaction kact, koact;
-      unsigned long stub = 0;
-      int saved_errno = errno;
-
-      if (act)
-       {
-         kact.k_sa_handler = act->sa_handler;
-         memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
-         if (((kact.sa_flags = act->sa_flags) & SA_SIGINFO) != 0)
-           stub = (unsigned long) &__rt_sigreturn_stub;
-         else
-           stub = (unsigned long) &__sigreturn_stub;
-         stub -= 8;
-         kact.sa_restorer = NULL;
-       }
-
-      /* XXX The size argument hopefully will have to be changed to the
-        real size of the user-level sigset_t.  */
-      ret = INLINE_SYSCALL (rt_sigaction, 5, sig, act ? &kact : 0,
-                           oact ? &koact : 0, stub, _NSIG / 8);
-
-      if (ret >= 0 || errno != ENOSYS)
-       {
-         if (oact && ret >= 0)
-           {
-             oact->sa_handler = koact.k_sa_handler;
-             memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
-             oact->sa_flags = koact.sa_flags;
-             oact->sa_restorer = koact.sa_restorer;
-           }
-         return ret;
-       }
-
-      __set_errno (saved_errno);
-      __libc_missing_rt_sigs = 1;
-    }
-#endif
-
-  /* Magic to tell the kernel we are using "new-style" signals, in that
-     the signal table is not kept in userspace.  Not the same as the
-     really-new-style rt signals.  */
-  sig = -sig;
+  struct kernel_sigaction kact, koact;
+  unsigned long stub = 0;
 
   if (act)
     {
-      k_sigact.k_sa_handler = act->sa_handler;
-      k_sigact.sa_mask = act->sa_mask.__val[0];
-      k_sigact.sa_flags = act->sa_flags;
-      k_sigact.sa_restorer = NULL;
+      kact.k_sa_handler = act->sa_handler;
+      memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
+      if (((kact.sa_flags = act->sa_flags) & SA_SIGINFO) != 0)
+       stub = (unsigned long) &__rt_sigreturn_stub;
+      else
+       stub = (unsigned long) &__sigreturn_stub;
+      stub -= 8;
+      kact.sa_restorer = NULL;
     }
 
-  {
-    register int r_syscallnr __asm__("%g1") = __NR_sigaction;
-    register int r_sig __asm__("%o0") = sig;
-    register struct old_kernel_sigaction *r_act __asm__("%o1");
-    register struct old_kernel_sigaction *r_oact __asm__("%o2");
-
-    r_act = act ? &k_sigact : NULL;
-    r_oact = oact ? &k_osigact : NULL;
+  /* XXX The size argument hopefully will have to be changed to the
+     real size of the user-level sigset_t.  */
+  ret = INLINE_SYSCALL (rt_sigaction, 5, sig, act ? &kact : 0,
+                       oact ? &koact : 0, stub, _NSIG / 8);
 
-    __asm__ __volatile__("t 0x10\n\t"
-                        "bcc 1f\n\t"
-                        " nop\n\t"
-                        "sub %%g0,%%o0,%%o0\n"
-                        "1:"
-                        : "=r"(r_sig)
-                        : "r"(r_syscallnr), "r"(r_act), "r"(r_oact),
-                          "0"(r_sig));
-
-    ret = r_sig;
-  }
-
-  if (ret >= 0)
+  if (oact && ret >= 0)
     {
-      if (oact)
-       {
-         oact->sa_handler = k_osigact.k_sa_handler;
-         oact->sa_mask.__val[0] = k_osigact.sa_mask;
-         oact->sa_flags = k_osigact.sa_flags;
-         oact->sa_restorer = NULL;
-       }
-      return ret;
+      oact->sa_handler = koact.k_sa_handler;
+      memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t));
+      oact->sa_flags = koact.sa_flags;
+      oact->sa_restorer = koact.sa_restorer;
     }
-
-  __set_errno (-ret);
-  return -1;
+  return ret;
 }
 libc_hidden_def (__libc_sigaction)
 
index 145e22b52031461904552ef664b1017a8164cd4a..d01a91ad66a2731f111faca613e486085068be20 100644 (file)
@@ -1,10 +1,6 @@
 #include <kernel-features.h>
 
-#if __ASSUME_MSG_NOSIGNAL
-# define NO_SIGPIPE
-# define send_flags MSG_NOSIGNAL
-#else
-# define send_flags 0
-#endif
+#define NO_SIGPIPE
+#define send_flags MSG_NOSIGNAL
 
 #include <misc/syslog.c>
index cab587b094c88077826f8c9e8f926cb5f186afb0..f7650ccf3ef60796e510578ddcd423fa0bc20f2b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test whether RT signals are really available.
-   Copyright (C) 1997, 1999, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
 static int
 kernel_has_rtsig (void)
 {
-#if __ASSUME_REALTIME_SIGNALS
   return 1;
-#else
-  struct utsname name;
-
-  return uname (&name) == 0 && __strverscmp (name.release, "2.1.70") >= 0;
-#endif
 }
index 0cfb4740b8af17e04ef84216a47c675720b93a94..3dacd40c2395a4102450e12e39135074b75a4ea0 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991-1993,1996-2002,2006,2009,2010
-   Free Software Foundation, Inc.
+/* Copyright (C) 1991-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
@@ -155,12 +154,7 @@ ttyname (int fd)
       return NULL;
     }
 
-  if (__builtin_expect (len != -1
-#ifndef __ASSUME_PROC_SELF_FD_SYMLINK
-                       /* This is for Linux 2.0.  */
-                       && ttyname_buf[0] != '['
-#endif
-                       , 1))
+  if (__builtin_expect (len != -1, 1))
     {
       if ((size_t) len >= buflen)
        return NULL;
index f097311a1536f3ea01bf288becc4276350bf9605..2dd67813482dfbaec0d450b3d31bab1de2db392b 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991-1993,1995-2001,2003,2006,2010
-   Free Software Foundation, Inc.
+/* Copyright (C) 1991-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
@@ -141,12 +140,7 @@ __ttyname_r (int fd, char *buf, size_t buflen)
       return ERANGE;
     }
 
-  if (__builtin_expect (ret != -1
-#ifndef __ASSUME_PROC_SELF_FD_SYMLINK
-                       /* This is for Linux 2.0.  */
-                       && buf[0] != '['
-#endif
-                       , 1))
+  if (__builtin_expect (ret != -1, 1))
     {
 #define UNREACHABLE_LEN strlen ("(unreachable)")
       if (ret > UNREACHABLE_LEN
This page took 0.198883 seconds and 5 git commands to generate.