Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
spt_fork(2) OSS System Calls Reference Manual
NAME
spt_fork - Initiates a thread-aware fork() operation
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_fork(void);
PARAMETERS
None.
DESCRIPTION
This is a thread-aware version of the fork() function call that creates a new process from the
current thread.
The following macro maps the spt_fork() call to the fork() funciton and has been defined in the
spthread.h header file:
#define fork() spt_fork().
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.
• Link the application to the zsptdll library (/G/system/zdllnnn/zsptdll).
RETURN VALUES
See the fork(2) reference page.
RELATED INFORMATION
Functions: fork(2).
STANDARDS CONFORMANCE
This function is an extension to the UNIX98 specification. Interfaces documented on this refer-
ence page conform to the following industry standards:
• IEEE Std 1003.1c-1995, POSIX System Application Program Interface
The use of the header file spthread.h is an HP exception to the POSIX standard.
7−204 Hewlett-Packard Company 527186-023