aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2016-03-15 21:09:33 +0000
committerJoseph Myers <joseph@codesourcery.com>2016-03-15 21:09:33 +0000
commit35ade9f11b9007ee9683529f2d33698ff35255c8 (patch)
tree78f284d9abd52c36ae8fab5aaeb8568a4af85015
parent5e7fdabd7df1fc6c56d104e61390bf5a6b526c38 (diff)
downloadglibc-35ade9f11b9007ee9683529f2d33698ff35255c8.zip
glibc-35ade9f11b9007ee9683529f2d33698ff35255c8.tar.gz
glibc-35ade9f11b9007ee9683529f2d33698ff35255c8.tar.bz2
Adjust kernel-features.h defaults for socket syscalls.
This patch adjusts the defaults for kernel-features.h macros relating to availability of accept4, recvmmsg and sendmmsg. It is not intended to affect which macros end up getting defined in any configuration. At present, all architectures with syscalls for those functions need to define __ASSUME_*_SYSCALL macros; in particular, any new architecture needs its own kernel-features.h file for that purpose, though it may not otherwise need such a header. Those macros are then used together with __ASSUME_SOCKETCALL to define macros for whether the functions in question are available. This patch changes the defaults so that the syscalls are assumed to be available by default with recent-enough kernels, and it is the responsibility of architecture headers to undefine the macros if they are unavailable in supported kernels at least as recent as the version where the architecture-independent functionality was introduced. The __ASSUME_<function> macros are defaulted similarly instead of being defined based on other macros (defining based on other macros would no longer work because the #undefs appear after the generic header is included), so where the syscall being unavailable means the function is unavailable this means the architecture header has to undefine the __ASSUME_<function> macro; this only affects __ASSUME_ACCEPT4 for ia64, as other cases where the syscalls were added late enough to be relevant with current kernel version requirements are all on socketcall architectures. As a consequence, the AArch64 and Nios II kernel-features.h header files are removed, and others simplified. When the minimum kernel version becomes 4.3 or later on all architectures, the syscalls in question can just be assumed unconditionally, permitting further simplification. Tested for x86_64, x86 and powerpc (that installed shared libraries are unchanged by the patch, and testsuite for x86_64 and x86). * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_ACCEPT4_SYSCALL): Define unconditionally. (__ASSUME_ACCEPT4): Likewise. [__LINUX_KERNEL_VERSION >= 0x020621] (__ASSUME_RECVMMSG_SYSCALL): Define. [__LINUX_KERNEL_VERSION >= 0x020621] (__ASSUME_RECVMMSG): Likewise. [__LINUX_KERNEL_VERSION >= 0x030000] (__ASSUME_SENDMMSG_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x030000] (__ASSUME_SENDMMSG): Likewise. * sysdeps/unix/sysv/linux/aarch64/kernel-features.h: Remove file. * sysdeps/unix/sysv/linux/nios2/kernel-features.h: Likewise. * sysdeps/unix/sysv/linux/alpha/kernel-features.h (__ASSUME_RECVMMSG_SYSCALL): Do not define. (__ASSUME_ACCEPT4_SYSCALL): Likewise. (__ASSUME_SENDMMSG_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/arm/kernel-features.h (__ASSUME_RECVMMSG_SYSCALL): Likewise. (__ASSUME_ACCEPT4_SYSCALL): Likewise. (__ASSUME_SENDMMSG_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/hppa/kernel-features.h (__ASSUME_ACCEPT4_SYSCALL): Likewise. (__ASSUME_RECVMMSG_SYSCALL): Likewise. (__ASSUME_SENDMMSG_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/i386/kernel-features.h [__LINUX_KERNEL_VERSION >= 0x020621] (__ASSUME_RECVMMSG_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x030000] (__ASSUME_SENDMMSG_SYSCALL): Likewise. (__ASSUME_ACCEPT4_SYSCALL): Undefine if [__LINUX_KERNEL_VERSION < 0x040300] instead of defining if [__LINUX_KERNEL_VERSION >= 0x040300]. * sysdeps/unix/sysv/linux/ia64/kernel-features.h (__ASSUME_RECVMMSG_SYSCALL): Do not define. (__ASSUME_SENDMMSG_SYSCALL): Likewise. (__ASSUME_ACCEPT4_SYSCALL): Undefine if [__LINUX_KERNEL_VERSION < 0x030300] instead of defining if [__LINUX_KERNEL_VERSION >= 0x030300]. [__LINUX_KERNEL_VERSION < 0x030300] (__ASSUME_ACCEPT4): Undefine. * sysdeps/unix/sysv/linux/m68k/kernel-features.h (__ASSUME_ACCEPT4_SYSCALL): Undefine if [__LINUX_KERNEL_VERSION < 0x040300] instead of defining if [__LINUX_KERNEL_VERSION >= 0x040300]. (__ASSUME_RECVMMSG_SYSCALL): Likewise. (__ASSUME_SENDMMSG_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/microblaze/kernel-features.h (__ASSUME_ACCEPT4_SYSCALL): Do not define. (__ASSUME_RECVMMSG_SYSCALL): Likewise. (__ASSUME_SENDMMSG_SYSCALL): Undefine if [__LINUX_KERNEL_VERSION < 0x030300] instead of defining if [__LINUX_KERNEL_VERSION >= 0x030300]. * sysdeps/unix/sysv/linux/mips/kernel-features.h (__ASSUME_ACCEPT4_SYSCALL): Do not define. (__ASSUME_RECVMMSG_SYSCALL): Likewise. (__ASSUME_SENDMMSG_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/powerpc/kernel-features.h (__ASSUME_ACCEPT4_SYSCALL): Likewise. (__ASSUME_RECVMMSG_SYSCALL): Likewise. (__ASSUME_SENDMMSG_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/s390/kernel-features.h (__ASSUME_ACCEPT4_SYSCALL): Undefine if [__LINUX_KERNEL_VERSION < 0x040300] instead of defining if [__LINUX_KERNEL_VERSION >= 0x040300]. (__ASSUME_RECVMMSG_SYSCALL): Likewise. (__ASSUME_SENDMMSG_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/sh/kernel-features.h (__ASSUME_ACCEPT4_SYSCALL): Do not define. (__ASSUME_RECVMMSG_SYSCALL): Likewise. (__ASSUME_SENDMMSG_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/sparc/kernel-features.h (__ASSUME_ACCEPT4_SYSCALL): Likewise. (__ASSUME_RECVMMSG_SYSCALL): Likewise. (__ASSUME_SENDMMSG_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/tile/kernel-features.h (__ASSUME_ACCEPT4_SYSCALL): Likewise. (__ASSUME_RECVMMSG_SYSCALL): Likewise. (__ASSUME_SENDMMSG_SYSCALL): Likewise. * sysdeps/unix/sysv/linux/x86_64/kernel-features.h (__ASSUME_ACCEPT4_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x020621] (__ASSUME_RECVMMSG_SYSCALL): Likewise. [__LINUX_KERNEL_VERSION >= 0x030000] (__ASSUME_SENDMMSG_SYSCALL): Likewise.
-rw-r--r--ChangeLog87
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/kernel-features.h31
-rw-r--r--sysdeps/unix/sysv/linux/alpha/kernel-features.h7
-rw-r--r--sysdeps/unix/sysv/linux/arm/kernel-features.h9
-rw-r--r--sysdeps/unix/sysv/linux/hppa/kernel-features.h7
-rw-r--r--sysdeps/unix/sysv/linux/i386/kernel-features.h11
-rw-r--r--sysdeps/unix/sysv/linux/ia64/kernel-features.h13
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h26
-rw-r--r--sysdeps/unix/sysv/linux/m68k/kernel-features.h9
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/kernel-features.h12
-rw-r--r--sysdeps/unix/sysv/linux/mips/kernel-features.h9
-rw-r--r--sysdeps/unix/sysv/linux/nios2/kernel-features.h31
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/kernel-features.h7
-rw-r--r--sysdeps/unix/sysv/linux/s390/kernel-features.h9
-rw-r--r--sysdeps/unix/sysv/linux/sh/kernel-features.h7
-rw-r--r--sysdeps/unix/sysv/linux/sparc/kernel-features.h3
-rw-r--r--sysdeps/unix/sysv/linux/tile/kernel-features.h7
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/kernel-features.h13
18 files changed, 124 insertions, 174 deletions
diff --git a/ChangeLog b/ChangeLog
index a38c643..251a8dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,90 @@
+2016-03-15 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/kernel-features.h
+ (__ASSUME_ACCEPT4_SYSCALL): Define unconditionally.
+ (__ASSUME_ACCEPT4): Likewise.
+ [__LINUX_KERNEL_VERSION >= 0x020621] (__ASSUME_RECVMMSG_SYSCALL):
+ Define.
+ [__LINUX_KERNEL_VERSION >= 0x020621] (__ASSUME_RECVMMSG):
+ Likewise.
+ [__LINUX_KERNEL_VERSION >= 0x030000] (__ASSUME_SENDMMSG_SYSCALL):
+ Likewise.
+ [__LINUX_KERNEL_VERSION >= 0x030000] (__ASSUME_SENDMMSG):
+ Likewise.
+ * sysdeps/unix/sysv/linux/aarch64/kernel-features.h: Remove file.
+ * sysdeps/unix/sysv/linux/nios2/kernel-features.h: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/kernel-features.h
+ (__ASSUME_RECVMMSG_SYSCALL): Do not define.
+ (__ASSUME_ACCEPT4_SYSCALL): Likewise.
+ (__ASSUME_SENDMMSG_SYSCALL): Likewise.
+ * sysdeps/unix/sysv/linux/arm/kernel-features.h
+ (__ASSUME_RECVMMSG_SYSCALL): Likewise.
+ (__ASSUME_ACCEPT4_SYSCALL): Likewise.
+ (__ASSUME_SENDMMSG_SYSCALL): Likewise.
+ * sysdeps/unix/sysv/linux/hppa/kernel-features.h
+ (__ASSUME_ACCEPT4_SYSCALL): Likewise.
+ (__ASSUME_RECVMMSG_SYSCALL): Likewise.
+ (__ASSUME_SENDMMSG_SYSCALL): Likewise.
+ * sysdeps/unix/sysv/linux/i386/kernel-features.h
+ [__LINUX_KERNEL_VERSION >= 0x020621] (__ASSUME_RECVMMSG_SYSCALL):
+ Likewise.
+ [__LINUX_KERNEL_VERSION >= 0x030000] (__ASSUME_SENDMMSG_SYSCALL):
+ Likewise.
+ (__ASSUME_ACCEPT4_SYSCALL): Undefine if [__LINUX_KERNEL_VERSION <
+ 0x040300] instead of defining if [__LINUX_KERNEL_VERSION >=
+ 0x040300].
+ * sysdeps/unix/sysv/linux/ia64/kernel-features.h
+ (__ASSUME_RECVMMSG_SYSCALL): Do not define.
+ (__ASSUME_SENDMMSG_SYSCALL): Likewise.
+ (__ASSUME_ACCEPT4_SYSCALL): Undefine if [__LINUX_KERNEL_VERSION <
+ 0x030300] instead of defining if [__LINUX_KERNEL_VERSION >=
+ 0x030300].
+ [__LINUX_KERNEL_VERSION < 0x030300] (__ASSUME_ACCEPT4): Undefine.
+ * sysdeps/unix/sysv/linux/m68k/kernel-features.h
+ (__ASSUME_ACCEPT4_SYSCALL): Undefine if [__LINUX_KERNEL_VERSION <
+ 0x040300] instead of defining if [__LINUX_KERNEL_VERSION >=
+ 0x040300].
+ (__ASSUME_RECVMMSG_SYSCALL): Likewise.
+ (__ASSUME_SENDMMSG_SYSCALL): Likewise.
+ * sysdeps/unix/sysv/linux/microblaze/kernel-features.h
+ (__ASSUME_ACCEPT4_SYSCALL): Do not define.
+ (__ASSUME_RECVMMSG_SYSCALL): Likewise.
+ (__ASSUME_SENDMMSG_SYSCALL): Undefine if [__LINUX_KERNEL_VERSION <
+ 0x030300] instead of defining if [__LINUX_KERNEL_VERSION >=
+ 0x030300].
+ * sysdeps/unix/sysv/linux/mips/kernel-features.h
+ (__ASSUME_ACCEPT4_SYSCALL): Do not define.
+ (__ASSUME_RECVMMSG_SYSCALL): Likewise.
+ (__ASSUME_SENDMMSG_SYSCALL): Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/kernel-features.h
+ (__ASSUME_ACCEPT4_SYSCALL): Likewise.
+ (__ASSUME_RECVMMSG_SYSCALL): Likewise.
+ (__ASSUME_SENDMMSG_SYSCALL): Likewise.
+ * sysdeps/unix/sysv/linux/s390/kernel-features.h
+ (__ASSUME_ACCEPT4_SYSCALL): Undefine if [__LINUX_KERNEL_VERSION <
+ 0x040300] instead of defining if [__LINUX_KERNEL_VERSION >=
+ 0x040300].
+ (__ASSUME_RECVMMSG_SYSCALL): Likewise.
+ (__ASSUME_SENDMMSG_SYSCALL): Likewise.
+ * sysdeps/unix/sysv/linux/sh/kernel-features.h
+ (__ASSUME_ACCEPT4_SYSCALL): Do not define.
+ (__ASSUME_RECVMMSG_SYSCALL): Likewise.
+ (__ASSUME_SENDMMSG_SYSCALL): Likewise.
+ * sysdeps/unix/sysv/linux/sparc/kernel-features.h
+ (__ASSUME_ACCEPT4_SYSCALL): Likewise.
+ (__ASSUME_RECVMMSG_SYSCALL): Likewise.
+ (__ASSUME_SENDMMSG_SYSCALL): Likewise.
+ * sysdeps/unix/sysv/linux/tile/kernel-features.h
+ (__ASSUME_ACCEPT4_SYSCALL): Likewise.
+ (__ASSUME_RECVMMSG_SYSCALL): Likewise.
+ (__ASSUME_SENDMMSG_SYSCALL): Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/kernel-features.h
+ (__ASSUME_ACCEPT4_SYSCALL): Likewise.
+ [__LINUX_KERNEL_VERSION >= 0x020621] (__ASSUME_RECVMMSG_SYSCALL):
+ Likewise.
+ [__LINUX_KERNEL_VERSION >= 0x030000] (__ASSUME_SENDMMSG_SYSCALL):
+ Likewise.
+
2016-03-15 Andreas Schwab <schwab@suse.de>
[BZ #19257]
diff --git a/sysdeps/unix/sysv/linux/aarch64/kernel-features.h b/sysdeps/unix/sysv/linux/aarch64/kernel-features.h
deleted file mode 100644
index 556ba73..0000000
--- a/sysdeps/unix/sysv/linux/aarch64/kernel-features.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Set flags signalling availability of kernel features based on given
- kernel version number.
-
- Copyright (C) 2009-2016 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
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <linux/version.h>
-
-/* AArch64 support starts with 3.7.0, guaranteeing many kernel
- features. */
-
-#define __ASSUME_ACCEPT4_SYSCALL 1
-#define __ASSUME_RECVMMSG_SYSCALL 1
-#define __ASSUME_SENDMMSG_SYSCALL 1
-
-#include_next <kernel-features.h>
diff --git a/sysdeps/unix/sysv/linux/alpha/kernel-features.h b/sysdeps/unix/sysv/linux/alpha/kernel-features.h
index d7a29db..732749e 100644
--- a/sysdeps/unix/sysv/linux/alpha/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/alpha/kernel-features.h
@@ -20,13 +20,6 @@
#ifndef _KERNEL_FEATURES_H
#define _KERNEL_FEATURES_H 1
-/* Support for recvmmsg was added for alpha in 2.6.33. */
-#define __ASSUME_RECVMMSG_SYSCALL 1
-
-/* Support for accept4 and sendmmsg was added for alpha in 3.2. */
-#define __ASSUME_ACCEPT4_SYSCALL 1
-#define __ASSUME_SENDMMSG_SYSCALL 1
-
#include_next <kernel-features.h>
#undef __ASSUME_ST_INO_64_BIT
diff --git a/sysdeps/unix/sysv/linux/arm/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h
index a97d4e2..c04c4e2 100644
--- a/sysdeps/unix/sysv/linux/arm/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h
@@ -17,15 +17,6 @@
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
-/* Support for the recvmmsg syscall was added in 2.6.33. */
-#define __ASSUME_RECVMMSG_SYSCALL 1
-
-/* Support for the accept4 syscall was added in 2.6.36. */
-#define __ASSUME_ACCEPT4_SYSCALL 1
-
-/* Support for the sendmmsg syscall was added in 3.0. */
-#define __ASSUME_SENDMMSG_SYSCALL 1
-
#include_next <kernel-features.h>
/* The ARM kernel before 3.14.3 may or may not support
diff --git a/sysdeps/unix/sysv/linux/hppa/kernel-features.h b/sysdeps/unix/sysv/linux/hppa/kernel-features.h
index d0b4893..f861027 100644
--- a/sysdeps/unix/sysv/linux/hppa/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/hppa/kernel-features.h
@@ -18,13 +18,6 @@
<http://www.gnu.org/licenses/>. */
-/* Support for the accept4 and recvmmsg syscalls was added in 2.6.34. */
-#define __ASSUME_ACCEPT4_SYSCALL 1
-#define __ASSUME_RECVMMSG_SYSCALL 1
-
-/* Support for the sendmmsg syscall was added in 3.1. */
-#define __ASSUME_SENDMMSG_SYSCALL 1
-
/* Support for the utimes syscall was added in 3.14. */
#if __LINUX_KERNEL_VERSION >= 0x030e00
# define __ASSUME_UTIMES 1
diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h
index 4f5e0a4..45054f8 100644
--- a/sysdeps/unix/sysv/linux/i386/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h
@@ -21,15 +21,9 @@
#define __ASSUME_SOCKETCALL 1
/* The recvmmsg syscall was added for i386 in 2.6.33. */
-#if __LINUX_KERNEL_VERSION >= 0x020621
-# define __ASSUME_RECVMMSG_SYSCALL 1
-#endif
#define __ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL 1
/* The sendmmsg syscall was added for i386 in 3.0. */
-#if __LINUX_KERNEL_VERSION >= 0x030000
-# define __ASSUME_SENDMMSG_SYSCALL 1
-#endif
#define __ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL 1
/* Direct socketcalls available with kernel 4.3. */
@@ -39,7 +33,6 @@
# define __ASSUME_BIND_SYSCALL 1
# define __ASSUME_CONNECT_SYSCALL 1
# define __ASSUME_LISTEN_SYSCALL 1
-# define __ASSUME_ACCEPT4_SYSCALL 1
# define __ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL 1
# define __ASSUME_GETSOCKOPT_SYSCALL 1
# define __ASSUME_SETSOCKOPT_SYSCALL 1
@@ -55,3 +48,7 @@
#endif
#include_next <kernel-features.h>
+
+#if __LINUX_KERNEL_VERSION < 0x040300
+# undef __ASSUME_ACCEPT4_SYSCALL
+#endif
diff --git a/sysdeps/unix/sysv/linux/ia64/kernel-features.h b/sysdeps/unix/sysv/linux/ia64/kernel-features.h
index b238322..c0c936b 100644
--- a/sysdeps/unix/sysv/linux/ia64/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/ia64/kernel-features.h
@@ -20,17 +20,12 @@
#ifndef _KERNEL_FEATURES_H
#define _KERNEL_FEATURES_H 1
-/* Support for the recvmmsg syscall was added in 2.6.33. */
-#define __ASSUME_RECVMMSG_SYSCALL 1
-
-/* Support for the sendmmsg syscall was added in 3.0. */
-#define __ASSUME_SENDMMSG_SYSCALL 1
+#include_next <kernel-features.h>
/* Support for the accept4 syscall was added in 3.3. */
-#if __LINUX_KERNEL_VERSION >= 0x030300
-# define __ASSUME_ACCEPT4_SYSCALL 1
+#if __LINUX_KERNEL_VERSION < 0x030300
+# undef __ASSUME_ACCEPT4_SYSCALL
+# undef __ASSUME_ACCEPT4
#endif
-#include_next <kernel-features.h>
-
#endif /* _KERNEL_FEATURES_H */
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index 9832f41..4411503 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -106,10 +106,8 @@
#ifdef __ASSUME_SOCKETCALL
# define __ASSUME_ACCEPT4_SOCKETCALL 1
#endif
-
-#if defined __ASSUME_ACCEPT4_SOCKETCALL || defined __ASSUME_ACCEPT4_SYSCALL
-# define __ASSUME_ACCEPT4 1
-#endif
+#define __ASSUME_ACCEPT4_SYSCALL 1
+#define __ASSUME_ACCEPT4 1
/* Support for the FUTEX_CLOCK_REALTIME flag was added in 2.6.29. */
#define __ASSUME_FUTEX_CLOCK_REALTIME 1
@@ -125,11 +123,11 @@
/* Support for recvmmsg functionality was added in 2.6.33. The macros
defined correspond to those for accept4. */
-#if __LINUX_KERNEL_VERSION >= 0x020621 && defined __ASSUME_SOCKETCALL
-# define __ASSUME_RECVMMSG_SOCKETCALL 1
-#endif
-
-#if defined __ASSUME_RECVMMSG_SOCKETCALL || defined __ASSUME_RECVMMSG_SYSCALL
+#if __LINUX_KERNEL_VERSION >= 0x020621
+# ifdef __ASSUME_SOCKETCALL
+# define __ASSUME_RECVMMSG_SOCKETCALL 1
+# endif
+# define __ASSUME_RECVMMSG_SYSCALL 1
# define __ASSUME_RECVMMSG 1
#endif
@@ -151,10 +149,10 @@
/* Support for sendmmsg functionality was added in 3.0. The macros
defined correspond to those for accept4 and recvmmsg. */
-#if __LINUX_KERNEL_VERSION >= 0x030000 && defined __ASSUME_SOCKETCALL
-# define __ASSUME_SENDMMSG_SOCKETCALL 1
-#endif
-
-#if defined __ASSUME_SENDMMSG_SOCKETCALL || defined __ASSUME_SENDMMSG_SYSCALL
+#if __LINUX_KERNEL_VERSION >= 0x030000
+# ifdef __ASSUME_SOCKETCALL
+# define __ASSUME_SENDMMSG_SOCKETCALL 1
+# endif
+# define __ASSUME_SENDMMSG_SYSCALL 1
# define __ASSUME_SENDMMSG 1
#endif
diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
index 7bce07e..646bc4b 100644
--- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
@@ -22,14 +22,11 @@
/* Direct socketcalls available with kernel 4.3. */
#if __LINUX_KERNEL_VERSION >= 0x040300
-# define __ASSUME_RECVMMSG_SYSCALL 1
-# define __ASSUME_SENDMMSG_SYSCALL 1
# define __ASSUME_SOCKET_SYSCALL 1
# define __ASSUME_SOCKETPAIR_SYSCALL 1
# define __ASSUME_BIND_SYSCALL 1
# define __ASSUME_CONNECT_SYSCALL 1
# define __ASSUME_LISTEN_SYSCALL 1
-# define __ASSUME_ACCEPT4_SYSCALL 1
# define __ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL 1
# define __ASSUME_GETSOCKOPT_SYSCALL 1
# define __ASSUME_SETSOCKOPT_SYSCALL 1
@@ -46,6 +43,12 @@
#include_next <kernel-features.h>
+#if __LINUX_KERNEL_VERSION < 0x040300
+# undef __ASSUME_ACCEPT4_SYSCALL
+# undef __ASSUME_RECVMMSG_SYSCALL
+# undef __ASSUME_SENDMMSG_SYSCALL
+#endif
+
/* No support for PI futexes or robust mutexes before 3.10 for m68k. */
#if __LINUX_KERNEL_VERSION < 0x030a00
# undef __ASSUME_FUTEX_LOCK_PI
diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
index 8757b5a..3938989 100644
--- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
@@ -39,15 +39,8 @@
#define __ASSUME_RECVMSG_SYSCALL 1
/* Support for the accept4 and recvmmsg syscalls was added in 2.6.33. */
-#define __ASSUME_ACCEPT4_SYSCALL 1
-#define __ASSUME_RECVMMSG_SYSCALL 1
#define __ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL 1
-/* Support for the sendmmsg syscall was added in 3.3. */
-#if __LINUX_KERNEL_VERSION >= 0x030300
-# define __ASSUME_SENDMMSG_SYSCALL 1
-#endif
-
/* Support for the futimesat syscall was added in 2.6.33. */
#define __ASSUME_FUTIMESAT 1
@@ -60,3 +53,8 @@
# undef __ASSUME_PREADV
# undef __ASSUME_PWRITEV
#endif
+
+/* Support for the sendmmsg syscall was added in 3.3. */
+#if __LINUX_KERNEL_VERSION < 0x030300
+# undef __ASSUME_SENDMMSG_SYSCALL
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h
index 702c357..7f8c98a 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h
@@ -19,15 +19,6 @@
#include <sgidefs.h>
-/* Support for the accept4 syscall was added in 2.6.31. */
-#define __ASSUME_ACCEPT4_SYSCALL 1
-
-/* Support for the recvmmsg syscall was added in 2.6.33. */
-#define __ASSUME_RECVMMSG_SYSCALL 1
-
-/* Support for the sendmmsg syscall was added in 3.1. */
-#define __ASSUME_SENDMMSG_SYSCALL 1
-
#include_next <kernel-features.h>
/* The MIPS kernel does not support futex_atomic_cmpxchg_inatomic if
diff --git a/sysdeps/unix/sysv/linux/nios2/kernel-features.h b/sysdeps/unix/sysv/linux/nios2/kernel-features.h
deleted file mode 100644
index c90df5d..0000000
--- a/sysdeps/unix/sysv/linux/nios2/kernel-features.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Set flags signalling availability of kernel features based on given
- kernel version number.
-
- Copyright (C) 2009-2016 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
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <linux/version.h>
-
-/* The minimum supported kernel version for Nios II is 3.19.0,
- guaranteeing many kernel features. */
-
-#define __ASSUME_ACCEPT4_SYSCALL 1
-#define __ASSUME_RECVMMSG_SYSCALL 1
-#define __ASSUME_SENDMMSG_SYSCALL 1
-
-#include_next <kernel-features.h>
diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
index fa3e7ef..171c030 100644
--- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
@@ -20,12 +20,6 @@
/* PowerPC uses socketcall. */
#define __ASSUME_SOCKETCALL 1
-/* The accept4 syscall was added for PowerPC in 2.6.37. */
-#define __ASSUME_ACCEPT4_SYSCALL 1
-
-/* The recvmmsg syscall was added for PowerPC in 2.6.37. */
-#define __ASSUME_RECVMMSG_SYSCALL 1
-
/* New syscalls added for PowerPC in 2.6.37. */
#define __ASSUME_SOCKET_SYSCALL 1
#define __ASSUME_BIND_SYSCALL 1
@@ -46,7 +40,6 @@
#define __ASSUME_RECVMSG_SYSCALL 1
/* The sendmmsg syscall was added for PowerPC in 3.0. */
-#define __ASSUME_SENDMMSG_SYSCALL 1
#define __ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL 1
#include_next <kernel-features.h>
diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h
index b810542..a6f131b 100644
--- a/sysdeps/unix/sysv/linux/s390/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h
@@ -22,14 +22,11 @@
/* Direct socketcalls available with kernel 4.3. */
#if __LINUX_KERNEL_VERSION >= 0x040300
-# define __ASSUME_RECVMMSG_SYSCALL 1
-# define __ASSUME_SENDMMSG_SYSCALL 1
# define __ASSUME_SOCKET_SYSCALL 1
# define __ASSUME_SOCKETPAIR_SYSCALL 1
# define __ASSUME_BIND_SYSCALL 1
# define __ASSUME_CONNECT_SYSCALL 1
# define __ASSUME_LISTEN_SYSCALL 1
-# define __ASSUME_ACCEPT4_SYSCALL 1
# define __ASSUME_ACCEPT4_FOR_ACCEPT_SYSCALL 1
# define __ASSUME_GETSOCKOPT_SYSCALL 1
# define __ASSUME_SETSOCKOPT_SYSCALL 1
@@ -45,3 +42,9 @@
#endif
#include_next <kernel-features.h>
+
+#if __LINUX_KERNEL_VERSION < 0x040300
+# undef __ASSUME_ACCEPT4_SYSCALL
+# undef __ASSUME_RECVMMSG_SYSCALL
+# undef __ASSUME_SENDMMSG_SYSCALL
+#endif
diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h
index f9bc6f2..9b4d1c2 100644
--- a/sysdeps/unix/sysv/linux/sh/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h
@@ -39,14 +39,7 @@
#define __ASSUME_SENDMSG_SYSCALL 1
#define __ASSUME_RECVMSG_SYSCALL 1
-/* The accept4 syscall was added for SH in 2.6.37. */
-#define __ASSUME_ACCEPT4_SYSCALL 1
-
-/* The recvmmsg syscall was added for SH in 2.6.37. */
-#define __ASSUME_RECVMMSG_SYSCALL 1
-
/* The sendmmsg syscall was added for SH in 3.0. */
-#define __ASSUME_SENDMMSG_SYSCALL 1
#define __ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL 1
#include_next <kernel-features.h>
diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
index 3a7baa7..386f230 100644
--- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
@@ -21,15 +21,12 @@
#define __ASSUME_SOCKETCALL 1
/* The accept4 syscall was added for SPARC in 2.6.28. */
-#define __ASSUME_ACCEPT4_SYSCALL 1
#define __ASSUME_ACCEPT4_SYSCALL_WITH_SOCKETCALL 1
/* The recvmmsg syscall was added for SPARC in 2.6.33. */
-#define __ASSUME_RECVMMSG_SYSCALL 1
#define __ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL 1
/* The sendmmsg syscall was added for SPARC in 3.0. */
-#define __ASSUME_SENDMMSG_SYSCALL 1
#define __ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL 1
#include_next <kernel-features.h>
diff --git a/sysdeps/unix/sysv/linux/tile/kernel-features.h b/sysdeps/unix/sysv/linux/tile/kernel-features.h
index 4c48c67..7511f77 100644
--- a/sysdeps/unix/sysv/linux/tile/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/tile/kernel-features.h
@@ -17,13 +17,6 @@
<http://www.gnu.org/licenses/>. */
-/* TILE glibc support starts with 2.6.36, guaranteeing many kernel features. */
-#define __ASSUME_ACCEPT4_SYSCALL 1
-#define __ASSUME_RECVMMSG_SYSCALL 1
-
-/* Support for the sendmmsg syscall was added in 3.0. */
-#define __ASSUME_SENDMMSG_SYSCALL 1
-
#include_next <kernel-features.h>
/* Define this if your 32-bit syscall API requires 64-bit register
diff --git a/sysdeps/unix/sysv/linux/x86_64/kernel-features.h b/sysdeps/unix/sysv/linux/x86_64/kernel-features.h
index 0b84f11..9491c3e 100644
--- a/sysdeps/unix/sysv/linux/x86_64/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/x86_64/kernel-features.h
@@ -17,19 +17,6 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-/* The accept4 syscall was added for x86-64 in 2.6.28. */
-#define __ASSUME_ACCEPT4_SYSCALL 1
-
-/* The recvmmsg syscall was added for x86-64 in 2.6.33. */
-#if __LINUX_KERNEL_VERSION >= 0x020621
-# define __ASSUME_RECVMMSG_SYSCALL 1
-#endif
-
-/* The sendmmsg syscall was added for x86-64 in 3.0. */
-#if __LINUX_KERNEL_VERSION >= 0x030000
-# define __ASSUME_SENDMMSG_SYSCALL 1
-#endif
-
/* getcpu is a syscall for x86-64 since 3.1. */
#if __LINUX_KERNEL_VERSION >= 0x030100
# define __ASSUME_GETCPU_SYSCALL 1