[3/3] unistd/renameat: use renameat2 when appropriate

Submitted by Drew DeVault on March 21, 2019, 3:32 p.m.

Details

Message ID 20190321153240.29328-4-sir@cmpwn.com
State New
Series "Use v2 syscalls when appropriate"
Headers show

Commit Message

Drew DeVault March 21, 2019, 3:32 p.m.
---
 src/unistd/renameat.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/unistd/renameat.c b/src/unistd/renameat.c
index 12574822..c3b40a25 100644
--- a/src/unistd/renameat.c
+++ b/src/unistd/renameat.c
@@ -3,5 +3,9 @@ 
 
 int renameat(int oldfd, const char *old, int newfd, const char *new)
 {
+#ifdef SYS_renameat
 	return syscall(SYS_renameat, oldfd, old, newfd, new);
+#else
+	return syscall(SYS_renameat2, oldfd, old, newfd, new, 0);
+#endif
 }