From: Nathan Chancellor <nathan@kernel.org>
To: Florian Weimer <fw@deneb.enyo.de>
Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>,
Joseph Myers <josmyers@redhat.com>,
libc-alpha@sourceware.org, Elliott Hughes <enh@google.com>
Subject: Re: Add AT_* constants from Linux 6.12
Date: Fri, 22 Aug 2025 22:27:06 -0700 [thread overview]
Message-ID: <20250823052706.GA4056405@ax162> (raw)
In-Reply-To: <87qzxsjnhe.fsf@mid.deneb.enyo.de>
On Sun, Aug 03, 2025 at 07:58:53PM +0200, Florian Weimer wrote:
> * Nathan Chancellor:
>
> > On Mon, Apr 14, 2025 at 01:00:22PM -0300, Adhemerval Zanella Netto wrote:
> >>
> >>
> >> On 09/04/25 16:51, Joseph Myers wrote:
> >> > Linux 6.12 adds AT_RENAME_* aliases for RENAME_* flags for renameat2,
> >> > and also AT_HANDLE_MNT_ID_UNIQUE. Add the first set of aliases to
> >> > stdio.h alongside the RENAME_* names, and AT_HANDLE_MNT_ID_UNIQUE to
> >> > bits/fcntl-linux.h.
> >> >
> >> > Tested for x86_64.
> >>
> >> LGTM, although I am not sure about the possible <linux/fcntl.h> inclusion
> >> clash.
> >
> > Yeah, this appears to be the reason I now see some warnings when
> > building samples/vfs/test-statx.c and samples/watch_queue/watch_test.c
> > in the Linux kernel, which includes both linux/fcntl.h and stdio.h:
> >
> > In file included from samples/vfs/test-statx.c:23:
> > usr/include/linux/fcntl.h:159:9: warning: 'AT_RENAME_NOREPLACE' macro redefined [-Wmacro-redefined]
> > 159 | #define AT_RENAME_NOREPLACE 0x0001
> > | ^
> > /usr/include/stdio.h:171:10: note: previous definition is here
> > 171 | # define AT_RENAME_NOREPLACE RENAME_NOREPLACE
> > | ^
> > In file included from samples/vfs/test-statx.c:23:
> > usr/include/linux/fcntl.h:160:9: warning: 'AT_RENAME_EXCHANGE' macro redefined [-Wmacro-redefined]
> > 160 | #define AT_RENAME_EXCHANGE 0x0002
> > | ^
> > /usr/include/stdio.h:173:10: note: previous definition is here
> > 173 | # define AT_RENAME_EXCHANGE RENAME_EXCHANGE
> > | ^
> > In file included from samples/vfs/test-statx.c:23:
> > usr/include/linux/fcntl.h:161:9: warning: 'AT_RENAME_WHITEOUT' macro redefined [-Wmacro-redefined]
> > 161 | #define AT_RENAME_WHITEOUT 0x0004
> > | ^
> > /usr/include/stdio.h:175:10: note: previous definition is here
> > 175 | # define AT_RENAME_WHITEOUT RENAME_WHITEOUT
> > | ^
> >
> > Whose bug is this?
>
> In glibc, we should use the same token sequence as in the UAPI header.
Is there going to be a patch submitted on the glibc side? I have been
working around this locally in the kernel, should I submit this upstream
since it is in a released glibc?
diff --git a/samples/vfs/test-statx.c b/samples/vfs/test-statx.c
index 49c7a46cee07..17332100a2b5 100644
--- a/samples/vfs/test-statx.c
+++ b/samples/vfs/test-statx.c
@@ -20,6 +20,9 @@
#include <sys/syscall.h>
#include <sys/types.h>
#include <linux/stat.h>
+#undef AT_RENAME_NOREPLACE
+#undef AT_RENAME_EXCHANGE
+#undef AT_RENAME_WHITEOUT
#include <linux/fcntl.h>
#define statx foo
#define statx_timestamp foo_timestamp
diff --git a/samples/watch_queue/watch_test.c b/samples/watch_queue/watch_test.c
index 8c6cb57d5cfc..c3c0111cae40 100644
--- a/samples/watch_queue/watch_test.c
+++ b/samples/watch_queue/watch_test.c
@@ -16,6 +16,9 @@
#include <errno.h>
#include <sys/ioctl.h>
#include <limits.h>
+#undef AT_RENAME_NOREPLACE
+#undef AT_RENAME_EXCHANGE
+#undef AT_RENAME_WHITEOUT
#include <linux/watch_queue.h>
#include <linux/unistd.h>
#include <linux/keyctl.h>
next prev parent reply other threads:[~2025-08-23 5:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-09 19:51 Joseph Myers
2025-04-09 21:25 ` enh
2025-04-14 16:00 ` Adhemerval Zanella Netto
2025-08-03 17:54 ` Nathan Chancellor
2025-08-03 17:58 ` Florian Weimer
2025-08-23 5:27 ` Nathan Chancellor [this message]
2025-08-23 5:55 ` Florian Weimer
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=20250823052706.GA4056405@ax162 \
--to=nathan@kernel.org \
--cc=adhemerval.zanella@linaro.org \
--cc=enh@google.com \
--cc=fw@deneb.enyo.de \
--cc=josmyers@redhat.com \
--cc=libc-alpha@sourceware.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 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 read-only IMAP folder(s) and NNTP newsgroup(s).