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.
This commit is contained in:
Yu Watanabe
2025-03-04 02:24:49 +09:00
parent 65e844bdb8
commit 96ff465861
5 changed files with 1 additions and 93 deletions
-3
View 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>'''],
+1
View 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
-21
View 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);
-68
View 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
-1
View File
@@ -12,7 +12,6 @@ SYSCALLS = [
'fchmodat2',
'mount_setattr',
'move_mount',
'name_to_handle_at',
'open_tree',
'openat2',
'pidfd_open',