Open System Services System Calls Reference Manual (G06.28+, H06.05+)
System Functions (s and S) spt_system(2)
NAME
spt_system - Initiates thread-aware system( ) function
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
#include <spthread.h>
int spt_system(
const char *command);
PARAMETERS
See the system(3) reference page.
DESCRIPTION
This is a thread-aware version of the system() function. All threads in the process are tem-
porarily blocked while the child process, which performs the system( ) call, is created.
In spthread.h, a mapping of system() to spt_system() has been defined:
#define system(command) spt_system(command)
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>
RETURN VALUES
See the system(3) reference page. Also, if a signal is received via the pthread_kill() function
and is not blocked, ignored, or handled, -1 is returned with an errno value of [EINTR].
STANDARDS CONFORMANCE
This function is an extension to the XPG4 Version 2 specification. Interfaces documented on this
reference 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.
527186-007 Hewlett-Packard Company 7−323