From d6da5cb6a8e0e8a9ce92b7d951a254cf325248d7 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 5 Jul 2018 18:59:02 +0200 Subject: Add renameat2 function [BZ #17662] The implementation falls back to renameat if renameat2 is not available in the kernel (or in the kernel headers) and the flags argument is zero. Without kernel support, a non-zero argument returns EINVAL, not ENOSYS. This mirrors what the kernel does for invalid renameat2 flags. --- sysdeps/unix/sysv/linux/renameat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sysdeps/unix/sysv/linux/renameat.c') diff --git a/sysdeps/unix/sysv/linux/renameat.c b/sysdeps/unix/sysv/linux/renameat.c index 034432b..f85c5ae 100644 --- a/sysdeps/unix/sysv/linux/renameat.c +++ b/sysdeps/unix/sysv/linux/renameat.c @@ -22,7 +22,7 @@ #include int -renameat (int oldfd, const char *old, int newfd, const char *new) +__renameat (int oldfd, const char *old, int newfd, const char *new) { #ifdef __NR_renameat return INLINE_SYSCALL_CALL (renameat, oldfd, old, newfd, new); @@ -30,3 +30,5 @@ renameat (int oldfd, const char *old, int newfd, const char *new) return INLINE_SYSCALL_CALL (renameat2, oldfd, old, newfd, new, 0); #endif } +libc_hidden_def (__renameat) +weak_alias (__renameat, renameat) -- cgit v1.1