| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Use kill() with 0 for the signal number.
There are four possible results from this call:
kill() returns 0
kill() returns -1, errno == ESRCH
kill() returns -1, errno == EPERM
kill() returns -1, with some other value of errno
The most-used technique is to assume that success or failure with
EPERM implies that the process exists, and any other error
implies that it doesn't.
An alternative exists, if you are writing specifically for a system (or all those systems) that provide a ‘/proc’ filesystem: checking for the existence of ‘/proc/PID’ may work.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated on September, 10 2007 using texi2html 1.77.