Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
spt_sleep(2) OSS System Calls Reference Manual
NAME
spt_sleep - Suspends execution of the thread for a specified time interval
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>
unsigned int spt_sleep(
unsigned int seconds);
PARAMETERS
seconds Specifies the number of seconds for which the thread is to be suspended.
DESCRIPTION
The spt_sleep() function suspends a thread for a specified number of seconds. A certain amount
of delay can be expected in the processing of the spt_sleep() call because of other processor-
intensive or input/output-intensive threads. If an unblocked signal is received during the suspen-
sion period, spt_sleep() returns control immediately and returns the sleep time remaining.
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
This function can return the following values:
0 (zero) The thread was suspended for the full time specified.
seconds Indicates the number of seconds remaining in the specified suspension time.
RELATED INFORMATION
Functions: spt_usleep(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−424 Hewlett-Packard Company 527186-023