]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Remove pre-2.4 Linux kernel support.
authorJoseph Myers <joseph@codesourcery.com>
Fri, 25 May 2012 19:19:30 +0000 (19:19 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 25 May 2012 19:19:30 +0000 (19:19 +0000)
39 files changed:
ChangeLog
NEWS
sysdeps/unix/sysv/linux/configure
sysdeps/unix/sysv/linux/configure.in
sysdeps/unix/sysv/linux/i386/chown.c
sysdeps/unix/sysv/linux/i386/fchown.c
sysdeps/unix/sysv/linux/i386/fchownat.c
sysdeps/unix/sysv/linux/i386/getegid.c
sysdeps/unix/sysv/linux/i386/geteuid.c
sysdeps/unix/sysv/linux/i386/getgid.c
sysdeps/unix/sysv/linux/i386/getgroups.c
sysdeps/unix/sysv/linux/i386/getresgid.c
sysdeps/unix/sysv/linux/i386/getresuid.c
sysdeps/unix/sysv/linux/i386/getuid.c
sysdeps/unix/sysv/linux/i386/lchown.c
sysdeps/unix/sysv/linux/i386/msgctl.c
sysdeps/unix/sysv/linux/i386/semctl.c
sysdeps/unix/sysv/linux/i386/setegid.c
sysdeps/unix/sysv/linux/i386/seteuid.c
sysdeps/unix/sysv/linux/i386/setfsgid.c
sysdeps/unix/sysv/linux/i386/setfsuid.c
sysdeps/unix/sysv/linux/i386/setgid.c
sysdeps/unix/sysv/linux/i386/setgroups.c
sysdeps/unix/sysv/linux/i386/setregid.c
sysdeps/unix/sysv/linux/i386/setresgid.c
sysdeps/unix/sysv/linux/i386/setresuid.c
sysdeps/unix/sysv/linux/i386/setreuid.c
sysdeps/unix/sysv/linux/i386/setuid.c
sysdeps/unix/sysv/linux/i386/shmctl.c
sysdeps/unix/sysv/linux/kernel-features.h
sysdeps/unix/sysv/linux/local-setxid.h
sysdeps/unix/sysv/linux/opendir.c
sysdeps/unix/sysv/linux/opensock.c
sysdeps/unix/sysv/linux/s390/s390-32/chown.c
sysdeps/unix/sysv/linux/s390/s390-32/lchown.c
sysdeps/unix/sysv/linux/setegid.c
sysdeps/unix/sysv/linux/seteuid.c
sysdeps/unix/sysv/linux/sh/chown.c
sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c

index 2f6a533a7a256a4b8613e8a6a60c9fad5f2e322d..8ddc57e8806a607ab40c21dfb3da3cda39939851 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,163 @@
+2012-05-25  Joseph Myers  <joseph@codesourcery.com>
+
+       [BZ #13717]
+       * sysdeps/unix/sysv/linux/configure.in (arch_minimum_kernel): Set
+       to 2.4.0 where earlier.
+       * sysdeps/unix/sysv/linux/configure: Regenerated.
+       * sysdeps/unix/sysv/linux/i386/chown.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/fchown.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/fchownat.c (fchownat)
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       (fchownat) [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/getegid.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/geteuid.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/getgid.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/getgroups.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/getresgid.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/getresuid.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/getuid.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/lchown.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/msgctl.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/semctl.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/setegid.c: Do not include
+       <kernel-features.h>.
+       [__NR_setresgid] (__setresgid): Do not declare.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/seteuid.c: Do not include
+       <kernel-features.h>.
+       [__NR_setresuid] (__setresuid): Do not declare.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/setfsgid.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/setfsuid.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/setgid.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/setgroups.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/setregid.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/setresgid.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/setresuid.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/setreuid.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/setuid.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/i386/shmctl.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/kernel-features.h
+       (__ASSUME_SETRESUID_SYSCALL): Remove.
+       (__ASSUME_SETRESGID_SYSCALL): Likewise.
+       (__ASSUME_32BITUIDS): Likewise.
+       (__ASSUME_LDT_WORKS): Likewise.
+       (__ASSUME_O_DIRECTORY): Likewise.
+       (__ASSUME_NEW_GETRLIMIT_SYSCALL): Define conditional on
+       architecture but not kernel version.
+       (__ASSUME_TRUNCATE64_SYSCALL): Likewise.
+       (__ASSUME_MMAP2_SYSCALL): Likewise.
+       (__ASSUME_STAT64_SYSCALL): Likewise.
+       (__ASSUME_IPC64): Likewise.
+       * sysdeps/unix/sysv/linux/local-setxid.h: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/opendir.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_O_DIRECTORY]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/opensock.c [__LINUX_KERNEL_VERSION <
+       132096]: Remove conditional code.
+       [__LINUX_KERNEL_VERSION >= 132096]: Make code unconditional.
+       * sysdeps/unix/sysv/linux/s390/s390-32/chown.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/s390/s390-32/lchown.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/setegid.c: Do not include
+       <kernel-features.h>.
+       [__NR_setresgid || __ASSUME_SETRESGID_SYSCALL]: Make code
+       unconditional.
+       (__setresgid): Do not declare.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/seteuid.c: Do not include
+       <kernel-features.h>.
+       [__NR_setresuid || __ASSUME_SETRESUID_SYSCALL]: Make code
+       unconditional.
+       (__setresuid): Do not declare.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/sh/chown.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+       * sysdeps/unix/sysv/linux/sparc/sparc32/semctl.c: Do not include
+       <kernel-features.h>.
+       [__ASSUME_32BITUIDS]: Make code unconditional.
+       [!__ASSUME_32BITUIDS]: Remove conditional code.
+
 2012-05-25  Richard Henderson  <rth@twiddle.net>
 
        * sysdeps/powerpc/powerpc32/dl-irel.h (elf_ifunc_invoke): Pass
diff --git a/NEWS b/NEWS
index 1e8c77778459ff18027c8f0f6d9e5ecea30e363c..761e36ae60aeda78affe3a83f7c9cdbbf152d2f4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -67,7 +67,7 @@ Version 2.16
   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.
+* Compatibility code for Linux kernel versions before 2.4 has been removed.
   Note that glibc is not expected to work with any Linux kernel version
   before 2.6.
 
index fe61c111beb176f393991e281f52edd36d40d197..ef2f71578265e16535a3a79f29dab98c78845e1d 100644 (file)
@@ -284,25 +284,25 @@ test -n "$arch_minimum_kernel" ||
 case "$machine" in
   i386*)
     libc_cv_gcc_unwind_find_fde=yes
-    arch_minimum_kernel=2.2.0
+    arch_minimum_kernel=2.4.0
     ;;
   powerpc/powerpc32)
     libc_cv_gcc_unwind_find_fde=yes
-    arch_minimum_kernel=2.2.0
+    arch_minimum_kernel=2.4.0
     ;;
   powerpc/powerpc64)
     arch_minimum_kernel=2.4.21
     ;;
   s390/s390-32)
     libc_cv_gcc_unwind_find_fde=yes
-    arch_minimum_kernel=2.2.10
+    arch_minimum_kernel=2.4.0
     ;;
   s390/s390-64)
     libc_cv_gcc_unwind_find_fde=yes
     arch_minimum_kernel=2.4.0
     ;;
   sh*)
-    arch_minimum_kernel=2.3.99
+    arch_minimum_kernel=2.4.0
     libc_cv_gcc_unwind_find_fde=yes
     ;;
   sparc/sparc64*)
@@ -311,13 +311,10 @@ case "$machine" in
     ;;
   sparc*)
     libc_cv_gcc_unwind_find_fde=yes
-    arch_minimum_kernel=2.2.0
-    ;;
-  x86_64*)
     arch_minimum_kernel=2.4.0
     ;;
   *)
-    arch_minimum_kernel=2.2.0
+    arch_minimum_kernel=2.4.0
     ;;
 esac
 if test -n "$minimum_kernel"; then
index 72fbe8422b556772e3643f39cd2ed07360369453..c3ec328b9e908b484635d1c4953f5e5227df1b96 100644 (file)
@@ -41,25 +41,25 @@ test -n "$arch_minimum_kernel" ||
 case "$machine" in
   i386*)
     libc_cv_gcc_unwind_find_fde=yes
-    arch_minimum_kernel=2.2.0
+    arch_minimum_kernel=2.4.0
     ;;
   powerpc/powerpc32)
     libc_cv_gcc_unwind_find_fde=yes
-    arch_minimum_kernel=2.2.0
+    arch_minimum_kernel=2.4.0
     ;;
   powerpc/powerpc64)
     arch_minimum_kernel=2.4.21
     ;;
   s390/s390-32)
     libc_cv_gcc_unwind_find_fde=yes
-    arch_minimum_kernel=2.2.10
+    arch_minimum_kernel=2.4.0
     ;;
   s390/s390-64)
     libc_cv_gcc_unwind_find_fde=yes
     arch_minimum_kernel=2.4.0
     ;;
   sh*)
-    arch_minimum_kernel=2.3.99
+    arch_minimum_kernel=2.4.0
     libc_cv_gcc_unwind_find_fde=yes
     ;;
   sparc/sparc64*)
