Navigation

Operators and Keywords

Function List:

C++ API

: [pid, status, msg] = waitpid (pid, options)

Wait for process pid to terminate.

The pid argument can be:

-1

Wait for any child process.

0

Wait for any child process whose process group ID is equal to that of the Octave interpreter process.

> 0

Wait for termination of the child process with ID pid.

The options argument can be a bitwise OR of zero or more of the following constants:

0

Wait until signal is received or a child process exits (this is the default if the options argument is missing).

WNOHANG

Do not hang if status is not immediately available.

WUNTRACED

Report the status of any child processes that are stopped, and whose status has not yet been reported since they stopped.

WCONTINUE

Return if a stopped child has been resumed by delivery of SIGCONT. This value may not be meaningful on all systems.

If the returned value of pid is greater than 0, it is the process ID of the child process that exited. If an error occurs, pid will be less than zero and msg will contain a system-dependent error message. The value of status contains additional system-dependent information about the subprocess that exited.

See also: WCONTINUE, WCOREDUMP, WEXITSTATUS, WIFCONTINUED, WIFSIGNALED, WIFSTOPPED, WNOHANG, WSTOPSIG, WTERMSIG, WUNTRACED.

Package: octave