struct pid *alloc_pid(struct pid_namespace *ns) {

struct pid *pid; enum pid_type type; int i, nr;

struct pid_namespace *tmp; struct upid *upid;

for (i = ns->level; i >= 0; i--) { nr = alloc_pidmap(tmp);

pid->numbers[i].nr = nr; pid->numbers[i].ns = tmp; tmp = tmp->parent;

Starting at the level of the namespace in which the process is created, the kernel goes down to the initial, global namespace and creates a local PID for each. All upids that are contained in struct pid are filled with the newly generated PIDs. Each upid instance must be placed on the PID hash:

Continue reading here: Task Relationships

Was this article helpful?

0 0