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

System Functions (s and S) spt_usleep(2)
NAME
spt_usleep - Suspends execution of the thread for a specified number of microseconds
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_usleep(
unsigned int useconds);
PARAMETERS
useconds Specifies the number of microseconds for which the thread is to be suspended.
The value specified must be less than or equal to 1000000.
DESCRIPTION
The spt_usleep() function suspends a thread for a specified number of microseconds. A certain
amount of delay can be expected in the processing of the spt_usleep() call because of other
processor-intensive or input/output-intensive threads.
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
The spt_usleep() function returns the value 0 (zero) when the call completes successfully. Oth-
erwise, spt_usleep() returns -1 and sets errno.
ERRORS
If the following condition occurs, spt_usleep() sets errno to the corresponding value:
[EINTR] A pthread_kill() function call received a signal that is not blocked, ignored, or
handled.
[EINVAL] The value specified for the useconds parameter was greater than 1000000.
RELATED INFORMATION
Functions: spt_sleep(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.
527186-023 Hewlett-Packard Company 7441