For child processes, the wait() and waitpid() functions can be used to suspends execution of the current process until a child has exited. But t
wait()
waitpid()
On BSDs and OS X, you can use kqueue with EVFILT_PROC+NOTE_EXIT to do exactly that. No polling required. Unfortunately there's no Linux equivalent.