about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/kernel-features.h
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2014-05-12 22:48:25 +0000
committerJoseph Myers <joseph@codesourcery.com>2014-05-12 22:48:25 +0000
commit637461d96563f3b7405df5b124ccfe843e537374 (patch)
tree0a6b2a0fa945d90bd8bd6bb78165ad9964bbd788 /sysdeps/unix/sysv/linux/kernel-features.h
parent315eb1d86aea489cd6325fd1c2521dcfb4fc0e1c (diff)
downloadglibc-637461d96563f3b7405df5b124ccfe843e537374.tar.gz
glibc-637461d96563f3b7405df5b124ccfe843e537374.tar.xz
glibc-637461d96563f3b7405df5b124ccfe843e537374.zip
Clean up kernel version conditionals for pre-2.6.32 kernels.
This patch does some initial cleanup, following the move to 2.6.32
minimum kernel version, by removing __LINUX_KERNEL_VERSION
conditionals that are now always-true or always-false.  In the case of
__ASSUME_ARG_MAX_STACK_BASED, where the conditional used a kernel
version that was itself in a macro, the associated sysconf.c code is
also cleaned up and __ASSUME_ARG_MAX_STACK_BASED removed completely.

Tested x86_64 that disassembly of installed shared libraries is
unchanged by the patch.

	* sysdeps/unix/sysv/linux/kernel-features.h [__s390__]
	(__ASSUME_UTIMES): Do not condition on kernel version.
	(__ASSUME_PSELECT): Define unconditionally.
	(__ASSUME_PPOLL): Likewise.
	(__ASSUME_ATFCTS): Likewise.
	(__ASSUME_SET_ROBUST_LIST): Do not condition on kernel version.
	(__ASSUME_COMPLETE_READV_WRITEV): Define unconditionally.
	(__ASSUME_FUTEX_LOCK_PI): Do not condition on kernel version.
	(__ASSUME_UTIMENSAT): Define unconditionally.
	(__ASSUME_PRIVATE_FUTEX): Likewise.
	(__ASSUME_FALLOCATE): Likewise.
	(__ASSUME_O_CLOEXEC): Likewise.
	(__LINUX_ARG_MAX_STACK_BASED_MIN_KERNEL): Remove.
	(__ASSUME_ARG_MAX_STACK_BASED): Likewise.
	(__ASSUME_ADJ_OFFSET_SS_READ): Define unconditionally.
	(__ASSUME_SOCK_CLOEXEC): Do not condition on kernel version.
	(__ASSUME_IN_NONBLOCK): Likewise.
	(__ASSUME_PIPE2): Likewise.
	(__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	(__ASSUME_DUP3): Likewise.
	[__x86_64__ || __sparc__] (__ASSUME_ACCEPT4_SYSCALL): Likewise.
	(__ASSUME_FUTEX_CLOCK_REALTIME): Define unconditionally.
	(__ASSUME_AT_RANDOM): Likewise.
	(__ASSUME_PREADV): Likewise.
	(__ASSUME_PWRITEV): Likewise.
	(__ASSUME_REQUEUE_PI): Do not condition on kernel version.
	(__ASSUME_F_GETOWN_EX): Define unconditionally.
	(__ASSUME_XFS_RESTRICTED_CHOWN): Likewise.
	* sysdeps/unix/sysv/linux/sysconf.c (__sysconf)
	[!__ASSUME_ARG_MAX_STACK_BASED]: Remove conditional code.
	* sysdeps/unix/sysv/linux/alpha/kernel-features.h
	(__ASSUME_O_CLOEXEC): Define unconditionally.
	(__ASSUME_PSELECT): Do not undefine conditionally.
	(__ASSUME_PPOLL): Likewise.
	(__ASSUME_ATFCTS): Likewise.
	(__ASSUME_SET_ROBUST_LIST): Likewise.
	(__ASSUME_UTIMENSAT): Likewise.
	(__ASSUME_FDATASYNC): Define unconditionally.
	* sysdeps/unix/sysv/linux/arm/kernel-features.h
	(__ASSUME_SIGFRAME_V2): Likewise.
	)__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	(__ASSUME_PSELECT): Do not undefine conditionally.
	(__ASSUME_PPOLL): Likewise.
	* sysdeps/unix/sysv/linux/ia64/kernel-features.h
	(__ASSUME_PSELECT): Define unconditionally.
	(__ASSUME_PPOLL): Likewise.
	(__ASSUME_O_CLOEXEC): Likewise.
	(__ASSUME_SOCK_CLOEXEC): Likewise.
	(__ASSUME_IN_NONBLOCK): Likewise.
	(__ASSUME_PIPE2): Likewise.
	(__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	(__ASSUME_DUP3): Likewise.
	* sysdeps/unix/sysv/linux/m68k/kernel-features.h
	(__ASSUME_O_CLOEXEC): Likewise.
	(__ASSUME_SOCK_CLOEXEC): Likewise.
	(__ASSUME_IN_NONBLOCK): Likewise.
	(__ASSUME_PIPE2): Likewise.
	(__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	(__ASSUME_DUP3): Likewise.
	* sysdeps/unix/sysv/linux/mips/kernel-features.h
	(__ASSUME_EVENTFD2): Likewise.
	(__ASSUME_SIGNALFD4): Likewise.
	(__ASSUME_ACCEPT4_SYSCALL): Likewise.
Diffstat (limited to 'sysdeps/unix/sysv/linux/kernel-features.h')
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h104
1 files changed, 28 insertions, 76 deletions
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index db6af35c31..46e16f6e82 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -81,98 +81,62 @@
     || defined __x86_64__ \
     || defined __powerpc__ \
     || defined __sh__ \
-    || (defined __s390__ && __LINUX_KERNEL_VERSION >= 0x020616)
+    || defined __s390__
 # define __ASSUME_UTIMES	1
 #endif
 
-/* pselect/ppoll were introduced just after 2.6.16-rc1.  Due to the way
-   the kernel versions are advertised we can only rely on 2.6.17 to have
-   the code.  On x86_64 and SH this appeared first in 2.6.19-rc1,
-   on ia64 in 2.6.22-rc1.  */
-#if __LINUX_KERNEL_VERSION >= 0x020611 \
-    && ((!defined __x86_64__ && !defined __sh__) \
-	|| (__LINUX_KERNEL_VERSION >= 0x020613 \
-	    && (defined __x86_64__ || defined __sh__)))
-# define __ASSUME_PSELECT	1
-# define __ASSUME_PPOLL		1
-#endif
+/* pselect/ppoll were introduced just after 2.6.16-rc1.  On x86_64 and
+   SH this appeared first in 2.6.19-rc1, on ia64 in 2.6.22-rc1.  */
+#define __ASSUME_PSELECT	1
+#define __ASSUME_PPOLL		1
 
-/* The *at syscalls were introduced just after 2.6.16-rc1.  Due to the way the
-   kernel versions are advertised we can only rely on 2.6.17 to have
-   the code.  On PPC they were introduced in 2.6.17-rc1,
-   on SH in 2.6.19-rc1.  */
-#if __LINUX_KERNEL_VERSION >= 0x020611 \
-    && (!defined __sh__ || __LINUX_KERNEL_VERSION >= 0x020613)
-# define __ASSUME_ATFCTS	1
-#endif
+/* The *at syscalls were introduced just after 2.6.16-rc1.  On PPC
+   they were introduced in 2.6.17-rc1, on SH in 2.6.19-rc1.  */
+#define __ASSUME_ATFCTS	1
 
 /* Support for inter-process robust mutexes was added in 2.6.17 (but
    some architectures lack futex_atomic_cmpxchg_inatomic in some
    configurations).  */
-#if __LINUX_KERNEL_VERSION >= 0x020611 \
-    && (!defined __sh__ || __LINUX_KERNEL_VERSION >= 0x020613) \
-    && !(defined __sparc__ && !defined __arch64__ && !defined __sparc_v9__)
+#if !(defined __sparc__ && !defined __arch64__ && !defined __sparc_v9__)
 # define __ASSUME_SET_ROBUST_LIST	1
 #endif
 
 /* Pessimistically assume that 2.6.18 introduced real handling of
    large numbers of requests to readv and writev and that we don't
    need a fallback.  It likely worked for much longer.  */
-#if __LINUX_KERNEL_VERSION >= 0x020612
-# define __ASSUME_COMPLETE_READV_WRITEV	1
-#endif
+#define __ASSUME_COMPLETE_READV_WRITEV	1
 
 /* Support for PI futexes was added in 2.6.18 (but some architectures
    lack futex_atomic_cmpxchg_inatomic in some configurations).  */
-#if __LINUX_KERNEL_VERSION >= 0x020612 \
-    && !(defined __sparc__ && !defined __arch64__ && !defined __sparc_v9__)
+#if !(defined __sparc__ && !defined __arch64__ && !defined __sparc_v9__)
 # define __ASSUME_FUTEX_LOCK_PI	1
 #endif
 
 /* Support for utimensat syscall was added in 2.6.22, on SH
    only after 2.6.22-rc1.  */
-#if __LINUX_KERNEL_VERSION >= 0x020616 \
-    && (!defined __sh__ || __LINUX_KERNEL_VERSION >= 0x020617)
-# define __ASSUME_UTIMENSAT	1
-#endif
+#define __ASSUME_UTIMENSAT	1
 
 /* Support for private futexes was added in 2.6.22.  */
-#if __LINUX_KERNEL_VERSION >= 0x020616
-# define __ASSUME_PRIVATE_FUTEX	1
-#endif
+#define __ASSUME_PRIVATE_FUTEX	1
 
 /* Support for fallocate was added in 2.6.23, on s390
    only after 2.6.23-rc1.  */
-#if __LINUX_KERNEL_VERSION >= 0x020617 \
-    && (!defined __s390__ || __LINUX_KERNEL_VERSION >= 0x020618)
-# define __ASSUME_FALLOCATE	1
-#endif
+#define __ASSUME_FALLOCATE	1
 
 /* Support for various CLOEXEC and NONBLOCK flags was added for x86,
    x86-64, PPC, IA-64, SPARC< and S390 in 2.6.23.  */
-#if __LINUX_KERNEL_VERSION >= 0x020617 \
-    && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
-	|| defined __sparc__ || defined __s390__)
+#if (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
+     || defined __sparc__ || defined __s390__)
 # define __ASSUME_O_CLOEXEC	1
 #endif
 
