xref: /aosp_15_r20/external/musl/src/linux/renameat2.c (revision c9945492fdd68bbe62686c5b452b4dc1be3f8453)
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