Wait

The wait system call reaps the zombied childs of a process. wait blocks so you may want to look at waitpid instead. Read the manual page for better explanations.