]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
missing_syscall: name_to_handle_at is supported by glibc since 2.14
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 28 Feb 2025 13:30:42 +0000 (22:30 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 3 Mar 2025 17:24:49 +0000 (02:24 +0900)
Now our baseline of glibc is 2.31, hence it is OK to drop our
definition.

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

index 0b4e3bab3e72906f72b3aa577d55e7bfabb1187b..fe8188acab82b8f02b5a61e2cd5592527ac38826 100644 (file)
@@ -610,9 +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>'''],
-        ['name_to_handle_at', '''#include <sys/types.h>
-                                 #include <sys/stat.h>
-                                 #include <fcntl.h>'''],
         ['setns',             '''#include <sched.h>'''],
         ['renameat2',         '''#include <stdio.h>
                                  #include <fcntl.h>'''],
index a6188879c1f352b85b4a83e1392d055997966d9a..b02c7be7a498ec0afe33731a127d2d41e83d0359 100644 (file)
@@ -97,6 +97,7 @@
 #endif
 #endif
 
+/* This is defined since glibc-2.39. */
 #ifndef AT_HANDLE_FID
 #define AT_HANDLE_FID AT_REMOVEDIR
 #endif
index 757cfdea19fcd43bd62113d6ec71e2842ad2720c..fac6f30b2f36c1c4e8518cb8d6bf0e32b519586d 100644 (file)
@@ -68,27 +68,6 @@ static inline int missing_ioprio_set(int which, int who, int ioprio) {
 
 /* ======================================================================= */
 
-#if !HAVE_NAME_TO_HANDLE_AT
-struct file_handle {
-        unsigned int handle_bytes;
-        int handle_type;
-        unsigned char f_handle[0];
-};
-
-static inline int missing_name_to_handle_at(int fd, const char *name, struct file_handle *handle, int *mnt_id, int flags) {
-#  ifdef __NR_name_to_handle_at
-        return syscall(__NR_name_to_handle_at, fd, name, handle, mnt_id, flags);
-#  else
-        errno = ENOSYS;
-        return -1;
-#  endif
-}
-
-#  define name_to_handle_at missing_name_to_handle_at
-#endif
-
-/* ======================================================================= */
-
 #if !HAVE_SETNS
 static inline int missing_setns(int fd, int nstype) {
         return syscall(__NR_setns, fd, nstype);
index a98a2a203058bba7003120151802736467f2345c..f35a6f2348b37144dc78a22f370b715de36238cf 100644 (file)
@@ -450,74 +450,6 @@ assert_cc(__NR_move_mount == systemd_NR_move_mount);
 #  endif
 #endif
 
-#ifndef __IGNORE_name_to_handle_at
-#  if defined(__aarch64__)
-#    define systemd_NR_name_to_handle_at 264
-#  elif defined(__alpha__)
-#    define systemd_NR_name_to_handle_at 497
-#  elif defined(__arc__) || defined(__tilegx__)
-#    define systemd_NR_name_to_handle_at 264
-#  elif defined(__arm__)
-#    define systemd_NR_name_to_handle_at 370
-#  elif defined(__i386__)
-#    define systemd_NR_name_to_handle_at 341
-#  elif defined(__ia64__)
-#    define systemd_NR_name_to_handle_at 1326
-#  elif defined(__loongarch_lp64)
-#    define systemd_NR_name_to_handle_at 264
-#  elif defined(__m68k__)
-#    define systemd_NR_name_to_handle_at 340
-#  elif defined(_MIPS_SIM)
-#    if _MIPS_SIM == _MIPS_SIM_ABI32
-#      define systemd_NR_name_to_handle_at 4339
-#    elif _MIPS_SIM == _MIPS_SIM_NABI32
-#      define systemd_NR_name_to_handle_at 6303
-#    elif _MIPS_SIM == _MIPS_SIM_ABI64
-#      define systemd_NR_name_to_handle_at 5298
-#    else
-#      error "Unknown MIPS ABI"
-#    endif
-#  elif defined(__hppa__)
-#    define systemd_NR_name_to_handle_at 325
-#  elif defined(__powerpc__)
-#    define systemd_NR_name_to_handle_at 345
-#  elif defined(__riscv)
-#    if __riscv_xlen == 32
-#      define systemd_NR_name_to_handle_at 264
-#    elif __riscv_xlen == 64
-#      define systemd_NR_name_to_handle_at 264
-#    else
-#      error "Unknown RISC-V ABI"
-#    endif
-#  elif defined(__s390__)
-#    define systemd_NR_name_to_handle_at 335
-#  elif defined(__sparc__)
-#    define systemd_NR_name_to_handle_at 332
-#  elif defined(__x86_64__)
-#    if defined(__ILP32__)
-#      define systemd_NR_name_to_handle_at (303 | /* __X32_SYSCALL_BIT */ 0x40000000)
-#    else
-#      define systemd_NR_name_to_handle_at 303
-#    endif
-#  elif !defined(missing_arch_template)
-#    warning "name_to_handle_at() syscall number is unknown for your architecture"
-#  endif
-
-/* may be an (invalid) negative number due to libseccomp, see PR 13319 */
-#  if defined __NR_name_to_handle_at && __NR_name_to_handle_at >= 0
-#    if defined systemd_NR_name_to_handle_at
-assert_cc(__NR_name_to_handle_at == systemd_NR_name_to_handle_at);
-#    endif
-#  else
-#    if defined __NR_name_to_handle_at
-#      undef __NR_name_to_handle_at
-#    endif
-#    if defined systemd_NR_name_to_handle_at && systemd_NR_name_to_handle_at >= 0
-#      define __NR_name_to_handle_at systemd_NR_name_to_handle_at
-#    endif
-#  endif
-#endif
-
 #ifndef __IGNORE_open_tree
 #  if defined(__aarch64__)
 #    define systemd_NR_open_tree 428
index 81ef4feef6d35d8f0faa177648b0dc261ba35082..59705471dfe9da2f86e8fd4a065fea351969fd04 100644 (file)
@@ -12,7 +12,6 @@ SYSCALLS = [
     'fchmodat2',
     'mount_setattr',
     'move_mount',
-    'name_to_handle_at',
     'open_tree',
     'openat2',
     'pidfd_open',