wait and waitpid (11.2)
Recall from a previous slide: pid_t wait( int *status )
wait() can: (a) block; (b) return with status; (c) return with error
If there is more than one child, wait() returns on termination of any children
waitpid can be used to wait for a specific child pid
waitpid also has an option to block or not to block
pid_t waitpid( pid, &status, option );
pid == -1 waits for any child
option == NOHANG non-blocking
option == 0 blocking
waitpid(-1, &status, 0) equivalent to wait(&status)