[Devel] Mapping PIDs from parent->child namespaces

Mike Heffner mikeh at fesnel.com
Mon Jan 3 15:04:57 PST 2011


Hi,

Is it possible for a process running in a parent PID namespace to map 
the PID of a process running in a child's namespace from the 
parent->child's namespace? For example, if I span the process "myproc" 
with CLONE_NEWPID then a call to getpid() inside myproc will return "1" 
whereas in the parent's namespace that process could actually be PID 
"23495". I'd like to be able to know that 23495 maps to 1 in the new NS. 
Obviously, just mapping the first PID is straightforward since I can 
just look at the result of clone(). However, mapping the PIDs of 
processes subsequently forked from "myproc" -- in this example -- I 
haven't been able to figure out.


Thanks,

Mike
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list