From 3a5be53a84ac68255fbcecb73b8fe58a35550c26 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Wed, 10 Oct 2012 15:17:10 +0100 Subject: rename: Use renameat if arch does not have the rename syscall Signed-off-by: Markos Chandras Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/rename.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libc/sysdeps/linux/common/rename.c') diff --git a/libc/sysdeps/linux/common/rename.c b/libc/sysdeps/linux/common/rename.c index 6183cf494..3ce5a5e3e 100644 --- a/libc/sysdeps/linux/common/rename.c +++ b/libc/sysdeps/linux/common/rename.c @@ -9,5 +9,14 @@ #include #include +#include +#if defined __NR_renameat && !defined __NR_rename +# include +int rename(const char *oldpath, const char *newpath) +{ + return renameat(AT_FDCWD, oldpath, AT_FDCWD, newpath); +} +#else _syscall2(int, rename, const char *, oldpath, const char *, newpath) +#endif -- cgit v1.2.3