1. waitpid(pid, &status, WNOHAND)
waitpid wil return immediately if no child has exited.
2. waitpid(pid, &status, WUNTRACED)
also return if a child has stopped (but not traced via ptrace(2)).
e.g.
when kill -STOP pid
waitpid will return.
3. waitpid(pid, &status, WCONTINUED)
also return if a stopped child has been resumed by delivery of SIGCONT.
Further notes:
kill -STOP pid
waitpid will not return.
then exec kill -CONT pid
waitpid will return.