From: Yu Watanabe Date: Fri, 28 Feb 2025 13:50:32 +0000 (+0900) Subject: missing_syscall: renameat2 is supported by glibc since 2.28 X-Git-Tag: v258-rc1~1195^2~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f2786bd3e7f1f2c813aa2ddf242c3a8593449b1e;p=thirdparty%2Fsystemd.git missing_syscall: renameat2 is supported by glibc since 2.28 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 ea47d1359af..ca7af554ac9 100644 --- a/meson.build +++ b/meson.build @@ -610,8 +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 '''], - ['renameat2', '''#include - #include '''], ['kcmp', '''#include '''], ['keyctl', '''#include #include '''], diff --git a/src/basic/missing_fs.h b/src/basic/missing_fs.h index 60b0a3a2a76..5c64cb6e0c7 100644 --- a/src/basic/missing_fs.h +++ b/src/basic/missing_fs.h @@ -6,10 +6,6 @@ #include "macro.h" /* linux/fs.h */ -#ifndef RENAME_NOREPLACE /* 0a7c3937a1f23f8cb5fc77ae01661e9968a51d0c (3.15) */ -#define RENAME_NOREPLACE (1 << 0) -#endif - #ifndef BLKGETDISKSEQ /* 7957d93bf32bc211415827e44fdd9cdf1388df59 (5.15) */ #define BLKGETDISKSEQ _IOR(0x12,128,__u64) #endif diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h index e9b6548ccd3..2eff224a478 100644 --- a/src/basic/missing_syscall.h +++ b/src/basic/missing_syscall.h @@ -78,16 +78,6 @@ static inline pid_t raw_getpid(void) { /* ======================================================================= */ -#if !HAVE_RENAMEAT2 -static inline int missing_renameat2(int oldfd, const char *oldname, int newfd, const char *newname, unsigned flags) { - return syscall(__NR_renameat2, oldfd, oldname, newfd, newname, flags); -} - -# define renameat2 missing_renameat2 -#endif - -/* ======================================================================= */ - #if !HAVE_KCMP static inline int missing_kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) { return syscall(__NR_kcmp, pid1, pid2, type, idx1, idx2); diff --git a/src/basic/missing_syscall_def.h b/src/basic/missing_syscall_def.h index 1bd4889dac3..7e1c6a3c99e 100644 --- a/src/basic/missing_syscall_def.h +++ b/src/basic/missing_syscall_def.h @@ -926,74 +926,6 @@ assert_cc(__NR_removexattrat == systemd_NR_removexattrat); # endif #endif -#ifndef __IGNORE_renameat2 -# if defined(__aarch64__) -# define systemd_NR_renameat2 276 -# elif defined(__alpha__) -# define systemd_NR_renameat2 510 -# elif defined(__arc__) || defined(__tilegx__) -# define systemd_NR_renameat2 276 -# elif defined(__arm__) -# define systemd_NR_renameat2 382 -# elif defined(__i386__) -# define systemd_NR_renameat2 353 -# elif defined(__ia64__) -# define systemd_NR_renameat2 1338 -# elif defined(__loongarch_lp64) -# define systemd_NR_renameat2 276 -# elif defined(__m68k__) -# define systemd_NR_renameat2 351 -# elif defined(_MIPS_SIM) -# if _MIPS_SIM == _MIPS_SIM_ABI32 -# define systemd_NR_renameat2 4351 -# elif _MIPS_SIM == _MIPS_SIM_NABI32 -# define systemd_NR_renameat2 6315 -# elif _MIPS_SIM == _MIPS_SIM_ABI64 -# define systemd_NR_renameat2 5311 -# else -# error "Unknown MIPS ABI" -# endif -# elif defined(__hppa__) -# define systemd_NR_renameat2 337 -# elif defined(__powerpc__) -# define systemd_NR_renameat2 357 -# elif defined(__riscv) -# if __riscv_xlen == 32 -# define systemd_NR_renameat2 276 -# elif __riscv_xlen == 64 -# define systemd_NR_renameat2 276 -# else -# error "Unknown RISC-V ABI" -# endif -# elif defined(__s390__) -# define systemd_NR_renameat2 347 -# elif defined(__sparc__) -# define systemd_NR_renameat2 345 -# elif defined(__x86_64__) -# if defined(__ILP32__) -# define systemd_NR_renameat2 (316 | /* __X32_SYSCALL_BIT */ 0x40000000) -# else -# define systemd_NR_renameat2 316 -# endif -# elif !defined(missing_arch_template) -# warning "renameat2() syscall number is unknown for your architecture" -# endif - -/* may be an (invalid) negative number due to libseccomp, see PR 13319 */ -# if defined __NR_renameat2 && __NR_renameat2 >= 0 -# if defined systemd_NR_renameat2 -assert_cc(__NR_renameat2 == systemd_NR_renameat2); -# endif -# else -# if defined __NR_renameat2 -# undef __NR_renameat2 -# endif -# if defined systemd_NR_renameat2 && systemd_NR_renameat2 >= 0 -# define __NR_renameat2 systemd_NR_renameat2 -# endif -# endif -#endif - #ifndef __IGNORE_setxattrat # if defined(__aarch64__) # define systemd_NR_setxattrat 463 diff --git a/src/basic/missing_syscalls.py b/src/basic/missing_syscalls.py index 0302fa424a4..3c5bcd15daa 100644 --- a/src/basic/missing_syscalls.py +++ b/src/basic/missing_syscalls.py @@ -19,7 +19,6 @@ SYSCALLS = [ 'pkey_mprotect', 'quotactl_fd', 'removexattrat', - 'renameat2', 'setxattrat', ]