-/* From 2.6.23 onwards the value of ARG_MAX depends on the stack
-   size.  */
-#define __LINUX_ARG_MAX_STACK_BASED_MIN_KERNEL	0x020617
-#if __LINUX_KERNEL_VERSION >= __LINUX_ARG_MAX_STACK_BASED_MIN_KERNEL
-# define __ASSUME_ARG_MAX_STACK_BASED	1
-#endif
-
 /* Support for ADJ_OFFSET_SS_READ was added in 2.6.24.  */
-#if __LINUX_KERNEL_VERSION >= 0x020618
-# define __ASSUME_ADJ_OFFSET_SS_READ	1
-#endif
+#define __ASSUME_ADJ_OFFSET_SS_READ	1
 
 /* Support for various CLOEXEC and NONBLOCK flags was added for x86,
    x86-64, PPC, IA-64, and SPARC in 2.6.27.  */
-#if __LINUX_KERNEL_VERSION >= 0x02061b \
-    && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
-	|| defined __sparc__ || defined __s390__)
+#if (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
+     || defined __sparc__ || defined __s390__)
 # define __ASSUME_SOCK_CLOEXEC	1
 # define __ASSUME_IN_NONBLOCK	1
 # define __ASSUME_PIPE2		1
@@ -192,14 +156,13 @@
    available through a separate syscall at the same time as through
    socketcall, and __ASSUME_ACCEPT4 if the accept4 function is known
    to work.  */
