Linux Manual Pages development
 help / color / mirror / Atom feed
* man 2 unshare: UNSHARE_EMPTY_MNTNS
@ 2026-11-12 16:42 Niklas Hambüchen
  2026-11-19 23:22 ` Alejandro Colomar
  0 siblings, 1 reply; 2+ messages in thread
From: Niklas Hambüchen @ 2026-11-12 16:42 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man

Dear man pages maintainers,

I just want to point out that unshare has a new flag in Linux >= 7.1:
UNSHARE_EMPTY_MNTNS

See e.g.
https://github.com/torvalds/linux/commit/9d4e752a24f740b31ca827bfab07010e4e7f34b0#diff-871f39f0834631ea368e8539ee88840ade11866cd6104e91543f9387dd1b8386R39-R52

"
This is useful for containers and sandboxes that want to
start with a minimal mount table and populate it from scratch rather
than inheriting and then tearing down the full mount tree.
"

Note a little quirk caused by this change:

This is the first `unshare` flag that isn't a `CLONE_*` one, so it breaks the existing invariant that all `unshare` flags are also valid `clone3` flags.
The commit remarks:

"
  * unshare flags share the bit space with clone flags but only apply to the
  * unshare syscall:
"

I guess that part isn't really relevant for the man page, but I thought to point it out on this list, for searchability of this fact.

Cheers,
Niklas

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

* Re: man 2 unshare: UNSHARE_EMPTY_MNTNS
  2026-11-12 16:42 man 2 unshare: UNSHARE_EMPTY_MNTNS Niklas Hambüchen
@ 2026-11-19 23:22 ` Alejandro Colomar
  0 siblings, 0 replies; 2+ messages in thread
From: Alejandro Colomar @ 2026-11-19 23:22 UTC (permalink / raw)
  To: Niklas Hambüchen; +Cc: linux-man, Christian Brauner

[-- Attachment #1: Type: text/plain, Size: 1464 bytes --]

Hi Niklas, Christian,

> Date: 2026-11-12 17:42:33+0100
> From: Niklas Hambüchen <mail@nh2.me>
>
> Dear man pages maintainers,
> 
> I just want to point out that unshare has a new flag in Linux >= 7.1:
> UNSHARE_EMPTY_MNTNS
> 
> See e.g.
> https://github.com/torvalds/linux/commit/9d4e752a24f740b31ca827bfab07010e4e7f34b0#diff-871f39f0834631ea368e8539ee88840ade11866cd6104e91543f9387dd1b8386R39-R52
> 
> "
> This is useful for containers and sandboxes that want to
> start with a minimal mount table and populate it from scratch rather
> than inheriting and then tearing down the full mount tree.
> "
> 
> Note a little quirk caused by this change:
> 
> This is the first `unshare` flag that isn't a `CLONE_*` one, so it breaks the existing invariant that all `unshare` flags are also valid `clone3` flags.
> The commit remarks:

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?  Would you mind writing a patch for the manual pages?

> 
> "
>  * unshare flags share the bit space with clone flags but only apply to the
>  * unshare syscall:
> "
> 
> I guess that part isn't really relevant for the man page, but I
> thought to point it out on this list, for searchability of this fact.

It's probably relevant, I'd say.


Have a lovely night!
Alex

> 
> Cheers,
> Niklas
> 

-- 
<https://www.alejandro-colomar.es>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2026-11-19 23:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12 16:42 man 2 unshare: UNSHARE_EMPTY_MNTNS Niklas Hambüchen
2026-11-19 23:22 ` Alejandro Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox