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

System Functions (s and S) spt_waitpid(2)
NAME
spt_waitpid - Initiates thread-aware waitpid( ) function
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series and J series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
#include <spthread.h>
pid_t spt_waitpid(
pid_t pid,
int *stat_loc,
int options);
PARAMETERS
See the waitpid(2) reference page.
DESCRIPTION
This is a thread-aware version of the waitpid( ) function. The socket must be nonblocking for
this function to be thread-aware.
In spthread.h, a mapping of waitpid( ) to spt_waitpid() has been defined:
#define waitpid(pid, stat_loc, options) \
spt_waitpid(pid, stat_loc, options)
For C applications that do not use the nonblocking feature, this mapping is available only when
the correct preprocessor has been defined before including spthread.h, as follows:
#define SPT_THREAD_AWARE
#include <spthread.h>
For C applications that use the nonblocking feature, this mapping is available only when the
correct preprocessor has been defined before including spthread.h, as follows:
#define SPT_THREAD_AWARE_NONBLOCK
#include <spthread.h>
For C++ applications that do not use the nonblocking feature, this mapping is available only
when the correct preprocessor has been defined before including spthread.h, as follows:
#define SPT_THREAD_AWARE_PRAGMA
#include <spthread.h>
For C++ applications that use the nonblocking feature, this mapping is available only when the
correct preprocessor has been defined before including spthread.h, as follows:
#define SPT_THREAD_AWARE_PRAGMA_NONBLOCK
#include <spthread.h>
NOTES
To use this function in a threaded application that uses the Standard POSIX Threads library on
systems running J06.10 or later RVUs or H06.21 or later RVUs, you must perform all of the fol-
lowing tasks:
Include the spthread.h header file in the application.
Compile the application using the _SPT_MODEL_ feature test macro or equivalent
compiler command option in addition to any other feature test macros in use.
527186-023 Hewlett-Packard Company 7449