As you can see, this CLONE_PID flag, although working fine, opens a
whole can of worms in the area of signal delivery. If anyone has
ideas on how to approach this problem, please let me know.
Add a new mask of signals to task_struct, the implementation then
would be:
kill(p, sig)
{
for_each_thread_with_pid(p, tsk)
p->normal_sig_mask |= (1<<(sig-1));
if(has_threads(p))
find_task(p)->global_sig_mask |= (1<<(sig-1));
}
signal_deliver(tsk)
{
if(tsk->global_sig_mask & (1 << (sig - 1))) {
for_each_thread_with_pid(tsk->pid & PID_MASK, tmp)
tmp->normal_sig_mask &= ~(1<<(sig-1));
tsk->global_sig_mask &= ~(1 << (sig - 1));
} else {
tsk->normal_sig_mask &= ~(1<<(sig-1));
}
}
Thats gross as hell, and doesn't consider possible races, but it is
just the general idea.
--------------------------------------------////
Yow! 10.49 MB/s remote host TCP bandwidth ////
over 100Mb/s ethernet. Beat that! ////
-----------------------------------------////__________ o
David S. Miller, davem@caip.rutgers.edu /_____________/ / // /_/ ><