diff options
Diffstat (limited to 'src/stdio/rename.c')
-rw-r--r-- | src/stdio/rename.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/stdio/rename.c b/src/stdio/rename.c index 04c90c01..f540adb6 100644 --- a/src/stdio/rename.c +++ b/src/stdio/rename.c @@ -4,9 +4,11 @@ int rename(const char *old, const char *new) { -#ifdef SYS_rename +#if defined(SYS_rename) return syscall(SYS_rename, old, new); -#else +#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 } |