@@ -68,13 +68,10 @@ case "$machine" in
     ;;
   sparc*)
     libc_cv_gcc_unwind_find_fde=yes
-    arch_minimum_kernel=2.2.0
-    ;;
-  x86_64*)
     arch_minimum_kernel=2.4.0
     ;;
   *)
-    arch_minimum_kernel=2.2.0
+    arch_minimum_kernel=2.4.0
     ;;
 esac
 if test -n "$minimum_kernel"; then
index c8e53e4e00c52de4c66ec1579c7a1ad2bb62de70..5ea3cfd8692f3bf5ba7287c5af1db679602f4fc3 100644 (file)
@@ -24,7 +24,6 @@
 #include <bp-checks.h>
 
 #include <linux/posix_types.h>
-#include <kernel-features.h>
 
 /*
   In Linux 2.1.x the chown functions have been changed.  A new function lchown
@@ -41,44 +40,12 @@ extern int __chown_is_lchown (const char *__file, uid_t __owner,
 extern int __real_chown (const char *__file, uid_t __owner, gid_t __group);
 
 
-#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 */
+/* Consider moving to syscalls.list.  */
 
 int
 __real_chown (const char *file, uid_t owner, gid_t group)
 {
-#if __ASSUME_32BITUIDS
   return INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
-#else
-  /* !__ASSUME_32BITUIDS */
-# 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;
-    }
-
-  return INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group);
-#endif
 }
 
 
index e520db9feac0d140534f315dab103c3db60136aa..4d76538b6c15354bbce01f75e1e71e470b379d67 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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 <sys/syscall.h>
 
 #include <linux/posix_types.h>
-#include <kernel-features.h>
 
-#ifdef __NR_fchown32
-# 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_fchown32 */
+/* Consider moving to syscalls.list.  */
 
 int
 __fchown (int fd, uid_t owner, gid_t group)
 {
-#if  __ASSUME_32BITUIDS > 0
   return INLINE_SYSCALL (fchown32, 3, fd, owner, group);
-#else
-# ifdef __NR_fchown32
-  if (__libc_missing_32bit_uids <= 0)
-    {
-      int result;
-      int saved_errno = errno;
-
-      result = INLINE_SYSCALL (fchown32, 3, fd, owner, group);
-      if (result == 0 || errno != ENOSYS)
-       return result;
-
-      __set_errno (saved_errno);
-      __libc_missing_32bit_uids = 1;
-    }
-# endif /* __NR_fchown32 */
-
-  if (((owner + 1) > (uid_t) ((__kernel_uid_t) -1U))
-      || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
-    {
-      __set_errno (EINVAL);
-      return -1;
-    }
-
-  return INLINE_SYSCALL (fchown, 3, fd, owner, group);
-#endif
 }
 
 weak_alias (__fchown, fchown)
index 6b748d16ba48c17798965b711ab8348152b0e0a5..18c8f0b317213b0fe3b1c8e4754e91f8931a47e0 100644 (file)
@@ -83,7 +83,6 @@ fchownat (int fd, const char *file, uid_t owner, gid_t group, int flag)
       file = buf;
     }
 
-# if __ASSUME_32BITUIDS > 0
   INTERNAL_SYSCALL_DECL (err);
 
   if (flag & AT_SYMLINK_NOFOLLOW)
@@ -98,15 +97,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 8461be9e423db141d2dfcd5d5fe99eb00faf2442..41c4d08c8ae795e2f985af4cb5b9efe1dce9295c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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 <sysdep.h>
 #include <sys/syscall.h>
-#include <kernel-features.h>
 
