Adjust kernel-features.h defaults for socket syscalls.
commit35ade9f11b9007ee9683529f2d33698ff35255c8
authorJoseph Myers <joseph@codesourcery.com>
Tue, 15 Mar 2016 21:09:33 +0000 (15 21:09 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 15 Mar 2016 21:09:33 +0000 (15 21:09 +0000)
tree78f284d9abd52c36ae8fab5aaeb8568a4af85015
parent5e7fdabd7df1fc6c56d104e61390bf5a6b526c38
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.
18 files changed:
ChangeLog
sysdeps/unix/sysv/linux/aarch64/kernel-features.h [deleted file]
sysdeps/unix/sysv/linux/alpha/kernel-features.h
sysdeps/unix/sysv/linux/arm/kernel-features.h
sysdeps/unix/sysv/linux/hppa/kernel-features.h
sysdeps/unix/sysv/linux/i386/kernel-features.h
sysdeps/unix/sysv/linux/ia64/kernel-features.h
sysdeps/unix/sysv/linux/kernel-features.h
sysdeps/unix/sysv/linux/m68k/kernel-features.h
sysdeps/unix/sysv/linux/microblaze/kernel-features.h
sysdeps/unix/sysv/linux/mips/kernel-features.h
sysdeps/unix/sysv/linux/nios2/kernel-features.h [deleted file]
sysdeps/unix/sysv/linux/powerpc/kernel-features.h
sysdeps/unix/sysv/linux/s390/kernel-features.h
sysdeps/unix/sysv/linux/sh/kernel-features.h
sysdeps/unix/sysv/linux/sparc/kernel-features.h
sysdeps/unix/sysv/linux/tile/kernel-features.h
sysdeps/unix/sysv/linux/x86_64/kernel-features.h