[CC += linux-api@] Hi Christian, > Date: 2026-11-27 13:51:03+0100 > From: Christian Brauner > > On Fri, Nov 20, 2026 at 12:22:52AM +0100, Alejandro Colomar wrote: > > That same commit also adds CLONE_EMPTY_MNTNS (according to the commit > > message, for clone3(2)). Could you explain why there are two separate > > flags? > > unshare() only takes 32 bits. All of them are taken by legacy CLONE_* > flags. New clone3() flags live above bit 31 so CLONE_EMPTY_MNTNS (1ULL > << 37) can't be passed to unshare(). UNSHARE_EMPTY_MNTNS reuses the > CLONE_PARENT_SETTID bit which has no meaning for unshare(). Both imply > CLONE_NEWNS. Hmmm, thanks! $ git grep -hP -f <(grepc_c -tm CLONE_EMPTY_MNTNS) include/ #define CLONE_EMPTY_MNTNS (1ULL << 37) /* Create an empty mount namespace. */ $ git grep -hP -f <(grepc_c -tm UNSHARE_EMPTY_MNTNS) include/ #define UNSHARE_EMPTY_MNTNS 0x00100000 /* Unshare an empty mount namespace. */ $ git grep -hP -f <(grepc_c -tm CLONE_PARENT_SETTID) include/ #define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */ Would it make sense to create new UNSHARE_* flags for all the existing CLONE_* flags that make sense in unshare(2)? That would avoid some possible confusion. That is: $ man 2 unshare | grep -o '^.....CLONE_\w*' | sed s/CLONE/UNSHARE/; UNSHARE_FILES UNSHARE_FS UNSHARE_NEWCGROUP UNSHARE_NEWIPC UNSHARE_NEWNET UNSHARE_NEWNS UNSHARE_NEWPID UNSHARE_NEWTIME UNSHARE_NEWUSER UNSHARE_NEWUTS UNSHARE_SYSVSEM Have a lovely day! Alex --