projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
give libc access to its own malloc even if public malloc is interposed
[musl]
/
src
/
stdio
/
rename.c
diff --git
a/src/stdio/rename.c
b/src/stdio/rename.c
index
97f1453
..
f540adb
100644
(file)
--- a/
src/stdio/rename.c
+++ b/
src/stdio/rename.c
@@
-1,7
+1,14
@@
#include <stdio.h>
#include <stdio.h>
+#include <fcntl.h>
#include "syscall.h"
int rename(const char *old, const char *new)
{
#include "syscall.h"
int rename(const char *old, const char *new)
{
+#if defined(SYS_rename)
return syscall(SYS_rename, old, new);
return syscall(SYS_rename, old, new);
+#elif defined(SYS_renameat)
+ return syscall(SYS_renameat, AT_FDCWD, old, AT_FDCWD, new);
+#else
+ return syscall(SYS_renameat2, AT_FDCWD, old, AT_FDCWD, new, 0);
+#endif
}
}