mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
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.
This commit is contained in:
@@ -610,8 +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>'''],
|
||||
['renameat2', '''#include <stdio.h>
|
||||
#include <fcntl.h>'''],
|
||||
['kcmp', '''#include <linux/kcmp.h>'''],
|
||||
['keyctl', '''#include <sys/types.h>
|
||||
#include <keyutils.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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -19,7 +19,6 @@ SYSCALLS = [
|
||||
'pkey_mprotect',
|
||||
'quotactl_fd',
|
||||
'removexattrat',
|
||||
'renameat2',
|
||||
'setxattrat',
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user