Artificial intelligent assistant

How to spawn each child process in separate pid namespace How to spawn each child in a separate PID namespace using `unshare` (without `CLONE_NEWPID flag in child process clone syscall`). I am able to successfully spawn first child in PID namespace but I am not sure how to spawn the second child in another PID namespace. Psuedo code of the parent process 1 unshare CLONE_NEWPID 2 spawn child1 3 4 unshare CLONE_NEWPID 5 spawn child2 Here child1 entered into the separate PID namespace and got the PID as 1. When the execution reached line 4 it threw `Sys(EINVAL)` error.

From reading the manual `unshare CLONE_NEWPID` acts on the calling process, not the child. Calling this multiple times seems redundant. After the 1st call all children are in a new pid namespace.

To put them in there own, you need a different parent to call `unshare CLONE_NEWPID`.

Try


repeat:
fork
if child:
unshare CLONE_NEWPID
spawn


This is all untested, and just what I would try next. I am also reading that you need to use `clone`.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy add1594dddd7c9cf1981241a6fadfb81