Imagine I have a process that starts several child processes. The parent needs to know when a child exits.
I can use waitpid, but then if/when the paren
waitpid
The function can be interrupted with a signal, so you could set a timer before calling waitpid() and it will exit with an EINTR when the timer signal is raised. Edit: It should be as simple as calling alarm(5) before calling waitpid().