Oleg Nesterov <oleg@xxxxxxxxxx> writes:-
daemonize() calls set_special_pids(1,1), while init and
kernel threads spawned from init/main.c:init() run with
0,0 special pids. This patch changes INIT_SIGNALS() so
that that they run with ->pgrp == ->session == 1 also.
This patch relies on fact that swapper's pid == 1.
Now we never use pid == 0 in kernel/pid.c.
This changes what is visible to user space, for the case
where we are not a member of a session of a process group.
By hashing the values these non-groups become available to
user space. Which I find disturbing. Before I can comment
further I need to see if there are any well defined semantics
for processes that are not part of a session or a process
group. If there are well defined semantics we have just
broken user space.
Eric