task_session() and task->signal->session

Serge E. Hallyn serue at us.ibm.com
Thu Nov 16 08:17:25 PST 2006


Looking at fork, it seems that task->group_leader is a thread grp
leader.  If you fork without the CLONE_THREAD flag, then
task->group_leader is set to task itself.  If with CLONE_THREAD flag,
then task->group_leader is set to the parent->group_leader.

The signal->session presumably is what we think of as process session.
At fork it is always set to parent->signal->session, and see
kernel/sys.c for where it gets tweaked.

-serge

Quoting Sukadev Bhattiprolu (sukadev at us.ibm.com):
> 
> I am trying to understand the diff between task_session() and
> task->signal-session and why we have the two notions of session.
> Are we just phasing out one of them ?
> 
> In general each process has a single session id. The only exception
> being a process that unshares its pid ns. Such process will have
> exactly two session ids, one for each pid ns. No ?
> 
> Thanks,
> 
> Suka
> _______________________________________________
> Containers mailing list
> Containers at lists.osdl.org
> https://lists.osdl.org/mailman/listinfo/containers



More information about the Containers mailing list