The wait() System Call

This lesson will teach you about the `wait()` system call with the help of an example.

We'll cover the following

Running p2.c

So far, we haven’t done much: just created a child that prints out a message and exits. Sometimes, as it turns out, it is quite useful for a parent to wait for a child process to finish what it has been doing. This task is accomplished with the wait() system call (or its more complete sibling waitpid()); see the code below for details.

Get hands-on with 1400+ tech skills courses.