O_CLOEXEC use for OPEN_TREE_CLOEXEC
From: Florian Weimer
Date: Tue Jan 13 2026 - 17:41:06 EST
In <linux/mount.h>, we have this:
#define OPEN_TREE_CLOEXEC O_CLOEXEC /* Close the file on execve() */
This causes a few pain points for us to on the glibc side when we mirror
this into <linux/mount.h> becuse O_CLOEXEC is defined in <fcntl.h>,
which is one of the headers that's completely incompatible with the UAPI
headers.
The reason why this is painful is because O_CLOEXEC has at least three
different values across architectures: 0x80000, 0x200000, 0x400000
Even for the UAPI this isn't ideal because it effectively burns three
open_tree flags, unless the flags are made architecture-specific, too.
Thanks,
Florian