-#if __LINUX_KERNEL_VERSION >= 0x02061c && defined __ASSUME_SOCKETCALL
+#ifdef __ASSUME_SOCKETCALL
 # define __ASSUME_ACCEPT4_SOCKETCALL	1
 #endif
 
 /* The accept4 syscall was added for x86_64 and SPARC in 2.6.28, and
    for PowerPC and SH in 2.6.37.  */
-#if (__LINUX_KERNEL_VERSION >= 0x02061c			\
-     && (defined __x86_64__ || defined __sparc__))	\
+#if (defined __x86_64__ || defined __sparc__)		\
     || (__LINUX_KERNEL_VERSION >= 0x020625		\
 	&& (defined __powerpc__ || defined __sh__))
 # define __ASSUME_ACCEPT4_SYSCALL	1
@@ -213,33 +176,24 @@
 #endif
 
 /* Support for the FUTEX_CLOCK_REALTIME flag was added in 2.6.29.  */
-#if __LINUX_KERNEL_VERSION >= 0x02061d
-# define __ASSUME_FUTEX_CLOCK_REALTIME	1
-#endif
+#define __ASSUME_FUTEX_CLOCK_REALTIME	1
 
 /* Support for the AT_RANDOM auxiliary vector entry was added in 2.6.29.  */
-#if __LINUX_KERNEL_VERSION >= 0x02061d
-# define __ASSUME_AT_RANDOM	1
-#endif
+#define __ASSUME_AT_RANDOM	1
 
 /* Support for preadv and pwritev was added in 2.6.30.  */
-#if __LINUX_KERNEL_VERSION >= 0x02061e
-# define __ASSUME_PREADV	1
-# define __ASSUME_PWRITEV	1
-#endif
+#define __ASSUME_PREADV	1
+#define __ASSUME_PWRITEV	1
 
 /* Support for FUTEX_*_REQUEUE_PI was added in 2.6.31 (but some
    architectures lack futex_atomic_cmpxchg_inatomic in some
    configurations).  */
-#if __LINUX_KERNEL_VERSION >= 0x02061f \
-    && !(defined __sparc__ && !defined __arch64__ && !defined __sparc_v9__)
+#if !(defined __sparc__ && !defined __arch64__ && !defined __sparc_v9__)
 # define __ASSUME_REQUEUE_PI	1
 #endif
 
 /* Support for F_GETOWN_EX was introduced in 2.6.32.  */
-#if __LINUX_KERNEL_VERSION >= 0x020620
-# define __ASSUME_F_GETOWN_EX	1
-#endif
+#define __ASSUME_F_GETOWN_EX	1
 
 /* Support for recvmmsg functionality was added in 2.6.33.  The macros
    defined correspond to those for accept4.  */
@@ -308,6 +262,4 @@
 
 /* 2.6.29 removed the XFS restricted_chown sysctl, so it is pointless looking
    for it in newer kernels.  */
-#if __LINUX_KERNEL_VERSION >= 0x02061d
-# define __ASSUME_XFS_RESTRICTED_CHOWN 1
-#endif
+#define __ASSUME_XFS_RESTRICTED_CHOWN 1