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

System Functions (w) waitpid(2)
Process Stopped
If the WUNTRACED option is set in the waitpid() call, the call returns when the child process
is temporarily suspended because it received a SIGTTIN, SIGTTOU, SIGSTOP,or
SIGTSTOP signal.
The WIFSTOPPED macro evaluates to a nonzero value. The WSTOPSIG macro evaluates to
the number of the signal that caused the process to stop.
Saveabend File Creation
Whenever process termination is caused by signal delivery (that is, when the WIFSIGNALED
macro evaluates to a nonzero value), it is possible that the terminating process creates a
saveabend le.
A saveabend le is created for the process if the saveabend bit is set for the process in the pro-
cess control block (PCB). This bit is set in any of the following ways:
The compiler, linker, or Binder sets the saveabend bit in the code le header.
The tdm_fork(), tdm_execve(), tdm_execvep(), tdm_spawn( ),ortdm_spawnp( )
function sets the pe_debug_options eld of the process_extensions_def structure.
The shell command that executes the process sets the saveabend bit.
If a saveabend le is created, the core dump (CD) bit is set in the information returned in the
location pointed to by the status_location parameter. The parent process can use the
WIFSAVEABEND macro to detect the creation of a saveabend le;
WIFSAVEABEND evaluates to a nonzero value when the CD bit is set.
If a processor failure occurs, status about the terminated child processes in the failed processor is
returned to the parent process in the location pointed to by the status_location parameter. In this
case, no saveabend le is possible. WIFSAVEABEND evaluates to zero.
NOTES
If a parent process terminates without waiting for all of its child processes to terminate, the
remaining child processes are assigned a parent process ID of 1.
Suspending a process is not always the same as stopping it. A process is only stopped when a
job-control signal stops it.
RETURN VALUES
If the waitpid( ) function returns because the status of a child process is available, the OSS pro-
cess ID of the child is returned to the calling process. If the function returns because a signal was
caught by the calling process, the value -1 is returned and errno is set to [EINTR]. Upon any
error, the value -1 is returned and errno is set to indicate the error.
If the WNOHANG value of the options parameter was specied and there are no stopped or
exited child processes, the waitpid() function returns the value 0 (zero).
ERRORS
If any of the following conditions occurs, the waitpid() function sets errno to the corresponding
value:
[ECHILD] The process or process group ID specied by the process_id parameter either
does not exist or is not a child process of the calling process.
[EFAULT] The buffer pointed to by the status_location parameter failed bounds checking.
527186-003 Hewlett-Packard Company 1011