Open System Services System Calls Reference Manual (G06.25+, H06.03+)
System Functions (w) waitpid(2)
• The lower 8 bits of the completion code for a process that terminated
itself by calling the Guardian STOP or PROCESS_STOP_ procedure
• The lower 8 bits of the value that the child process returned from the
main() function
WIFABENDED(∗∗status_location)
Evaluates to a nonzero value if the child process terminated abnormally. A
SIGABEND signal was received.
WIFEXITED(∗∗status_location)
Evaluates to a nonzero value if status was returned for a child process that ter-
minated normally whether the termination was due to the _exit() function, the
exit() function, the Guardian STOP procedure, or the Guardian
PROCESS_STOP_ procedure.
WIFSAVEABEND(∗∗status_location)
Evaluates to a nonzero value if the terminated process created a saveabend file.
WIFSIGNALED(∗∗status_location)
Evaluates to a nonzero value if status was returned for a child process that ter-
minated due to the receipt of a signal that was not caught. Such a signal occurs,
for example, when another process terminates the child process by calling the
kill() function, the Guardian STOP procedure, or the Guardian
PROCESS_STOP_ procedure, or when the process abnormally terminates.
WIFSTOPPED(∗∗status_location)
Evaluates to a nonzero value if status was returned for a child process that is
currently stopped.
This macro returns a nonzero value only when the WUNTRACED option was
set in the call to waitpid( ) and the stopped process was not previously reported.
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.
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 specified 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
waitpid( ) that did not specify the WUNTRACED option or 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.
527186-003 Hewlett-Packard Company 10−9