3 ms·
you already have a tool to check whether processes exist... 'ps'. This is the essence of 'small, single purpose programs that work well with each other' rule.
by TickleSteve 10y ago
you already have a tool to check whether processes exist... 'ps'.
This is the essence of 'small, single purpose programs that work well with each other' rule.
- bluetomcat 10y agoActually, 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.
- JdeBP 10y ago... 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.