I am designing a monitor process. The job of the monitor process is to monitor a few set of configured processes. When the monitor process detects that a process has gone do
You can easily tell if a process is alive by issuing a kill() system call to its pid. If the child is not alive, kill() will not succeed.
Also, calling waitpid() with the WNOHANG option will return zero immediately if the process is still alive.
IMHO, reading proc files or piping to ps is a nasty way to do it.