[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250824221055.86110-1-rdunlap@infradead.org>
Date: Sun, 24 Aug 2025 15:10:55 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: linux-kernel@...r.kernel.org
Cc: Randy Dunlap <rdunlap@...radead.org>,
Amir Goldstein <amir73il@...il.com>,
Jeff Layton <jlayton@...nel.org>,
Chuck Lever <chuck.lever@...cle.com>,
Alexander Aring <alex.aring@...il.com>,
Josef Bacik <josef@...icpanda.com>,
Aleksa Sarai <cyphar@...har.com>,
Jan Kara <jack@...e.cz>,
Christian Brauner <brauner@...nel.org>,
linux-fsdevel@...r.kernel.org,
linux-api@...r.kernel.org
Subject: [PATCH] uapi/fcntl: conditionally define AT_RENAME* macros
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@...radead.org>
---
Cc: Amir Goldstein <amir73il@...il.com>
Cc: Jeff Layton <jlayton@...nel.org>
Cc: Chuck Lever <chuck.lever@...cle.com>
Cc: Alexander Aring <alex.aring@...il.com>
Cc: Josef Bacik <josef@...icpanda.com>
Cc: Aleksa Sarai <cyphar@...har.com>
Cc: Jan Kara <jack@...e.cz>
Cc: Christian Brauner <brauner@...nel.org>
Cc: linux-fsdevel@...r.kernel.org
CC: linux-api@...r.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
Powered by blists - more mailing lists