Add AT_* constants from Linux 6.12

Florian Weimer fw@deneb.enyo.de
Sun Aug 3 17:58:53 GMT 2025


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


More information about the Libc-alpha mailing list