Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

waitpid(2) OSS System Calls Reference Manual
thread-aware in a multi-threaded application on systems running H06.21/J06.10 or later RVUs.
To use this function in a 64-bit threaded application on systems running H06.24 or later RVUs or
J06.13 or later RVUs, you must perform all of the following tasks to make the function thread-
aware in a multi-threaded application:
Compile the application using the _PUT_MODEL_ feature test macro or equivalent
compiler command option.
Compile the application using the -Wlp64 compiler command option.
Link the application to the yputdll library (/G/system/zdllnnn/yputdll).
For detailed information about writing multi-threaded and 64-bit applications for the Open Sys-
tem Services environment, see the Open System Services Programmers Guide.
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 specified 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 specified 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.
[EINTR] The function was terminated by receipt of a signal. The information pointed to
by the status_location parameter is not meaningful when this error occurs and
should not be used in further processing.
This error is also returned if the waitpid( ) function is thread-aware and a signal
received from the pthread_kill() function is not blocked, ignored, or handled.
[EINVAL] The value of the options parameter is invalid.
[ENOTOSS] The calling process was not an OSS process. The waitpid( ) function cannot be
used in the Guardian environment.
RELATED INFORMATION
Functions: exec(2), _exit(2), exit(3), fork(2), pause(3), sigaction(2), spt_waitpid(2),
tdm_execve(2), tdm_execvep(2), tdm_fork(2), tdm_spawn(2), tdm_spawnp(2), wait(2).
STANDARDS CONFORMANCE
The POSIX standards leave some features to the implementing vendor to define. The following
features are affected in the HP implementation:
The POSIX.1 standard states that when status information for two or more child
processes is available, the order in which the information is returned by the waitpid( )
function is unspecified. HP’s implementation also does not provide this information in a
specified sequence. The sequence should therefore not be depended upon for further
processing.
1012 Hewlett-Packard Company 527186-023