]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
missing_syscall: setns is supported by glibc since 2.14
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 28 Feb 2025 13:45:25 +0000 (22:45 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 3 Mar 2025 17:24:49 +0000 (02:24 +0900)
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.

meson.build
src/basic/missing_sched.h
src/basic/missing_syscall.h
src/basic/missing_syscall_def.h
src/basic/missing_syscalls.py

index fe8188acab82b8f02b5a61e2cd5592527ac38826..ea47d1359afd3d43570c3b8846d3fc918f56a92e 100644 (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>'''],
index 6e5e2b1e20bf6ee82d62d33639e962d364422cf3..d8e2b6d3c77b56222af0fa09d8e57f8c2867acc6 100644 (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
index fac6f30b2f36c1c4e8518cb8d6bf0e32b519586d..e9b6548ccd348d70d7e553ede486ba75320d16a2 100644 (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);
index f35a6f2348b37144dc78a22f370b715de36238cf..1bd4889dac3f70015c546d78151659a10d9cdd20 100644 (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
index 59705471dfe9da2f86e8fd4a065fea351969fd04..0302fa424a410367c19acecde6a07d94a8f717fa 100644 (file)
@@ -20,7 +20,6 @@ SYSCALLS = [
     'quotactl_fd',
     'removexattrat',
     'renameat2',
-    'setns',
     'setxattrat',
 ]