Checks the status of the child process before exiting. A child process is terminated when the parent process terminates.
#include <wait.h> pid_t wait (int *status);
On OpenVMS Version 7.0 and higher systems, the wait function is equivalent to waitpid( 0, status, 0 ) if you include <wait.h> and compile with the _POSIX_EXIT feature-test macro set (either with /DEFINE=_POSIX_EXIT or with #define _POSIX_EXIT at the top of your file, before any file inclusions).
x | The process ID (PID) of the terminated child. If more than one child process was created, wait will return the PID of the terminated child that was most recently created. Subsequent calls will return the PID of the next most recently created, but terminated, child. |
- 1 | No child process was spawned. |