about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/renameat.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2018-07-05 18:59:02 +0200
committerFlorian Weimer <fweimer@redhat.com>2018-07-05 19:00:10 +0200
commitd6da5cb6a8e0e8a9ce92b7d951a254cf325248d7 (patch)
tree4c8f50e0ec6b6780eb1eb4dd2b496f0a1b1411d3 /sysdeps/mach/hurd/renameat.c
parent1002d708232dda9ebff65f6c1409fa067a01b6e0 (diff)
downloadglibc-d6da5cb6a8e0e8a9ce92b7d951a254cf325248d7.tar.gz
glibc-d6da5cb6a8e0e8a9ce92b7d951a254cf325248d7.tar.xz
glibc-d6da5cb6a8e0e8a9ce92b7d951a254cf325248d7.zip
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.
Diffstat (limited to 'sysdeps/mach/hurd/renameat.c')
-rw-r--r--sysdeps/mach/hurd/renameat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sysdeps/mach/hurd/renameat.c b/sysdeps/mach/hurd/renameat.c
index 43609600d9..7985763f73 100644
--- a/sysdeps/mach/hurd/renameat.c
+++ b/sysdeps/mach/hurd/renameat.c
@@ -22,7 +22,7 @@
 
 /* Rename the file OLD relative to OLDFD to NEW relative to NEWFD.  */
 int
-renameat (int oldfd, const char *old, int newfd, const char *new)
+__renameat (int oldfd, const char *old, int newfd, const char *new)
 {
   error_t err;
   file_t olddir, newdir;
@@ -45,3 +45,5 @@ renameat (int oldfd, const char *old, int newfd, const char *new)
     return __hurd_fail (err);
   return 0;
 }
+libc_hidden_def (__renameat)
+weak_alias (__renameat, renameat)