public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* clone(2) man page CLONE_NEWPID and CLONE_PARENT can be specified at the same time, also CLONE_NEWUSER and CLONE_PARENT
@ 2025-04-15 11:34 hoodit dev
  2025-04-15 12:03 ` Carlos O'Donell
  0 siblings, 1 reply; 4+ messages in thread
From: hoodit dev @ 2025-04-15 11:34 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man

Hi

In clone(2) man page ERRORS section said EINVAL occur when set
CLONE_NEWPID and one (or both) of CLONE_THREAD or CLONE_PARENT were
specified in the flags mask
but in my test code, it can be specified CLONE_NEWPID and CLONE_PARENT
at the same time and works well (not in CLONE_THREAD)
In DESCRIPTION > the flags mask > CLONE_NEWPID, it says that it can't
be used with CLONE_THREAD only
So, I search linux github to find really CLONE_PARENT can't be used
with CLONE_NEWPID but there is no logic like that
(but I found CLONE_THREAD can't be used with CLONE_NEWUSER,
https://github.com/torvalds/linux/blob/219d54332a09e8d8741c1e1982f5eae56099de85/kernel/fork.c#L1815)

Similarly, in CLONE_NEWUSER, it says that "This flag can't be
specified in conjunction with CLONE_THREAD or CLONE_PARENT." but it
works on my test code with CLONE_PARENT
Also, in ERROR section only mentioned when CLONE_NEWUSER used with CLONE_THREAD

I think CLONE_NEWPID and CLONE_NEWUSER can't be used with CLONE_THREAD only.
If you think my opinion is reasonable, please let me know. I'll make a patch

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

end of thread, other threads:[~2025-04-19 20:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-15 11:34 clone(2) man page CLONE_NEWPID and CLONE_PARENT can be specified at the same time, also CLONE_NEWUSER and CLONE_PARENT hoodit dev
2025-04-15 12:03 ` Carlos O'Donell
2025-04-19 19:54   ` Cc: " hoodit dev
2025-04-19 20:45     ` Alejandro Colomar

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