1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

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.
This commit is contained in:
Florian Weimer
2018-07-05 18:59:02 +02:00
parent 1002d70823
commit d6da5cb6a8
45 changed files with 400 additions and 5 deletions

View File

@ -97,6 +97,11 @@
implementation based on p{read,write}v and returning an error for
non supported flags. */
/* Support for the renameat2 system call was added in kernel 3.15. */
#if __LINUX_KERNEL_VERSION >= 0x030F00
# define __ASSUME_RENAMEAT2
#endif
/* Support for the execveat syscall was added in 3.19. */
#if __LINUX_KERNEL_VERSION >= 0x031300
# define __ASSUME_EXECVEAT 1