Open System Services System Calls Reference Manual (G06.25+, H06.03+)

wait(2) OSS System Calls Reference Manual
WSTOPSIG(status_location)
If the value of WIFSTOPPED(status_location) is nonzero, evaluates to the
number of the signal that caused the child process to stop.
This macro is normally only useful with the waitpid() function.
WTERMSIG(status_location)
If the value of WIFSIGNALED(status_location) is nonzero, evaluates to the
number of the signal that caused the termination of the child process.
See the Guardian Procedure Calls Reference Manual for details on the Guardian STOP and
PROCESS_STOP_ procedures and on Guardian completion codes.
If the information stored at the location pointed to by the status_location parameter was stored
there by a call to the waitpid() function that specied the WUNTRACED option, exactly one of
the WIFEXITED, WIFSIGNALED, and WIFSTOPPED macros evaluates to a nonzero value.
If the information stored at the location pointed to by status_location was stored there by a call to
the wait() function, exactly one of the WIFEXITED and WIFSIGNALED macros evaluates to
a nonzero value.
Normal Self Termination
When a process terminates itself, information is returned to the parent process in the location
pointed to by the status_location parameter. A process terminates itself in one of the following
ways:
Returning from its main() function. The return value is placed in status_location.
Calling the _exit() or exit() function. The exit status is placed in status_location.
Calling the Guardian STOP or PROCESS_STOP_ procedure with parameters set for
self-termination. The completion code is placed in status_location.
The parent process can use the WIFEXITED macro to detect a child process that terminates
itself; WIFEXITED evaluates to a nonzero value. The WEXITSTATUS macro evaluates to the
lower 8 bits of the return value, exit status, or completion code. The WCOMPLETION macro
evaluates to the full 16-bit completion code or to 16 bits of the 32-bit exit status code.
See the Guardian Procedure Calls Reference Manual for details on the Guardian STOP and
PROCESS_STOP_ procedures and on Guardian completion codes.
Termination by Another
The child process can be terminated by another process in one of the following ways:
Another process calls the kill() function with the OSS process ID of the child process.
Another process calls the Guardian STOP procedure with the Guardian process ID of the
child process or calls the Guardian PROCESS_STOP_ procedure with the Guardian pro-
cess handle of the child process.
In either case, the SIGKILL signal is delivered. The parent process can use the WIFSIG-
NALED macro to detect when a signal causes the child process to terminate; WIFSIGNALED
evaluates to a nonzero value. The WTERMSIG macro evaluates to the number of the signal
that caused the termination. The WCOMPLETION macro evaluates to the completion code.
See the Guardian Procedure Calls Reference Manual for details on the Guardian STOP and
PROCESS_STOP_ procedures and on Guardian completion codes.
104 Hewlett-Packard Company 527186-003