The wait function suspends execution of the current pro-cess until a child has exited, or until a signal is deliv-ered whose action is to terminate the current process or to call a signal handling function. If a child has already exited by the time of the call (a so-called "zom-bie" process), the function returns immediately. Any sys- tem resources used by the child are freed.