-#ifdef __NR_getegid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
-   uids.  */
-extern int __libc_missing_32bit_uids attribute_hidden;
-# endif
-#endif /* __NR_getegid32 */
+/* Consider moving to syscalls.list.  */
 
 gid_t
 __getegid (void)
 {
   INTERNAL_SYSCALL_DECL (err);
-#if __ASSUME_32BITUIDS > 0
-  /* No error checking.  */
   return INTERNAL_SYSCALL (getegid32, err, 0);
-#else
-# ifdef __NR_getegid32
-  if (__libc_missing_32bit_uids <= 0)
-    {
-      int result;
-
-      result = INTERNAL_SYSCALL (getegid32, err, 0);
-      if (! INTERNAL_SYSCALL_ERROR_P (result, err)
-         || INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
-       return result;
-
-      __libc_missing_32bit_uids = 1;
-    }
-# endif /* __NR_getegid32 */
-
-  /* No error checking.  */
-  return INTERNAL_SYSCALL (getegid, err, 0);
-#endif
 }
 
 weak_alias (__getegid, getegid)
index a0e4864deebeb61e3113fb483116d29f28b895b2..42e768617046d06267b538e327c27079df1d3544 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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 <sysdep.h>
 #include <sys/syscall.h>
-#include <kernel-features.h>
 
-#ifdef __NR_geteuid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
-   uids.  */
-extern int __libc_missing_32bit_uids attribute_hidden;
-# endif
-#endif /* __NR_geteuid32 */
+/* Consider moving to syscalls.list.  */
 
 uid_t
 __geteuid (void)
 {
   INTERNAL_SYSCALL_DECL (err);
-#if __ASSUME_32BITUIDS > 0
-  /* No error checking.  */
   return INTERNAL_SYSCALL (geteuid32, err, 0);
-#else
-# ifdef __NR_geteuid32
-  if (__libc_missing_32bit_uids <= 0)
-    {
-      int result;
-
-      result = INTERNAL_SYSCALL (geteuid32, err, 0);
-      if (! INTERNAL_SYSCALL_ERROR_P (result, err)
-         || INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
-       return result;
-
-      __libc_missing_32bit_uids = 1;
-    }
-# endif /* __NR_geteuid32 */
-
-  /* No error checking.  */
-  return INTERNAL_SYSCALL (geteuid, err, 0);
-#endif
 }
 
 weak_alias (__geteuid, geteuid)
index 30c4bc840bb5938c661fb44290fb98e97bd38d92..e611fb494ee4f398b8ef1db6b8b0afbe2fb967fb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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 <sysdep.h>
 #include <sys/syscall.h>
 
-#include <kernel-features.h>
-
-#ifdef __NR_getgid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
-   uids.  */
-extern int __libc_missing_32bit_uids attribute_hidden;
-# endif
-#endif /* __NR_getgid32 */
+/* Consider moving to syscalls.list.  */
 
 gid_t
 __getgid (void)
 {
   INTERNAL_SYSCALL_DECL (err);
-#if __ASSUME_32BITUIDS > 0
-  /* No error checking.  */
   return INTERNAL_SYSCALL (getgid32, err, 0);
-#else
-# ifdef __NR_getgid32
-  if (__libc_missing_32bit_uids <= 0)
-    {
-      int result;
-
-      result = INTERNAL_SYSCALL (getgid32, err, 0);
-      if (! INTERNAL_SYSCALL_ERROR_P (result, err)
-         || INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
-       return result;
-
-      __libc_missing_32bit_uids = 1;
-    }
-# endif /* __NR_getgid32 */
-
-  /* No error checking.  */
-  return INTERNAL_SYSCALL (getgid, err, 0);
-#endif
 }
 
 weak_alias (__getgid, getgid)
index 97e1b0abef1c8eb6acb52af92b998bb59b01fff6..e0871ec2d29258abd47cb88db5c4b9c57af76877 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2001, 2003 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 <bp-checks.h>
 
 #include <linux/posix_types.h>
-#include <kernel-features.h>
 
 
-#ifdef __NR_getgroups32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
-   uids.  */
-extern int __libc_missing_32bit_uids attribute_hidden;
-# endif
-#endif /* __NR_getgroups32 */
+/* Consider moving to syscalls.list.  */
 
 /* For Linux we must convert the array of groups from the format that the
    kernel returns.  */
 int
 __getgroups (int n, gid_t *groups)
 {
-#if __ASSUME_32BITUIDS > 0
   return INLINE_SYSCALL (getgroups32, 2, n, CHECK_N (groups, n));
-#else
-  if (__builtin_expect (n, 1) < 0)
-    {
-      __set_errno (EINVAL);
-      return -1;
-    }
-  else
-    {
-# ifdef __NR_getgroups32
-      if (__libc_missing_32bit_uids <= 0)
-       {
-         int result;
-         int saved_errno = errno;
-
-         result = INLINE_SYSCALL (getgroups32, 2, n, CHECK_N (groups, n));
-         if (result != -1 || errno != ENOSYS)
-           return result;
-
-         __set_errno (saved_errno);
-         __libc_missing_32bit_uids = 1;
-       }
-# endif /* __NR_getgroups32 */
-
-      int i, ngids;
-      __kernel_gid_t kernel_groups[n = MIN (n, __sysconf (_SC_NGROUPS_MAX))];
-
-      ngids = INLINE_SYSCALL (getgroups, 2, n, CHECK_N (kernel_groups, n));
-      if (n != 0 && ngids > 0)
-       for (i = 0; i < ngids; i++)
-         (__ptrvalue (groups))[i] = kernel_groups[i];
-      return ngids;
-    }
-#endif
 }
 
 weak_alias (__getgroups, getgroups)
index c01497e7e7139a6108f27a03229f3f45b64fca4e..d9ce513b1d80387d4040f6681c03d95f0b8e35cb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,2005,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
 #include <sys/syscall.h>
 #include <bp-checks.h>
 
-#include <kernel-features.h>
-
-#ifdef __NR_getresgid
-
-# ifdef __NR_getresgid32
-#  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_getresgid32 */
-
+/* Consider moving to syscalls.list.  */
 
 int
 __getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid)
 {
-# if __ASSUME_32BITUIDS > 0
   return INLINE_SYSCALL (getresgid32, 3, CHECK_1 (rgid),
                         CHECK_1 (egid), CHECK_1 (sgid));
-# else
-  __kernel_gid_t k_rgid, k_egid, k_sgid;
-  int result;
-#  ifdef __NR_getresgid32
-  if (__libc_missing_32bit_uids <= 0)
-    {
-      int r;
-      int saved_errno = errno;
-
-      r = INLINE_SYSCALL (getresgid32, 3, CHECK_1 (rgid),
-                         CHECK_1 (egid), CHECK_1 (sgid));
-      if (r == 0 || errno != ENOSYS)
-       return r;
-
-      __set_errno (saved_errno);
-      __libc_missing_32bit_uids = 1;
-    }
-#  endif /* __NR_getresgid32 */
-
-  result = INLINE_SYSCALL (getresgid, 3, __ptrvalue (&k_rgid),
-                          __ptrvalue (&k_egid), __ptrvalue (&k_sgid));
-
-  if (result == 0)
-    {
-      *rgid = (gid_t) k_rgid;
-      *egid = (gid_t) k_egid;
-      *sgid = (gid_t) k_sgid;
-    }
-
-  return result;
-# endif
 }
 libc_hidden_def (__getresgid)
 weak_alias (__getresgid, getresgid)
-
-#else
-# include <posix/getresgid.c>
-#endif
index cbad2d3da5d70b1cfce7a2157159bce8194c80c0..f9c3180fb1eb846e66ba3a3a0cb564cf27f549c0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,2005,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
 #include <sys/syscall.h>
 #include <bp-checks.h>
 
-#include <kernel-features.h>
-
-#ifdef __NR_getresuid
-
-# ifdef __NR_getresuid32
-#  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_getresuid32 */
+/* Consider moving to syscalls.list.  */
 
 int
 __getresuid (uid_t *ruid, uid_t *euid, uid_t *suid)
 {
-# if __ASSUME_32BITUIDS > 0
   return INLINE_SYSCALL (getresuid32, 3, CHECK_1 (ruid),
                         CHECK_1 (euid), CHECK_1 (suid));
-# else
-  __kernel_uid_t k_ruid, k_euid, k_suid;
-  int result;
-#  ifdef __NR_getresuid32
-  if (__libc_missing_32bit_uids <= 0)
-    {
-      int r;
-      int saved_errno = errno;
-
-      r = INLINE_SYSCALL (getresuid32, 3, CHECK_1 (ruid),
-                         CHECK_1 (euid), CHECK_1 (suid));
-      if (r == 0 || errno != ENOSYS)
-       return r;
-
-      __set_errno (saved_errno);
-      __libc_missing_32bit_uids = 1;
-    }
-#  endif /* __NR_getresuid32 */
-
-  result = INLINE_SYSCALL (getresuid, 3, __ptrvalue (&k_ruid),
-                          __ptrvalue (&k_euid), __ptrvalue (&k_suid));
-
-  if (result == 0)
-    {
-      *ruid = (uid_t) k_ruid;
-      *euid = (uid_t) k_euid;
-      *suid = (uid_t) k_suid;
-    }
-
-  return result;
-# endif
 }
 libc_hidden_def (__getresuid)
 weak_alias (__getresuid, getresuid)
-
-#else
-# include <posix/getresuid.c>
-#endif
index 6bbc74d4c50a762641d80027faebe371803b6940..67d63a416be0c79b5eb518129f32b0bd3476caa1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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 <sysdep.h>
 #include <sys/syscall.h>
 
-#include <kernel-features.h>
-
-#ifdef __NR_getuid32
-# if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
-   uids.  This is the definition.
-   -1 if libc does not know yet whether kernel has 32bit uids or not.
-   0 if it does have them.
-   1 if it does not have them.  */
-int __libc_missing_32bit_uids attribute_hidden = -1;
-# endif
-#endif /* __NR_getuid32 */
+/* Consider moving to syscalls.list.  */
 
 uid_t
 __getuid (void)
 {
   INTERNAL_SYSCALL_DECL (err);
-#if __ASSUME_32BITUIDS > 0
-  /* No error checking.  */
   return INTERNAL_SYSCALL (getuid32, err, 0);
-#else
-# ifdef __NR_getuid32
-  if (__libc_missing_32bit_uids <= 0)
-    {
-      int result;
-
-      result = INTERNAL_SYSCALL (getuid32, err, 0);
-      if (! INTERNAL_SYSCALL_ERROR_P (result, err)
-         || INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
-       return result;
-
-      __libc_missing_32bit_uids = 1;
-    }
-# endif /* __NR_getuid32 */
-
-  /* No error checking.  */
-  return INTERNAL_SYSCALL (getuid, err, 0);
-#endif
 }
 
 weak_alias (__getuid, getuid)
index 2184c286007081c3c9fcd22d4412d1545ba43f4a..6190d02a6f068c5bd7715562103592e6ce2e01f0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000,2003,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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 <bp-checks.h>
 
 #include <linux/posix_types.h>
-#include <kernel-features.h>
 
-#ifdef __NR_lchown
-# ifdef __NR_lchown32
-#  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_lchown32 */
+/* Consider moving to syscalls.list.  */
 
 int
 __lchown (const char *file, uid_t owner, gid_t group)
 {
-# if __ASSUME_32BITUIDS > 0
   return INLINE_SYSCALL (lchown32, 3, CHECK_STRING (file), owner, group);
-# else
-#  ifdef __NR_lchown32
-  if (__libc_missing_32bit_uids <= 0)
-    {
-      int result;
-      int saved_errno = errno;
-
-      result = INLINE_SYSCALL (lchown32, 3, CHECK_STRING (file), owner, group);
-      if (result == 0 || errno != ENOSYS)
-       return result;
-
-      __set_errno (saved_errno);
-      __libc_missing_32bit_uids = 1;
-    }
-#  endif /* __NR_lchown32 */
-
-  if (((owner + 1) > (uid_t) ((__kernel_uid_t) -1U))
-      || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
-    {
-      __set_errno (EINVAL);
-      return -1;
-    }
-
-  return INLINE_SYSCALL (lchown, 3, CHECK_STRING (file), owner, group);
-# endif
 }
 
 weak_alias (__lchown, lchown)
-
-#else
-# include <io/lchown.c>
-#endif
index fa5a82fa383cb55060bd4ad59de93a9e6c70a4db..2125ae192c12af99548c13b6725ceb99ef320287 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1997,1998,2000,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -25,7 +25,6 @@
 #include <sys/syscall.h>
 #include <bp-checks.h>
 
-#include <kernel-features.h>
 #include <shlib-compat.h>
 
 struct __old_msqid_ds
@@ -52,14 +51,6 @@ int __old_msgctl (int, int, struct __old_msqid_ds *);
 #endif
 int __new_msgctl (int, int, struct msqid_ds *);
 
-#ifdef __NR_getuid32
-# 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
-
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
 int
 attribute_compat_text_section
@@ -74,85 +65,8 @@ compat_symbol (libc, __old_msgctl, msgctl, GLIBC_2_0);
 int
 __new_msgctl (int msqid, int cmd, struct msqid_ds *buf)
 {
-#if __ASSUME_32BITUIDS > 0
   return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl,
                         msqid, cmd | __IPC_64, 0, CHECK_1 (buf));
-#else
-  switch (cmd) {
-    case MSG_STAT:
-    case IPC_STAT:
-    case IPC_SET:
-      break;
-    default:
-      return INLINE_SYSCALL (ipc, 5, IPCOP_msgctl,
-                            msqid, cmd, 0, CHECK_1 (buf));
-  }
-
-  {
-    int result;
-    struct __old_msqid_ds old;
-
-#ifdef __NR_getuid32
-    if (__libc_missing_32bit_uids <= 0)
-      {
-       if (__libc_missing_32bit_uids < 0)
-         {
-           int save_errno = errno;
-
-           /* Test presence of new IPC by testing for getuid32 syscall.  */
-           result = INLINE_SYSCALL (getuid32, 0);
-           if (result == -1 && errno == ENOSYS)
-             __libc_missing_32bit_uids = 1;
-           else
-             __libc_missing_32bit_uids = 0;
-           __set_errno(save_errno);
-         }
-       if (__libc_missing_32bit_uids <= 0)
-         {
-           result = INLINE_SYSCALL (ipc, 5, IPCOP_msgctl,
-                                    msqid, cmd | __IPC_64, 0, CHECK_1 (buf));
-           return result;
-         }
-      }
-#endif
-    if (cmd == IPC_SET)
-      {
-       old.msg_perm.uid = buf->msg_perm.uid;
-       old.msg_perm.gid = buf->msg_perm.gid;
-       old.msg_perm.mode = buf->msg_perm.mode;
-       old.msg_qbytes = buf->msg_qbytes;
-       if (old.msg_perm.uid != buf->msg_perm.uid ||
-           old.msg_perm.gid != buf->msg_perm.gid ||
-           old.msg_qbytes != buf->msg_qbytes)
-         {
-           __set_errno (EINVAL);
-           return -1;
-         }
-      }
-    result = INLINE_SYSCALL (ipc, 5, IPCOP_msgctl,
-                            msqid, cmd, 0, __ptrvalue (&old));
-    if (result != -1 && cmd != IPC_SET)
-      {
-       memset(buf, 0, sizeof(*buf));
-       buf->msg_perm.__key = old.msg_perm.__key;
-       buf->msg_perm.uid = old.msg_perm.uid;
-       buf->msg_perm.gid = old.msg_perm.gid;
-       buf->msg_perm.cuid = old.msg_perm.cuid;
-       buf->msg_perm.cgid = old.msg_perm.cgid;
-       buf->msg_perm.mode = old.msg_perm.mode;
-       buf->msg_perm.__seq = old.msg_perm.__seq;
-       buf->msg_stime = old.msg_stime;
-       buf->msg_rtime = old.msg_rtime;
-       buf->msg_ctime = old.msg_ctime;
-       buf->__msg_cbytes = old.__msg_cbytes;
-       buf->msg_qnum = old.msg_qnum;
-       buf->msg_qbytes = old.msg_qbytes;
-       buf->msg_lspid = old.msg_lspid;
-       buf->msg_lrpid = old.msg_lrpid;
-      }
-    return result;
-  }
-#endif
 }
 
 versioned_symbol (libc, __new_msgctl, msgctl, GLIBC_2_2);
index 0c4ad89f89b26d45b9ca96b2109cf0ec392cc918..5e2d9480598e56c451d2bdc7851c459ccace19c2 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995,1997,1998,2000,2003,2004,2006
-       Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -26,7 +25,6 @@
 #include <string.h>
 #include <sys/syscall.h>
 
-#include <kernel-features.h>
 #include <shlib-compat.h>
 
 struct __old_semid_ds
@@ -54,14 +52,6 @@ union semun
 #include <bp-checks.h>
 #include <bp-semctl.h>         /* definition of CHECK_SEMCTL needs union semum */
 
-#ifdef __NR_getuid32
-# 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
-
 /* Return identifier for array of NSEMS semaphores associated with
    KEY.  */
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
@@ -103,82 +93,8 @@ __new_semctl (int semid, int semnum, int cmd, ...)
 
   va_end (ap);
 
-#if __ASSUME_32BITUIDS > 0
   return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
                         CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
-#else
-  switch (cmd) {
-    case SEM_STAT:
-    case IPC_STAT:
-    case IPC_SET:
-      break;
-    default:
-      return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
-                            CHECK_SEMCTL (&arg, semid, cmd));
-  }
-
-  {
-    int result;
-    struct __old_semid_ds old;
-    struct semid_ds *buf;
-
-#ifdef __NR_getuid32
-    if (__libc_missing_32bit_uids <= 0)
-      {
-       if (__libc_missing_32bit_uids < 0)
-         {
-           int save_errno = errno;
-
-           /* Test presence of new IPC by testing for getuid32 syscall.  */
-           result = INLINE_SYSCALL (getuid32, 0);
-           if (result == -1 && errno == ENOSYS)
-             __libc_missing_32bit_uids = 1;
-           else
-             __libc_missing_32bit_uids = 0;
-           __set_errno(save_errno);
-         }
-       if (__libc_missing_32bit_uids <= 0)
-         {
-           result = INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
-                                    CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
-           return result;
-         }
-      }
-#endif
-
-    buf = arg.buf;
-    arg.__old_buf = &old;
-    if (cmd == IPC_SET)
-      {
-       old.sem_perm.uid = buf->sem_perm.uid;
-       old.sem_perm.gid = buf->sem_perm.gid;
-       old.sem_perm.mode = buf->sem_perm.mode;
-       if (old.sem_perm.uid != buf->sem_perm.uid ||
-           old.sem_perm.gid != buf->sem_perm.gid)
-         {
-           __set_errno (EINVAL);
-           return -1;
-         }
-      }
-    result = INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
-                            CHECK_SEMCTL (&arg, semid, cmd));
-    if (result != -1 && cmd != IPC_SET)
-      {
-       memset(buf, 0, sizeof(*buf));
-       buf->sem_perm.__key = old.sem_perm.__key;
-       buf->sem_perm.uid = old.sem_perm.uid;
-       buf->sem_perm.gid = old.sem_perm.gid;
-       buf->sem_perm.cuid = old.sem_perm.cuid;
-       buf->sem_perm.cgid = old.sem_perm.cgid;
-       buf->sem_perm.mode = old.sem_perm.mode;
-       buf->sem_perm.__seq = old.sem_perm.__seq;
-       buf->sem_otime = old.sem_otime;
-       buf->sem_ctime = old.sem_ctime;
-       buf->sem_nsems = old.sem_nsems;
-      }
-    return result;
-  }
-#endif
 }
 
 versioned_symbol (libc, __new_semctl, semctl, GLIBC_2_2);
