diff options
| author | Pavel Emelyanov <[email protected]> | 2007-10-19 06:40:10 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2007-10-19 18:53:39 +0000 |
| commit | 30e49c263e36341b60b735cbef5ca37912549264 (patch) | |
| tree | 103e74c41db97476ae38cdd4ffc18e4da03f28e8 /fs/proc/root.c | |
| parent | pid namespaces: miscellaneous preparations for pid namespaces (diff) | |
| download | kernel-30e49c263e36341b60b735cbef5ca37912549264.tar.gz kernel-30e49c263e36341b60b735cbef5ca37912549264.zip | |
pid namespaces: allow cloning of new namespace
When clone() is invoked with CLONE_NEWPID, create a new pid namespace and then
create a new struct pid for the new process. Allocate pid_t's for the new
process in the new pid namespace and all ancestor pid namespaces. Make the
newly cloned process the session and process group leader.
Since the active pid namespace is special and expected to be the first entry
in pid->upid_list, preserve the order of pid namespaces.
The size of 'struct pid' is dependent on the the number of pid namespaces the
process exists in, so we use multiple pid-caches'. Only one pid cache is
created during system startup and this used by processes that exist only in
init_pid_ns.
When a process clones its pid namespace, we create additional pid caches as
necessary and use the pid cache to allocate 'struct pids' for that depth.
Note, that with this patch the newly created namespace won't work, since the
rest of the kernel still uses global pids, but this is to be fixed soon. Init
pid namespace still works.
[[email protected]: merge fix]
Signed-off-by: Pavel Emelyanov <[email protected]>
Signed-off-by: Sukadev Bhattiprolu <[email protected]>
Cc: Paul Menage <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'fs/proc/root.c')
0 files changed, 0 insertions, 0 deletions
