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