index e0b82ccf947007eb21e89c52a42860c5d27ba363..20170e327e2a631d0d61cd83ae3e7de83fa6a641 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995-1998,2000,2002,2003,2004,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
 #include <errno.h>
 #include <unistd.h>
 #include <setxid.h>
-#include <kernel-features.h>
 
 
-#ifdef __NR_setresgid
-extern int __setresgid (uid_t rgid, uid_t egid, uid_t sgid);
-#endif
-
 int
 setegid (gid)
      gid_t gid;
@@ -38,23 +32,7 @@ setegid (gid)
       return -1;
     }
 
-#if __ASSUME_32BITUIDS > 0
   result = INLINE_SETXID_SYSCALL (setresgid32, 3, -1, gid, -1);
-#else
-  /* First try the syscall.  */
-# ifdef __NR_setresgid
-  result = __setresgid (-1, gid, -1);
-#  if __ASSUME_SETRESGID_SYSCALL > 0
-  if (0)
-#  else
-  if (result == -1 && errno == ENOSYS)
-#  endif
-    /* No system call available.  Use emulation.  This may not work
-       since `setregid' also sets the saved user ID when GID is not
-       equal to the real user ID, making it impossible to switch back.  */
-# endif
-    result = __setregid (-1, gid);
-#endif
 
   return result;
 }
index af3231d84b6f04d39ecbb934f610d72c64cbab90..d41e51b2945d5c266a3f2f35ab0587920ecb497c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,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
 #include <errno.h>
 #include <unistd.h>
 #include <setxid.h>
-#include <kernel-features.h>
 
 
-#ifdef __NR_setresuid
-extern int __setresuid (uid_t ruid, uid_t euid, uid_t suid);
-#endif
-
 int
 seteuid (uid_t uid)
 {
@@ -36,23 +31,7 @@ seteuid (uid_t uid)
       return -1;
     }
 
-#if __ASSUME_32BITUIDS > 0
   result = INLINE_SETXID_SYSCALL (setresuid32, 3, -1, uid, -1);
-#else
-  /* First try the syscall.  */
-# ifdef __NR_setresuid
-  result = __setresuid (-1, uid, -1);
-#  if __ASSUME_SETRESUID_SYSCALL > 0
-  if (0)
-#  else
-  if (result == -1 && errno == ENOSYS)
-#  endif
-    /* No system call available.  Use emulation.  This may not work
-       since `setreuid' also sets the saved user ID when UID is not
-       equal to the real user ID, making it impossible to switch back.  */
-# endif
-    result = __setreuid (-1, uid);
-#endif
 
   return result;
 }
index 12c66c5b6e962b494e62d5ec7efbdcdc0936c161..fe5fd86596db2880b5f8388641ff2c2d0610aa0f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000, 2003, 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
 #include <sysdep.h>
 #include <sys/syscall.h>
 #include <linux/posix_types.h>
-#include <kernel-features.h>
 
