Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190321153240.29328-4-sir@cmpwn.com>
Date: Thu, 21 Mar 2019 11:32:40 -0400
From: Drew DeVault <sir@...wn.com>
To: musl@...ts.openwall.com
Cc: Drew DeVault <sir@...wn.com>
Subject: [PATCH 3/3] unistd/renameat: use renameat2 when appropriate

---
 src/unistd/renameat.c | 4 ++++
 1 file changed, 4 insertions(+)

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
 }
-- 
2.21.0

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.