From: Yu Watanabe Date: Fri, 28 Feb 2025 13:30:42 +0000 (+0900) Subject: missing_syscall: name_to_handle_at is supported by glibc since 2.14 X-Git-Tag: v258-rc1~1195^2~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96ff465861f090a971949bb887852050c2fe4f09;p=thirdparty%2Fsystemd.git missing_syscall: name_to_handle_at is supported by glibc since 2.14 Now our baseline of glibc is 2.31, hence it is OK to drop our definition. --- diff --git a/meson.build b/meson.build index 0b4e3bab3e7..fe8188acab8 100644 --- a/meson.build +++ b/meson.build @@ -610,9 +610,6 @@ foreach ident : [ ['ioprio_get', '''#include '''], # no known header declares ioprio_get ['ioprio_set', '''#include '''], # no known header declares ioprio_set ['sched_setattr', '''#include '''], - ['name_to_handle_at', '''#include - #include - #include '''], ['setns', '''#include '''], ['renameat2', '''#include #include '''], diff --git a/src/basic/missing_fcntl.h b/src/basic/missing_fcntl.h index a6188879c1f..b02c7be7a49 100644 --- a/src/basic/missing_fcntl.h +++ b/src/basic/missing_fcntl.h @@ -97,6 +97,7 @@ #endif #endif +/* This is defined since glibc-2.39. */ #ifndef AT_HANDLE_FID #define AT_HANDLE_FID AT_REMOVEDIR #endif diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h index 757cfdea19f..fac6f30b2f3 100644 --- a/src/basic/missing_syscall.h +++ b/src/basic/missing_syscall.h @@ -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); diff --git a/src/basic/missing_syscall_def.h b/src/basic/missing_syscall_def.h index a98a2a20305..f35a6f2348b 100644 --- a/src/basic/missing_syscall_def.h +++ b/src/basic/missing_syscall_def.h @@ -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 diff --git a/src/basic/missing_syscalls.py b/src/basic/missing_syscalls.py index 81ef4feef6d..59705471dfe 100644 --- a/src/basic/missing_syscalls.py +++ b/src/basic/missing_syscalls.py @@ -12,7 +12,6 @@ SYSCALLS = [ 'fchmodat2', 'mount_setattr', 'move_mount', - 'name_to_handle_at', 'open_tree', 'openat2', 'pidfd_open',