-
-#ifdef __NR_setfsgid
-
-# ifdef __NR_setfsgid32
-#  if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
-   uids.  */
-extern int __libc_missing_32bit_uids attribute_hidden;
-#  endif
-# endif /* __NR_setfsgid32 */
+/* Consider moving to syscalls.list.  */
 
 int
 setfsgid (gid_t gid)
 {
   INTERNAL_SYSCALL_DECL (err);
-# if __ASSUME_32BITUIDS > 0
-  /* No error checking. */
   return INTERNAL_SYSCALL (setfsgid32, err, 1, gid);
-# else
-#  ifdef __NR_setfsgid32
-  if (__libc_missing_32bit_uids <= 0)
-    {
-      int result;
-
-      result = INTERNAL_SYSCALL (setfsgid32, err, 1, gid);
-      if (! INTERNAL_SYSCALL_ERROR_P (result, err)
-         || INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
-       return result;
-
-      __libc_missing_32bit_uids = 1;
-    }
-#  endif /* __NR_setfsgid32 */
-  if (gid != (gid_t) ((__kernel_gid_t) gid))
-    {
-      __set_errno (EINVAL);
-      return -1;
-    }
-
-  /* No error checking. */
-  return INTERNAL_SYSCALL (setfsgid, err, 1, gid);
-# endif
 }
-#endif
index 5194ce1edc57f7376413a8f05c73848625d840cd..3e0dc972892d51182a2231d056c4c47a9c951dff 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000, 2003, 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
 #include <sys/syscall.h>
 
 #include <linux/posix_types.h>
-#include <kernel-features.h>
 
-#ifdef __NR_setfsuid
-
-# ifdef __NR_setfsuid32
-#  if __ASSUME_32BITUIDS == 0
-/* This variable is shared with all files that need to check for 32bit
-   uids.  */
-extern int __libc_missing_32bit_uids attribute_hidden;
-#  endif
-# endif /* __NR_setfsuid32 */
+/* Consider moving to syscalls.list.  */
 
 int
 setfsuid (uid_t uid)
 {
   INTERNAL_SYSCALL_DECL (err);
-# if  __ASSUME_32BITUIDS > 0
-  /* No error checking. */
   return INTERNAL_SYSCALL (setfsuid32, err, 1, uid);
-# else
-#  ifdef __NR_setfsuid32
-  if (__libc_missing_32bit_uids <= 0)
-    {
-      int result;
-
-      result = INTERNAL_SYSCALL (setfsuid32, err, 1, uid);
-      if (! INTERNAL_SYSCALL_ERROR_P (result, err)
-         || INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
-       return result;
-
-      __libc_missing_32bit_uids = 1;
-    }
-#  endif /* __NR_setfsuid32 */
-
-  if (uid != (uid_t) ((__kernel_uid_t) uid))
-    {
-      __set_errno (EINVAL);
-      return -1;
-    }
-
-  /* No error checking. */
-  return INTERNAL_SYSCALL (setfsuid, err, 1, uid);
-# endif
 }
-#endif
index dacc41dab253f5ec123e88fc1ae6128b9e366532..b067368209bcbc53f7e239a700ff090f6cd110ee 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000, 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
 #include <unistd.h>
 #include <setxid.h>
 #include <linux/posix_types.h>
-#include <kernel-features.h>
-
-
-#ifdef __NR_setgid32
-# 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_setgid32 */
 
 int
 __setgid (gid_t gid)
 {
   int result;
 
-#if __ASSUME_32BITUIDS > 0
   result = INLINE_SETXID_SYSCALL (setgid32, 1, gid);
-#else
-# ifdef __NR_setgid32
-  if (__libc_missing_32bit_uids <= 0)
-    {
-      int saved_errno = errno;
-
-      result = INLINE_SETXID_SYSCALL (setgid32, 1, gid);
-
-      if (result == 0)
-       goto out;
-      if (errno != ENOSYS)
-       return result;
-
-      __set_errno (saved_errno);
-      __libc_missing_32bit_uids = 1;
-    }
-# endif /* __NR_setgid32 */
-
-  if (gid == (gid_t) ~0
-      || gid != (gid_t) ((__kernel_gid_t) gid))
-    {
-      __set_errno (EINVAL);
-      return -1;
-    }
-
-  result = INLINE_SETXID_SYSCALL (setgid, 1, gid);
-# ifdef __NR_setgid32
- out:
-# endif
-#endif
 
   return result;
 }
index dd74cd2864af1cff672e43b6202b90e09f03d67d..73b341ac53010d2b2b9a7349749c71a93f24b847 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1997,1998,2000,2002,2004,2006,2011
-   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 <setxid.h>
 #include <linux/posix_types.h>
-#include <kernel-features.h>
-
-
-#ifdef __NR_setgroups32
-# 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_setgroups32 */
 
 /* Set the group set for the current user to GROUPS (N of them).  For
    Linux we must convert the array of groups into the format that the
@@ -44,47 +33,6 @@ extern int __libc_missing_32bit_uids;
 int
 setgroups (size_t n, const gid_t *groups)
 {
-#if __ASSUME_32BITUIDS > 0
   return INLINE_SETXID_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
-#else
-  if (n > (size_t) __sysconf (_SC_NGROUPS_MAX))
-    {
-      __set_errno (EINVAL);
-      return -1;
-    }
-  else
-    {
-      size_t i;
-      __kernel_gid_t kernel_groups[n];
-
-# ifdef __NR_setgroups32
-      if (__libc_missing_32bit_uids <= 0)
-       {
-         int result;
-         int saved_errno = errno;
-
-         result = INLINE_SETXID_SYSCALL (setgroups32, 2, n,
-                                         CHECK_N (groups, n));
-         if (result == 0 || errno != ENOSYS)
-           return result;
-
-         __set_errno (saved_errno);
-         __libc_missing_32bit_uids = 1;
-       }
-# endif /* __NR_setgroups32 */
-      for (i = 0; i < n; i++)
-       {
-         kernel_groups[i] = (__ptrvalue (groups))[i];
-         if (groups[i] != (gid_t) ((__kernel_gid_t) groups[i]))
-           {
-             __set_errno (EINVAL);
-             return -1;
-           }
-       }
-
-      return INLINE_SETXID_SYSCALL (setgroups, 2, n,
-                                   CHECK_N (kernel_groups, n));
-    }
-#endif
 }
 libc_hidden_def (setgroups)
index b48baf7b4671bce408ff716775cef9c8794f9b1b..d2a1d55d50b3e7514c201e63cdf1a1566b9c2a34 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,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
 #include <unistd.h>
 #include <setxid.h>
 #include <linux/posix_types.h>
-#include <kernel-features.h>
-
-
-#ifdef __NR_setregid32
-# 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_setregid32 */
 
 int
 __setregid (gid_t rgid, gid_t egid)
 {
   int result;
 
-#if __ASSUME_32BITUIDS > 0
   result = INLINE_SETXID_SYSCALL (setregid32, 2, rgid, egid);
-#else
-# ifdef __NR_setregid32
-  if (__libc_missing_32bit_uids <= 0)
-    {
-      int saved_errno = errno;
-
-      result = INLINE_SETXID_SYSCALL (setregid32, 2, rgid, egid);
-
-      if (result == 0)
-       goto out;
-      if (errno != ENOSYS)
-       return result;
-
-      __set_errno (saved_errno);
-      __libc_missing_32bit_uids = 1;
-    }
-# endif /* __NR_setregid32 */
-  if (((rgid + 1) > (gid_t) ((__kernel_gid_t) -1U))
-      || ((egid + 1) > (gid_t) ((__kernel_gid_t) -1U)))
-    {
-      __set_errno (EINVAL);
-      return -1;
-    }
-
-  result = INLINE_SETXID_SYSCALL (setregid, 2, rgid, egid);
-# ifdef __NR_setregid32
- out:
-# endif
-#endif
 
   return result;
 }
index 24a0dd8eb77ce0b3346dac879eb28ff976579ddf..569745bef200871b7d6d3536a141cae321875178 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,2004,2005,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
 #include <unistd.h>
 #include <setxid.h>
 #include <linux/posix_types.h>
-#include <kernel-features.h>
 
 
-#if defined __NR_setresgid || defined __NR_setresgid32
-
-# ifdef __NR_setresgid32
-#  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_setresgid32 */
-
 int
 __setresgid (gid_t rgid, gid_t egid, gid_t sgid)
 {
   int result;
 
-# if __ASSUME_32BITUIDS > 0 || !defined __NR_setresgid
   result = INLINE_SETXID_SYSCALL (setresgid32, 3, rgid, egid, sgid);
-# else
-#  ifdef __NR_setresgid32
-  if (__libc_missing_32bit_uids <= 0)
-    {
-      int saved_errno = errno;
-
-      result = INLINE_SETXID_SYSCALL (setresgid32, 3, rgid, egid, sgid);
-      if (result == 0)
-       goto out;
-      if (errno != ENOSYS)
-       return result;
-
-      __set_errno (saved_errno);
-      __libc_missing_32bit_uids = 1;
-    }
-#  endif /* __NR_setresgid32 */
-
-  if (((rgid + 1) > (gid_t) ((__kernel_gid_t) -1U))
-      || ((egid + 1) > (gid_t) ((__kernel_gid_t) -1U))
-      || ((sgid + 1) > (gid_t) ((__kernel_gid_t) -1U)))
-    {
-      __set_errno (EINVAL);
-      return -1;
-    }
-
-  result = INLINE_SETXID_SYSCALL (setresgid, 3, rgid, egid, sgid);
-#  ifdef __NR_setresgid32
- out:
-#  endif
-# endif
 
   return result;
 }
@@ -77,9 +34,3 @@ libc_hidden_def (__setresgid)
 #ifndef __setresgid
 weak_alias (__setresgid, setresgid)
 #endif
-
-#else
-
-#include <posix/setresgid.c>
-
-#endif
index 1015dd74d9c80f16488894361e119b4b616e6d07..33e464b7f4acb3b43f686decdcdc164df705e06d 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,2004,2005,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
 #include <unistd.h>
 #include <setxid.h>
 #include <linux/posix_types.h>
