Linux: Assume and consolidate shutdown wire-up syscall
[glibc.git] / sysdeps / unix / sysv / linux / sparc / kernel-features.h
blob12e98a9f9524df8b4daff2ffa92bc77c8cc9c769
1 /* Set flags signalling availability of kernel features based on given
2 kernel version number. SPARC version.
3 Copyright (C) 1999-2022 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <https://www.gnu.org/licenses/>. */
20 #include_next <kernel-features.h>
22 /* 32-bit SPARC kernels do not support
23 futex_atomic_cmpxchg_inatomic. */
24 #if !defined __arch64__ && !defined __sparc_v9__
25 # undef __ASSUME_SET_ROBUST_LIST
26 #endif
28 /* These syscalls were added for 32-bit in 4.4 (but present for 64-bit
29 in all supported kernel versions); the architecture-independent
30 kernel-features.h assumes some of them to be present by default.
31 getpeername and getsockname syscalls were also added for 32-bit in
32 4.4, but only for 32-bit kernels, not in the compat syscall table
33 for 64-bit kernels. */
34 #if !defined __arch64__ && __LINUX_KERNEL_VERSION < 0x040400
35 # undef __ASSUME_SENDMSG_SYSCALL
36 # undef __ASSUME_RECVMSG_SYSCALL
37 # undef __ASSUME_ACCEPT_SYSCALL
38 # undef __ASSUME_CONNECT_SYSCALL
39 # undef __ASSUME_RECVFROM_SYSCALL
40 # undef __ASSUME_SENDTO_SYSCALL
41 # undef __ASSUME_GETSOCKOPT_SYSCALL
42 # undef __ASSUME_SETSOCKOPT_SYSCALL
43 #endif
45 /* These syscalls were added for both 32-bit and 64-bit in 4.4. */
46 #if __LINUX_KERNEL_VERSION < 0x040400
47 # undef __ASSUME_BIND_SYSCALL
48 # undef __ASSUME_LISTEN_SYSCALL
49 #endif
51 #ifdef __arch64__
52 /* sparc64 defines __NR_pause, however it is not supported (ENOSYS).
53 Undefine so pause.c can use a correct alternative. */
54 # undef __NR_pause
55 #endif
57 /* sparc only supports ipc syscall before 5.1. */
58 #if __LINUX_KERNEL_VERSION < 0x050100
59 # undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
60 # if !defined __arch64__
61 # undef __ASSUME_SYSVIPC_DEFAULT_IPC_64
62 # endif
63 #endif
65 /* Support for the renameat2 syscall was added in 3.16. */
66 #if __LINUX_KERNEL_VERSION < 0x031000
67 # undef __ASSUME_RENAMEAT2
68 #endif
70 /* SPARC kernel Kconfig does not define CONFIG_CLONE_BACKWARDS, however it
71 has the same ABI as if it did, implemented by sparc-specific code
72 (sparc_do_fork).
74 It also has a unique return value convention:
76 Parent --> %o0 == child's pid, %o1 == 0
77 Child --> %o0 == parent's pid, %o1 == 1
79 Which required a special macro to correct issue the syscall
80 (INLINE_CLONE_SYSCALL). */
81 #undef __ASSUME_CLONE_DEFAULT
82 #define __ASSUME_CLONE_BACKWARDS 1