Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove pre-2.4 Linux kernel support.
  • Loading branch information
Joseph Myers committed May 25, 2012
1 parent a386f1c commit 2170894
Show file tree
Hide file tree
Showing 39 changed files with 240 additions and 1,426 deletions.
160 changes: 160 additions & 0 deletions 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
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Expand Up @@ -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.

Expand Down
13 changes: 5 additions & 8 deletions sysdeps/unix/sysv/linux/configure
Expand Up @@ -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*)
Expand All @@ -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
Expand Down
13 changes: 5 additions & 8 deletions sysdeps/unix/sysv/linux/configure.in
Expand Up @@ -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*)
Expand All @@ -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
Expand Down
35 changes: 1 addition & 34 deletions sysdeps/unix/sysv/linux/i386/chown.c
Expand Up @@ -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
Expand All @@ -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
}


Expand Down
37 changes: 2 additions & 35 deletions sysdeps/unix/sysv/linux/i386/fchown.c
@@ -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
Expand All @@ -22,46 +22,13 @@
#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)
10 changes: 0 additions & 10 deletions sysdeps/unix/sysv/linux/i386/fchownat.c
Expand Up @@ -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)
Expand All @@ -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;

Expand Down

0 comments on commit 2170894

Please sign in to comment.