-#include <kernel-features.h>
 
 
-#if defined __NR_setresuid || defined __NR_setresuid32
-
-# ifdef __NR_setresuid32
-#  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_setresuid32 */
-
 int
 __setresuid (uid_t ruid, uid_t euid, uid_t suid)
 {
   int result;
 
-# if __ASSUME_32BITUIDS > 0 || !defined __NR_setresuid
   result = INLINE_SETXID_SYSCALL (setresuid32, 3, ruid, euid, suid);
-# else
-#  ifdef __NR_setresuid32
-  if (__libc_missing_32bit_uids <= 0)
-    {
-      int saved_errno = errno;
-
-      result = INLINE_SETXID_SYSCALL (setresuid32, 3, ruid, euid, suid);
-      if (result == 0)
-       goto out;
-      if (errno != ENOSYS)
-       return result;
-
-      __set_errno (saved_errno);
-      __libc_missing_32bit_uids = 1;
-    }
-#  endif /* __NR_setresuid32 */
-
-  if (((ruid + 1) > (uid_t) ((__kernel_uid_t) -1U))
-      || ((euid + 1) > (uid_t) ((__kernel_uid_t) -1U))
-      || ((suid + 1) > (uid_t) ((__kernel_uid_t) -1U)))
-    {
-      __set_errno (EINVAL);
-      return -1;
-    }
-
-  result = INLINE_SETXID_SYSCALL (setresuid, 3, ruid, euid, suid);
-#  ifdef __NR_setresuid32
- out:
-#  endif
-# endif
 
   return result;
 }
@@ -77,9 +34,3 @@ libc_hidden_def (__setresuid)
 #ifndef __setresuid
 weak_alias (__setresuid, setresuid)
 #endif
-
-#else
-
-#include <posix/setresuid.c>
-
-#endif
index 7c8b4af9dcc2d12c292e9b7ef97fb71b070a55f0..e17455f8c8e48147ee23e299c99c9217c0d3c7e5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,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
 #include <unistd.h>
 #include <setxid.h>
 #include <linux/posix_types.h>
-#include <kernel-features.h>
 
 
-#ifdef __NR_setreuid32
-# 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_setreuid32 */
-
 int
 __setreuid (uid_t ruid, uid_t euid)
 {
   int result;
 
-#if __ASSUME_32BITUIDS > 0
   result = INLINE_SETXID_SYSCALL (setreuid32, 2, ruid, euid);
-#else
-# ifdef __NR_setreuid32
-  if (__libc_missing_32bit_uids <= 0)
-    {
-      int saved_errno = errno;
-
-      result = INLINE_SETXID_SYSCALL (setreuid32, 2, ruid, euid);
-
-      if (result == 0)
-       goto out;
-      if (errno != ENOSYS)
-       return result;
-
-      __set_errno (saved_errno);
-      __libc_missing_32bit_uids = 1;
-    }
-# endif /* __NR_setreuid32 */
-  if (((ruid + 1) > (uid_t) ((__kernel_uid_t) -1U))
-      || ((euid + 1) > (uid_t) ((__kernel_uid_t) -1U)))
-    {
-      __set_errno (EINVAL);
-      return -1;
-    }
-
-  result = INLINE_SETXID_SYSCALL (setreuid, 2, ruid, euid);
-# ifdef __NR_setreuid32
- out:
-# endif
-#endif
 
   return result;
 }
index 54ed9ba34a937fed18e0a251a5d3ec3378398851..cab40671e7af64b91053ed42a68cfd18220b3654 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,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
 #include <unistd.h>
 #include <setxid.h>
 #include <linux/posix_types.h>
-#include <kernel-features.h>
 
 
-#ifdef __NR_setuid32
-# 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_setuid32 */
-
 int
 __setuid (uid_t uid)
 {
   int result;
 
-#if __ASSUME_32BITUIDS > 0 && defined __NR_setuid32
   result = INLINE_SETXID_SYSCALL (setuid32, 1, uid);
-#else
-# ifdef __NR_setuid32
-  if (__libc_missing_32bit_uids <= 0)
-    {
-      int saved_errno = errno;
-
-      result = INLINE_SETXID_SYSCALL (setuid32, 1, uid);
-      if (result == 0)
-       goto out;
-      if (errno != ENOSYS)
-       return result;
-
-      __set_errno (saved_errno);
-      __libc_missing_32bit_uids = 1;
-    }
-# endif /* __NR_setuid32 */
-
-  if (uid == (uid_t) ~0
-      || uid != (uid_t) ((__kernel_uid_t) uid))
-    {
-      __set_errno (EINVAL);
-      return -1;
-    }
-
-  result = INLINE_SETXID_SYSCALL (setuid, 1, uid);
-# ifdef __NR_setuid32
- out:
-# endif
-#endif
 
   return result;
 }
index fb38ed79cdfba42d287c4c348bf29388030328aa..dd2167d9a78d524f59f2decd15e806e1605da9da 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1997,1998,2000,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -26,7 +26,6 @@
 #include <bits/wordsize.h>
 #include <bp-checks.h>
 
-#include <kernel-features.h>
 #include <shlib-compat.h>
 
 struct __old_shmid_ds
@@ -53,14 +52,6 @@ struct __old_shminfo
   int shmall;
 };
 
-#ifdef __NR_getuid32
-# 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
-
 /* Provide operations to control over shared memory segments.  */
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
 int __old_shmctl (int, int, struct __old_shmid_ds *);
@@ -81,97 +72,8 @@ compat_symbol (libc, __old_shmctl, shmctl, GLIBC_2_0);
 int
 __new_shmctl (int shmid, int cmd, struct shmid_ds *buf)
 {
-#if __ASSUME_32BITUIDS > 0
   return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl,
                         shmid, cmd | __IPC_64, 0, CHECK_1 (buf));
-#else
-  switch (cmd) {
-    case SHM_STAT:
-    case IPC_STAT:
-    case IPC_SET:
-# if __WORDSIZE != 32
-    case IPC_INFO:
-# endif
-      break;
-    default:
-      return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl,
-                            shmid, cmd, 0, CHECK_1 (buf));
-  }
-
-  {
-    struct __old_shmid_ds old;
-    int result;
-
-# ifdef __NR_getuid32
-    if (__libc_missing_32bit_uids <= 0)
-      {
-       if (__libc_missing_32bit_uids < 0)
-         {
-           int save_errno = errno;
-
-           /* Test presence of new IPC by testing for getuid32 syscall.  */
-           result = INLINE_SYSCALL (getuid32, 0);
-           if (result == -1 && errno == ENOSYS)
-             __libc_missing_32bit_uids = 1;
-           else
-             __libc_missing_32bit_uids = 0;
-           __set_errno(save_errno);
-         }
-       if (__libc_missing_32bit_uids <= 0)
-         return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl,
-                                shmid, cmd | __IPC_64, 0, CHECK_1 (buf));
-      }
-# endif
-
-    if (cmd == IPC_SET)
-      {
-       old.shm_perm.uid = buf->shm_perm.uid;
-       old.shm_perm.gid = buf->shm_perm.gid;
-       old.shm_perm.mode = buf->shm_perm.mode;
-       if (old.shm_perm.uid != buf->shm_perm.uid ||
-           old.shm_perm.gid != buf->shm_perm.gid)
-         {
-           __set_errno (EINVAL);
-           return -1;
-         }
-      }
-    result = INLINE_SYSCALL (ipc, 5, IPCOP_shmctl,
-                            shmid, cmd, 0, __ptrvalue (&old));
-    if (result != -1 && (cmd == SHM_STAT || cmd == IPC_STAT))
-      {
-       memset(buf, 0, sizeof(*buf));
-       buf->shm_perm.__key = old.shm_perm.__key;
-       buf->shm_perm.uid = old.shm_perm.uid;
-       buf->shm_perm.gid = old.shm_perm.gid;
-       buf->shm_perm.cuid = old.shm_perm.cuid;
-       buf->shm_perm.cgid = old.shm_perm.cgid;
-       buf->shm_perm.mode = old.shm_perm.mode;
-       buf->shm_perm.__seq = old.shm_perm.__seq;
-       buf->shm_atime = old.shm_atime;
-       buf->shm_dtime = old.shm_dtime;
-       buf->shm_ctime = old.shm_ctime;
-       buf->shm_segsz = old.shm_segsz;
-       buf->shm_nattch = old.shm_nattch;
-       buf->shm_cpid = old.shm_cpid;
-       buf->shm_lpid = old.shm_lpid;
-      }
-# if __WORDSIZE != 32
-    else if (result != -1 && cmd == IPC_INFO)
-      {
-       struct __old_shminfo *oldi = (struct __old_shminfo *)&old;
-       struct shminfo *i = (struct shminfo *)buf;
-
-       memset(i, 0, sizeof(*i));
-       i->shmmax = oldi->shmmax;
-       i->shmmin = oldi->shmmin;
-       i->shmmni = oldi->shmmni;
-       i->shmseg = oldi->shmseg;
-       i->shmall = oldi->shmall;
-      }
-# endif
-    return result;
-  }
-#endif
 }
 
 versioned_symbol (libc, __new_shmctl, shmctl, GLIBC_2_2);
