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