I have the pid of a forked process. Now, from my c code (running on Linux), I have to check periodically whether this process is still running or terminated. I do not want to use blocking calls like wait()
or waitpid()
. Need (preferably) a non-blocking system call which would just check whether this pid is still running and return the status of the child.
What is best and easiest way to do it?