]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
missing_syscall: renameat2 is supported by glibc since 2.28
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 28 Feb 2025 13:50:32 +0000 (22:50 +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_fs.h
src/basic/missing_syscall.h
src/basic/missing_syscall_def.h
src/basic/missing_syscalls.py

index ea47d1359afd3d43570c3b8846d3fc918f56a92e..ca7af554ac98213f0c9b5b2783656c49b8799604 100644 (file)
@@ -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>'''],
index 60b0a3a2a76fd82d3af8fee1b4101c647005d874..5c64cb6e0c75353a1827bf14d81eb18f7dcc54d5 100644 (file)
@@ -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
index e9b6548ccd348d70d7e553ede486ba75320d16a2..2eff224a47888a24ae72a836fa556b981f6eb821 100644 (file)
@@ -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);
index 1bd4889dac3f70015c546d78151659a10d9cdd20..7e1c6a3c99eeadb6b10d808383d537087b5c037b 100644 (file)
@@ -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
index 0302fa424a410367c19acecde6a07d94a8f717fa..3c5bcd15daa908695ff99ebe1d80bdc8a4c34fa6 100644 (file)
@@ -19,7 +19,6 @@ SYSCALLS = [
     'pkey_mprotect',
     'quotactl_fd',
     'removexattrat',
-    'renameat2',
     'setxattrat',
 ]