From: Waldemar Brodkorb <wbx@openadk.org>
To: buildroot@buildroot.org
Subject: [Buildroot] [PATCH next] package/uclibc: add renameat2 syscall wrapper
Date: Fri, 20 Nov 2026 08:48:22 +0100 [thread overview]
Message-ID: <av_7RuEyLtyqiVcr@waldemar-brodkorb.de> (raw)
optee-client needs renameat2() since 4.8.0.
Fixes:
- https://autobuild.buildroot.org/results/a1776b9fb064aea72e37965e9c04d44ab1743b2c
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
...02-renameat2-add-new-syscall-wrapper.patch | 70 +++++++++++++++++++
1 file changed, 70 insertions(+)
create mode 100644 package/uclibc/0002-renameat2-add-new-syscall-wrapper.patch
diff --git a/package/uclibc/0002-renameat2-add-new-syscall-wrapper.patch b/package/uclibc/0002-renameat2-add-new-syscall-wrapper.patch
new file mode 100644
index 0000000000..86818452ce
--- /dev/null
+++ b/package/uclibc/0002-renameat2-add-new-syscall-wrapper.patch
@@ -0,0 +1,70 @@
+From 8201708234efe3ce182beaac42cee84166bea78b Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Fri, 20 Nov 2026 05:37:52 +0100
+Subject: [PATCH] renameat2: add new syscall wrapper
+
+Upstream: https://github.com/wbx-github/uclibc-ng/commit/8201708234efe3ce182beaac42cee84166bea78b
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+---
+ include/stdio.h | 16 ++++++++++++++++
+ libc/sysdeps/linux/common/renameat2.c | 21 +++++++++++++++++++++
+ 2 files changed, 37 insertions(+)
+ create mode 100644 libc/sysdeps/linux/common/renameat2.c
+
+diff --git a/include/stdio.h b/include/stdio.h
+index a48fa9b78..5069bc65e 100644
+--- a/include/stdio.h
++++ b/include/stdio.h
+@@ -157,6 +157,22 @@ extern int renameat (int __oldfd, const char *__old, int __newfd,
+ libc_hidden_proto(renameat)
+ #endif
+
++#ifdef __USE_GNU
++/* Flags for renameat2. */
++# define RENAME_NOREPLACE (1 << 0)
++# define AT_RENAME_NOREPLACE 0x0001
++# define RENAME_EXCHANGE (1 << 1)
++# define AT_RENAME_EXCHANGE 0x0002
++# define RENAME_WHITEOUT (1 << 2)
++# define AT_RENAME_WHITEOUT 0x0004
++
++/* Rename file OLD relative to OLDFD to NEW relative to NEWFD, with
++ additional flags. */
++extern int renameat2 (int __oldfd, const char *__old, int __newfd,
++ const char *__new, unsigned int __flags) __THROW;
++libc_hidden_proto(renameat2)
++#endif
++
+ __BEGIN_NAMESPACE_STD
+ /* Create a temporary file and open it read/write.
+
+diff --git a/libc/sysdeps/linux/common/renameat2.c b/libc/sysdeps/linux/common/renameat2.c
+new file mode 100644
+index 000000000..efab4e019
+--- /dev/null
++++ b/libc/sysdeps/linux/common/renameat2.c
+@@ -0,0 +1,21 @@
++/*
++ * renameat2() for uClibc-ng
++ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
++ */
++
++#include <stdio.h>
++#include <fcntl.h>
++#include <sysdep.h>
++#include <errno.h>
++
++int
++renameat2 (int oldfd, const char *old, int newfd, const char *new, unsigned int flags)
++{
++#ifdef __NR_renameat2
++ return INLINE_SYSCALL (renameat2, 5, oldfd, old, newfd, new, flags);
++#else
++ __set_errno(ENOSYS);
++ return -1;
++#endif
++}
++libc_hidden_def (renameat2)
+--
+2.47.3
+
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next reply other threads:[~2026-11-20 7:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 7:48 Waldemar Brodkorb [this message]
2026-11-20 7:55 ` [Buildroot] [PATCH next] package/uclibc: add renameat2 syscall wrapper Yegor Yefremov
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=av_7RuEyLtyqiVcr@waldemar-brodkorb.de \
--to=wbx@openadk.org \
--cc=buildroot@buildroot.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.