mailing list of musl libc
 help / color / mirror / code / Atom feed
From: vi0oss <>
Subject: [musl] Feature request: expose Linux-specific renameat2 function
Date: Tue, 21 Feb 2023 00:28:41 +0100	[thread overview]
Message-ID: <> (raw)

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]

[-- Attachment #2: 0001-expose-renameat2-function-if-such-syscall-is-availab.patch --]
[-- Type: text/x-diff, Size: 1071 bytes --]

From 70d1747dd0fb31df780d2e0255a8e0417899b6ca Mon Sep 17 00:00:00 2001
From: Vitaly _Vi Shukela <>
Date: Tue, 21 Feb 2023 00:23:45 +0100
Subject: [PATCH] expose renameat2 function if such syscall is available

RENAME_WHITEOUT constants that are likely to be the
reason to use renameat2 instead of renameat, but this
should still simplify linking issues arising from the
use of renameat2 and enable simpler workarounds.
 src/unistd/renameat.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/unistd/renameat.c b/src/unistd/renameat.c
index c3b40a25..fe1adaf4 100644
--- a/src/unistd/renameat.c
+++ b/src/unistd/renameat.c
@@ -9,3 +9,10 @@ int renameat(int oldfd, const char *old, int newfd, const char *new)
 	return syscall(SYS_renameat2, oldfd, old, newfd, new, 0);
+#ifdef SYS_renameat2
+int renameat2(int oldfd, const char *old, int newfd, const char *new, unsigned int flags)
+	return syscall(SYS_renameat2, oldfd, old, newfd, new, flags);

             reply	other threads:[~2023-02-20 23:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20 23:28 vi0oss [this message]
2023-02-21  4:09 ` Markus Wichmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).