in reply to Killing wayward children
You could kill INT, $pid; which is like hitting Ctrl-C. If the child is already gone, the signal will not be delivered to an unrelated process with the same pid. That shouldn't be a problem, anyway, if you are handling SIGCHLD.
Update: Re diotalevi's question, kill fails with EPERM if the real or effective uid of the sender is not root or the same as that of the $pid addressed. See 'man 2 kill'. It is true that one of the user's own processes could reacquire the child pid. That is why the SIGCHLD handler should arrange to note the death of $pid, so the issue of misdelivery never comes up.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Killing wayward children
by diotalevi (Canon) on Nov 17, 2002 at 13:53 UTC | |
|
Re: Re: Killing wayward children
by SpaceAce (Beadle) on Nov 17, 2002 at 12:48 UTC |