index 1090f8a809d7d14986722f796f96a75df4f7074d..fd2f1dbd01e6980325b6fb132d045119f7f2d251 100644 (file)
    introduced.  If somebody cares these values can afterwards be
    corrected.  */
 
-/* When did the `setresuid' syscall became available?  By 2.2.0 except
-   on SPARC.  */
-#if !defined __sparc__
-# define __ASSUME_SETRESUID_SYSCALL    1
-#endif
-
 /* The sendfile syscall was introduced in 2.2.0.  */
 #define __ASSUME_SENDFILE              1
 
 /* On x86 another `getrlimit' syscall was added in 2.3.25.  */
-#if __LINUX_KERNEL_VERSION >= 131865 && defined __i386__
+#ifdef __i386__
 # define __ASSUME_NEW_GETRLIMIT_SYSCALL        1
 #endif
 
 /* On x86 the truncate64/ftruncate64 syscalls were introduced in 2.3.31.  */
-#if __LINUX_KERNEL_VERSION >= 131871 && defined __i386__
+#ifdef __i386__
 # define __ASSUME_TRUNCATE64_SYSCALL   1
 #endif
 
 /* On x86 the mmap2 syscall was introduced in 2.3.31.  */
-#if __LINUX_KERNEL_VERSION >= 131871 && defined __i386__
+#ifdef __i386__
 # define __ASSUME_MMAP2_SYSCALL        1
 #endif
 
 /* On x86 the stat64/lstat64/fstat64 syscalls were introduced in 2.3.34.  */
-#if __LINUX_KERNEL_VERSION >= 131874 && defined __i386__
+#ifdef __i386__
 # define __ASSUME_STAT64_SYSCALL       1
 #endif
 
 /* On sparc the truncate64/ftruncate64/mmap2/stat64/lstat64/fstat64
    syscalls were introduced in 2.3.35.  */
-#if __LINUX_KERNEL_VERSION >= 131875 \
-    && (defined __sparc__ && !defined __arch64__)
+#if defined __sparc__ && !defined __arch64__
 # define __ASSUME_TRUNCATE64_SYSCALL   1
 # define __ASSUME_MMAP2_SYSCALL                1
 # define __ASSUME_STAT64_SYSCALL       1
 #endif
 
 /* I know for sure that getrlimit are in 2.3.35 on powerpc.  */
-#if __LINUX_KERNEL_VERSION >= 131875 && defined __powerpc__
+#ifdef __powerpc__
 # define __ASSUME_NEW_GETRLIMIT_SYSCALL        1
 #endif
 
 /* I know for sure that these are in 2.3.35 on powerpc. But PowerPC64 does not
    support separate 64-bit syscalls, already 64-bit.  */
-#if __LINUX_KERNEL_VERSION >= 131875 && defined __powerpc__ \
-    && !defined __powerpc64__
+#if defined __powerpc__ && !defined __powerpc64__
 # define __ASSUME_TRUNCATE64_SYSCALL   1
 # define __ASSUME_STAT64_SYSCALL       1
 #endif
 
-/* Linux 2.3.39 introduced 32bit UID/GIDs.  Some platforms had 32
-   bit type all along.  */
-#if __LINUX_KERNEL_VERSION >= 131879 || defined __powerpc__
-# define __ASSUME_32BITUIDS            1
-#endif
-
-/* Linux 2.3.39 sparc added setresuid.  */
-#if __LINUX_KERNEL_VERSION >= 131879 && defined __sparc__
-# define __ASSUME_SETRESUID_SYSCALL    1
-#endif
-
-#if __LINUX_KERNEL_VERSION >= 131879
-# define __ASSUME_SETRESGID_SYSCALL    1
-#endif
-
-/* Linux 2.3.39 introduced IPC64.  Except for powerpc.  */
-#if __LINUX_KERNEL_VERSION >= 131879 && !defined __powerpc__
+/* Linux 2.3.39 introduced IPC64.  Except for powerpc.  Linux 2.4.0 on
+   PPC introduced a correct IPC64.  But PowerPC64 does not support a
+   separate 64-bit syscall, already 64-bit.  */
+#ifndef __powerpc64__
 # define __ASSUME_IPC64                1
 #endif
 
-/* We can use the LDTs for threading with Linux 2.3.99 and newer.  */
-#if __LINUX_KERNEL_VERSION >= 131939
-# define __ASSUME_LDT_WORKS            1
-#endif
-
-/* Linux 2.4.0 on PPC introduced a correct IPC64.  But PowerPC64 does not
-   support a separate 64-bit syscall, already 64-bit.  */
-#if __LINUX_KERNEL_VERSION >= 132096 && defined __powerpc__ \
-    && !defined __powerpc64__
-# define __ASSUME_IPC64                        1
-#endif
-
 /* SH kernels got stat64, mmap2, and truncate64 during 2.4.0-test.  */
-#if __LINUX_KERNEL_VERSION >= 132096 && defined __sh__
+#ifdef __sh__
 # define __ASSUME_TRUNCATE64_SYSCALL   1
 # define __ASSUME_MMAP2_SYSCALL                1
 # define __ASSUME_STAT64_SYSCALL       1
 # define __ASSUME_GETDENTS64_SYSCALL   1
 #endif
 
-/* When did O_DIRECTORY become available?  Early in 2.3 but when?
-   Be safe, use 2.3.99.  */
-#if __LINUX_KERNEL_VERSION >= 131939
-# define __ASSUME_O_DIRECTORY          1
-#endif
-
 /* Starting with one of the 2.4.0 pre-releases the Linux kernel passes
    up the page size information.  */
 #if __LINUX_KERNEL_VERSION >= 132097
index 0579687982a7c46fd18d1b1d5b65856a76007977..97d787d9426973051a302676fc45e113cf3b526c 100644 (file)
@@ -1,23 +1,16 @@
 /* SETxID functions which only have to change the local thread and
    none of the possible other threads.  */
-#include <kernel-features.h>
 #include <sysdep.h>
 
-/* If we can use the syscall directly, use it.  */
-#if __ASSUME_32BITUIDS > 0 && defined __NR_setresuid32
+#ifdef __NR_setresuid32
 # define local_seteuid(id) INLINE_SYSCALL (setresuid32, 3, -1, id, -1)
-#elif __ASSUME_SETRESUID_SYSCALL > 0
-# define local_seteuid(id) INLINE_SYSCALL (setresuid, 3, -1, id, -1)
 #else
-# define local_seteuid(id) seteuid (id)
+# define local_seteuid(id) INLINE_SYSCALL (setresuid, 3, -1, id, -1)
 #endif
 
 
-/* If we can use the syscall directly, use it.  */
-#if __ASSUME_32BITUIDS > 0 && defined __NR_setresgid32
+#ifdef __NR_setresgid32
 # define local_setegid(id) INLINE_SYSCALL (setresgid32, 3, -1, id, -1)
-#elif __ASSUME_SETRESGID_SYSCALL > 0
-# define local_setegid(id) INLINE_SYSCALL (setresgid, 3, -1, id, -1)
 #else
-# define local_setegid(id) setegid (id)
+# define local_setegid(id) INLINE_SYSCALL (setresgid, 3, -1, id, -1)
 #endif
index 2c6c557a09a1d8602fe6952e69c6e7b47e1f8d7e..b0bb80d397a1bf5ecb29c6f36af71bfc90bdd787 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <kernel-features.h>
-
-
-#ifdef __ASSUME_O_DIRECTORY
-# define O_DIRECTORY_WORKS     1
-#endif
+#define O_DIRECTORY_WORKS      1
 
 #include <sysdeps/unix/opendir.c>
index 595938062181135de8c967f9b422cd55340093a8..d4674229ea66b4a928fb8a7a164fdb7bf989521a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1999-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
@@ -36,15 +36,8 @@ __opensock (void)
     const char procname[15];
   } afs[] =
     {
-      /* The 2.2 kernels cannot handle ioctl(SIOCGIFCONF) on AF_UNIX sockets.
-        Give the kernel a chance to user inet sockets on old kernels.  */
-#if __LINUX_KERNEL_VERSION < 132096
-      { AF_INET, "" },
-      { AF_UNIX, "net/unix" },
-#else
       { AF_UNIX, "net/unix" },
       { AF_INET, "" },
-#endif
       { AF_INET6, "net/if_inet6" },
       { AF_AX25, "net/ax25" },
       { AF_NETROM, "net/nr" },
index bc471454e46202242630c5b2b50b8b362f8737da..cc0503cbca14e82228124a756d4b42091b11c917 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000,2001,2002,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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
@@ -24,7 +24,6 @@
 #include <bp-checks.h>
 
 #include <linux/posix_types.h>
-#include <kernel-features.h>
 
 /*
   In Linux 2.1.x the chown functions have been changed.  A new function lchown
 
 /* Running under Linux > 2.1.80.  */
 
-#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 */
+/* Consider moving to syscalls.list.  */
 
 int
 __real_chown (const char *file, uid_t owner, gid_t group)
 {
-#if __ASSUME_32BITUIDS > 0
   return INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
-#else
-  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);
-#endif
 }
 
 
