Re:The Rule of Silence (2006)
by bluetomcat on Tuesday December 13, 2016 @06:35AM
(#13166082)
Actually, sending the zero signal to a pid as in `kill -0 <pid>` checks whether that pid exists and whether the calling process has permissions to send signals to it.
[ Parent
| on HN ]
... at the point that the system call completed. There are no guarantees from that point onwards.
Interestingly, it would only take the addition of a pdopen() to something like FreeBSD's pdkill() to get enough for a tool that opened a process descriptor, sent a signal to the process, and determined (with poll() and pdwait4()) whether the process then exited; with the open-descriptor-style interface guaranteeing that it was always referencing the same process.