missing_syscall: setns is supported by glibc since 2.14

Also, CLONE_PIDFD is defined in sched.h since 2.31.
Now our baseline of glibc is 2.31, hence it is OK to drop our
definition.
This commit is contained in:
Yu Watanabe
2025-03-04 02:24:49 +09:00
parent 96ff465861
commit d322854cac
5 changed files with 2 additions and 95 deletions
-1
View File
@@ -610,7 +610,6 @@ foreach ident : [
['ioprio_get', '''#include <sched.h>'''], # no known header declares ioprio_get
['ioprio_set', '''#include <sched.h>'''], # no known header declares ioprio_set
['sched_setattr', '''#include <sched.h>'''],
['setns', '''#include <sched.h>'''],
['renameat2', '''#include <stdio.h>
#include <fcntl.h>'''],
['kcmp', '''#include <linux/kcmp.h>'''],
+2 -15
View File
@@ -6,21 +6,8 @@
#include "macro.h"
/* 5e2bec7c2248ae27c5b16cd97215ae05c1d39179 (4.6) */
#ifndef CLONE_NEWCGROUP
# define CLONE_NEWCGROUP 0x02000000
#else
assert_cc(CLONE_NEWCGROUP == 0x02000000);
#endif
/* b3e5838252665ee4cfa76b82bdf1198dca81e5be (5.2) */
#ifndef CLONE_PIDFD
# define CLONE_PIDFD 0x00001000
#else
assert_cc(CLONE_PIDFD == 0x00001000);
#endif
/* 769071ac9f20b6a447410c7eaa55d1a5233ef40c (5.8) */
/* 769071ac9f20b6a447410c7eaa55d1a5233ef40c (5.8),
* defined in sched.h since glibc-2.36. */
#ifndef CLONE_NEWTIME
# define CLONE_NEWTIME 0x00000080
#else
-10
View File
@@ -68,16 +68,6 @@ static inline int missing_ioprio_set(int which, int who, int ioprio) {
/* ======================================================================= */
#if !HAVE_SETNS
static inline int missing_setns(int fd, int nstype) {
return syscall(__NR_setns, fd, nstype);
}
# define setns missing_setns
#endif
/* ======================================================================= */
static inline pid_t raw_getpid(void) {
#if defined(__alpha__)
return (pid_t) syscall(__NR_getxpid);
-68
View File
@@ -994,74 +994,6 @@ assert_cc(__NR_renameat2 == systemd_NR_renameat2);
# endif
#endif
#ifndef __IGNORE_setns
# if defined(__aarch64__)
# define systemd_NR_setns 268
# elif defined(__alpha__)
# define systemd_NR_setns 501
# elif defined(__arc__) || defined(__tilegx__)
# define systemd_NR_setns 268
# elif defined(__arm__)
# define systemd_NR_setns 375
# elif defined(__i386__)
# define systemd_NR_setns 346
# elif defined(__ia64__)
# define systemd_NR_setns 1330
# elif defined(__loongarch_lp64)
# define systemd_NR_setns 268
# elif defined(__m68k__)
# define systemd_NR_setns 344
# elif defined(_MIPS_SIM)
# if _MIPS_SIM == _MIPS_SIM_ABI32
# define systemd_NR_setns 4344
# elif _MIPS_SIM == _MIPS_SIM_NABI32
# define systemd_NR_setns 6308
# elif _MIPS_SIM == _MIPS_SIM_ABI64
# define systemd_NR_setns 5303
# else
# error "Unknown MIPS ABI"
# endif
# elif defined(__hppa__)
# define systemd_NR_setns 328
# elif defined(__powerpc__)
# define systemd_NR_setns 350
# elif defined(__riscv)
# if __riscv_xlen == 32
# define systemd_NR_setns 268
# elif __riscv_xlen == 64
# define systemd_NR_setns 268
# else
# error "Unknown RISC-V ABI"
# endif
# elif defined(__s390__)
# define systemd_NR_setns 339
# elif defined(__sparc__)
# define systemd_NR_setns 337
# elif defined(__x86_64__)
# if defined(__ILP32__)
# define systemd_NR_setns (308 | /* __X32_SYSCALL_BIT */ 0x40000000)
# else
# define systemd_NR_setns 308
# endif
# elif !defined(missing_arch_template)
# warning "setns() syscall number is unknown for your architecture"
# endif
/* may be an (invalid) negative number due to libseccomp, see PR 13319 */
# if defined __NR_setns && __NR_setns >= 0
# if defined systemd_NR_setns
assert_cc(__NR_setns == systemd_NR_setns);
# endif
# else
# if defined __NR_setns
# undef __NR_setns
# endif
# if defined systemd_NR_setns && systemd_NR_setns >= 0
# define __NR_setns systemd_NR_setns
# endif
# endif
#endif
#ifndef __IGNORE_setxattrat
# if defined(__aarch64__)
# define systemd_NR_setxattrat 463
-1
View File
@@ -20,7 +20,6 @@ SYSCALLS = [
'quotactl_fd',
'removexattrat',
'renameat2',
'setns',
'setxattrat',
]