Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (s and S) spt_pause(2)
NAME
spt_pause - Suspends a thread until a signal is received.
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>
int spt_pause(void)
DESCRIPTION
This function suspends the calling thread until it receives a signal whose action is either to exe-
cute a signal-catching function or to terminate the process. The spt_pause( ) function does not
affect the action taken when the signal is received.
To catch externally-generated signals (such as SIGINT, SIGQUIT, SIGALRM, and SIGCHLD) at
the thread level, you must export the SPT_THREAD_AWARE_SIGNAL environmental variable
to the value 1. By default, SPT_THREAD_AWARE_SIGNAL is disabled.
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
When the received signal cause the calling process to terminate, the spt_pause( ) function does
not return a value. When the signal is caught by the calling thread and control is returned from
the signal- catching function, the calling thread resumes execution from the point of suspension,
the spt_pause() function returns the value -1, and spt_pause() function sets errno to the value
[EINTR].
ERRORS
If the following condition occurs, the spt_pause() function sets errno to this value:
[EINTR] The signal was caught by the calling thread and control was returned from the
signal-catching fucntion.
RELATED INFORMATION
Functions: pause(2), pthread_kill(2), pthread_sigmask(2), sigsuspend(2) spt_sigaction(2),
spt_signal(2), spt_sigsuspend(2).
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-023 Hewlett-Packard Company 7−297