diff options
| author | Joseph Myers <joseph@codesourcery.com> | 2012-05-14 14:11:02 +0000 |
|---|---|---|
| committer | Joseph Myers <joseph@codesourcery.com> | 2012-05-14 14:11:02 +0000 |
| commit | ffb7875d03e224584fd1e3dc8bb6e90c79ed606e (patch) | |
| tree | 7735bbae8f840773afe241281ae1184cd956acc8 | |
| parent | 1bfb72913bf82781ae232d056991362b2b071800 (diff) | |
| download | glibc-ffb7875d03e224584fd1e3dc8bb6e90c79ed606e.tar.xz glibc-ffb7875d03e224584fd1e3dc8bb6e90c79ed606e.zip | |
Remove pre-2.2 Linux kernel support.
40 files changed, 319 insertions, 1433 deletions
@@ -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 @@ -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. Version 2.15 diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure index d571d0b62b..8235068a18 100644 --- a/sysdeps/unix/sysv/linux/configure +++ b/sysdeps/unix/sysv/linux/configure @@ -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 diff --git a/sysdeps/unix/sysv/linux/configure.in b/sysdeps/unix/sysv/linux/configure.in index 916d64a605..1ce14f294f 100644 --- a/sysdeps/unix/sysv/linux/configure.in +++ b/sysdeps/unix/sysv/linux/configure.in @@ -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 diff --git a/sysdeps/unix/sysv/linux/getcwd.c b/sysdeps/unix/sysv/linux/getcwd.c index 6e3c5e0644..8f884808c3 100644 --- a/sysdeps/unix/sysv/linux/getcwd.c +++ b/sysdeps/unix/sysv/linux/getcwd.c @@ -38,27 +38,6 @@ #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) - |
