linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] uapi/fcntl: conditionally define AT_RENAME* macros
@ 2025-08-24 22:10 Randy Dunlap
  2025-08-24 23:21 ` Matthew Wilcox
  0 siblings, 1 reply; 9+ messages in thread
From: Randy Dunlap @ 2025-08-24 22:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Amir Goldstein, Jeff Layton, Chuck Lever,
	Alexander Aring, Josef Bacik, Aleksa Sarai, Jan Kara,
	Christian Brauner, linux-fsdevel, linux-api

Don't define the AT_RENAME_* macros when __USE_GNU is defined since
/usr/include/stdio.h defines them in that case (i.e. when _GNU_SOURCE
is defined, which causes __USE_GNU to be defined).

Having them defined in 2 places causes build warnings (duplicate
definitions) in both samples/watch_queue/watch_test.c and
samples/vfs/test-statx.c.

Fixes: b4fef22c2fb9 ("uapi: explain how per-syscall AT_* flags should be allocated")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: Jeff Layton <jlayton@kernel.org>
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: Alexander Aring <alex.aring@gmail.com>
Cc: Josef Bacik <josef@toxicpanda.com>
Cc: Aleksa Sarai <cyphar@cyphar.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Christian Brauner <brauner@kernel.org>
Cc: linux-fsdevel@vger.kernel.org
CC: linux-api@vger.kernel.org

 include/uapi/linux/fcntl.h |    2 ++
 1 file changed, 2 insertions(+)

--- linux-next-20250819.orig/include/uapi/linux/fcntl.h
+++ linux-next-20250819/include/uapi/linux/fcntl.h
@@ -155,10 +155,12 @@
  * as possible, so we can use them for generic bits in the future if necessary.
  */
 
+#ifndef __USE_GNU
 /* Flags for renameat2(2) (must match legacy RENAME_* flags). */
 #define AT_RENAME_NOREPLACE	0x0001
 #define AT_RENAME_EXCHANGE	0x0002
 #define AT_RENAME_WHITEOUT	0x0004
+#endif
 
 /* Flag for faccessat(2). */
 #define AT_EACCESS		0x200	/* Test access permitted for

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-08-25 19:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-24 22:10 [PATCH] uapi/fcntl: conditionally define AT_RENAME* macros Randy Dunlap
2025-08-24 23:21 ` Matthew Wilcox
2025-08-24 23:54   ` Randy Dunlap
2025-08-25  5:58     ` Amir Goldstein
2025-08-25  6:49       ` Randy Dunlap
2025-08-25 13:03     ` Matthew Wilcox
2025-08-25 17:52       ` Randy Dunlap
2025-08-25 18:45         ` Matthew Wilcox
2025-08-25 19:29           ` Randy Dunlap

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).