1 2 3 4 5 6 7 8 9 10 11
#define _GNU_SOURCE #include <stdio.h> #include "syscall.h" int renameat2(int oldfd, const char *old, int newfd, const char *new, unsigned flags) { #ifdef SYS_renameat if (!flags) return syscall(SYS_renameat, oldfd, old, newfd, new); #endif return syscall(SYS_renameat2, oldfd, old, newfd, new, flags); }