index 754245a8fdda3bd70ae4a6cf522a6b5428170618..6190d02a6f068c5bd7715562103592e6ce2e01f0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2003, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000-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 <bp-checks.h>
 
 #include <linux/posix_types.h>
-#include <kernel-features.h>
 
-# ifdef __NR_lchown32
-#  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_lchown32 */
+/* Consider moving to syscalls.list.  */
 
 int
 __lchown (const char *file, uid_t owner, gid_t group)
 {
-# if __ASSUME_32BITUIDS > 0
   return INLINE_SYSCALL (lchown32, 3, CHECK_STRING (file), owner, group);
-# else
-#  ifdef __NR_lchown32
-  if (__libc_missing_32bit_uids <= 0)
-    {
-      int result;
-      int saved_errno = errno;
-
-      result = INLINE_SYSCALL (lchown32, 3, CHECK_STRING (file), owner, group);
-      if (result == 0 || errno != ENOSYS)
-       return result;
-
-      __set_errno (saved_errno);
-      __libc_missing_32bit_uids = 1;
-    }
-#  endif /* __NR_lchown32 */
-
-  if (((owner + 1) > (uid_t) ((__kernel_uid_t) -1U))
-      || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
-    {
-      __set_errno (EINVAL);
-      return -1;
-    }
-
-  return INLINE_SYSCALL (lchown, 3, CHECK_STRING (file), owner, group);
-# endif
 }
 
 weak_alias (__lchown, lchown)
index bc26c99ef73a51176d7fd072d2a919c5231510c8..5ed44ed70f605ab58c8801f82fa31ca75a42bc60 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,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
 #include <errno.h>
 #include <unistd.h>
 #include <setxid.h>
-#include <kernel-features.h>
 
 
-#if defined __NR_setresgid || __ASSUME_SETRESGID_SYSCALL > 0
-
-extern int __setresgid (gid_t rgid, gid_t egid, gid_t sgid);
-
 int
 setegid (gid_t gid)
 {
@@ -36,25 +31,14 @@ setegid (gid_t gid)
       return -1;
     }
 
-# if __ASSUME_32BITUIDS > 0 && defined __NR_setresgid32
+#ifdef __NR_setresgid32
   result = INLINE_SETXID_SYSCALL (setresgid32, 3, -1, gid, -1);
-# else
-  /* First try the syscall.  */
+#else
   result = INLINE_SETXID_SYSCALL (setresgid, 3, -1, gid, -1);
-#  if __ASSUME_SETRESGID_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use emulation.  This may not work
-       since `setregid' also sets the saved group ID when GID is not
-       equal to the real group ID, making it impossible to switch back. */
-    result = __setregid (-1, gid);
-#  endif
-# endif
+#endif
 
   return result;
 }
 #ifndef setegid
 libc_hidden_def (setegid)
 #endif
-#else
-# include <sysdeps/unix/bsd/setegid.c>
-#endif
index 21625b406f412811c8f73aba2e5fc05eacd9141d..e9bd82d86e35d124a25388df54ecb227b8e821ee 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,1999,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
 #include <errno.h>
 #include <unistd.h>
 #include <setxid.h>
-#include <kernel-features.h>
 
 
-#if defined __NR_setresuid || __ASSUME_SETRESUID_SYSCALL > 0
-
-extern int __setresuid (uid_t ruid, uid_t euid, uid_t suid);
-
 int
 seteuid (uid_t uid)
 {
@@ -36,25 +31,14 @@ seteuid (uid_t uid)
       return -1;
     }
 
-# if __ASSUME_32BITUIDS > 0 && defined __NR_setresuid32
+#ifdef __NR_setresuid32
   result = INLINE_SETXID_SYSCALL (setresuid32, 3, -1, uid, -1);
-# else
-  /* First try the syscall.  */
+#else
   result = INLINE_SETXID_SYSCALL (setresuid, 3, -1, uid, -1);
-#  if __ASSUME_SETRESUID_SYSCALL == 0
-  if (result == -1 && errno == ENOSYS)
-    /* No system call available.  Use emulation.  This may not work
-       since `setreuid' also sets the saved user ID when UID is not
-       equal to the real user ID, making it impossible to switch back.  */
-    result = __setreuid (-1, uid);
-#  endif
-# endif
+#endif
 
   return result;
 }
 #ifndef seteuid
 libc_hidden_def (seteuid)
 #endif
-#else
-# include <sysdeps/unix/bsd/seteuid.c>
-#endif
index 72582b9a43c4590e425b9325150cac7c6206237f..5ae94b6b25b84e8570def2021312dec7b55ffe2f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2002,2003,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
 #include <bp-checks.h>
 
 #include <linux/posix_types.h>
-#include <kernel-features.h>
 
-#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 */
+/* Consider moving to syscalls.list.  */
 
 int
 __chown (const char *file, uid_t owner, gid_t group)
 {
-#if __ASSUME_32BITUIDS > 0
   return INLINE_SYSCALL (chown32, 3, CHECK_STRING (file), owner, group);
-#else
-# 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) > (gid_t) ((__kernel_uid_t) -1U))
-      || ((group + 1) > (gid_t) ((__kernel_gid_t) -1U)))
-    {
-      __set_errno (EINVAL);
-      return -1;
-    }
-
-  return INLINE_SYSCALL (chown, 3, CHECK_STRING (file), owner, group);
-#endif
 }
 libc_hidden_def (__chown)
 weak_alias (__chown, chown)
index 87cb23a517ba28c67f440f3923c37a7dbefe1f8d..464f0b502d65c52a1224cf1f2d362fecf55811be 100644 (file)
@@ -1,6 +1,5 @@
 /* Semctl for architectures where word sized unions are passed indirectly
-   Copyright (C) 1995,1997,1998,2000,2002,2003,2004,2006
-       Free Software Foundation, Inc.
+   Copyright (C) 1995-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -27,7 +26,6 @@
 #include <string.h>
 #include <sys/syscall.h>
 
-#include <kernel-features.h>
 #include <shlib-compat.h>
 
 struct __old_semid_ds
@@ -55,14 +53,6 @@ union semun
 #include <bp-checks.h>
 #include <bp-semctl.h>         /* definition of CHECK_SEMCTL needs union semum */
 
-#ifdef __NR_getuid32
-# 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
-
 /* Return identifier for array of NSEMS semaphores associated with
    KEY.  */
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2)
@@ -126,82 +116,8 @@ __new_semctl (int semid, int semnum, int cmd, ...)
       break;
     }
 
-#if __ASSUME_32BITUIDS > 0
   return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
                         CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
-#else
-  switch (cmd) {
-    case SEM_STAT:
-    case IPC_STAT:
-    case IPC_SET:
-      break;
-    default:
-      return INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
-                            CHECK_SEMCTL (&arg, semid, cmd));
-  }
-
-  {
-    int result;
-    struct __old_semid_ds old;
-    struct semid_ds *buf;
-
-#ifdef __NR_getuid32
-    if (__libc_missing_32bit_uids <= 0)
-      {
-       if (__libc_missing_32bit_uids < 0)
-         {
-           int save_errno = errno;
-
-           /* Test presence of new IPC by testing for getuid32 syscall.  */
-           result = INLINE_SYSCALL (getuid32, 0);
-           if (result == -1 && errno == ENOSYS)
-             __libc_missing_32bit_uids = 1;
-           else
-             __libc_missing_32bit_uids = 0;
-           __set_errno(save_errno);
-         }
-       if (__libc_missing_32bit_uids <= 0)
-         {
-           result = INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd | __IPC_64,
-                                    CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
-           return result;
-         }
-      }
-#endif
-
-    buf = arg.buf;
-    arg.__old_buf = &old;
-    if (cmd == IPC_SET)
-      {
-       old.sem_perm.uid = buf->sem_perm.uid;
-       old.sem_perm.gid = buf->sem_perm.gid;
-       old.sem_perm.mode = buf->sem_perm.mode;
-       if (old.sem_perm.uid != buf->sem_perm.uid ||
-           old.sem_perm.gid != buf->sem_perm.gid)
-         {
-           __set_errno (EINVAL);
-           return -1;
-         }
-      }
-    result = INLINE_SYSCALL (ipc, 5, IPCOP_semctl, semid, semnum, cmd,
-                            CHECK_SEMCTL (&arg, semid, cmd));
-    if (result != -1 && cmd != IPC_SET)
-      {
-       memset(buf, 0, sizeof(*buf));
-       buf->sem_perm.__key = old.sem_perm.__key;
-       buf->sem_perm.uid = old.sem_perm.uid;
-       buf->sem_perm.gid = old.sem_perm.gid;
-       buf->sem_perm.cuid = old.sem_perm.cuid;
-       buf->sem_perm.cgid = old.sem_perm.cgid;
-       buf->sem_perm.mode = old.sem_perm.mode;
-       buf->sem_perm.__seq = old.sem_perm.__seq;
-       buf->sem_otime = old.sem_otime;
-       buf->sem_ctime = old.sem_ctime;
-       buf->sem_nsems = old.sem_nsems;
-      }
-    return result;
-  }
-#endif
 }
 
 versioned_symbol (libc, __new_semctl, semctl, GLIBC_2_2);