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

OSS Library Calls (s) sleep(3)
sleep( ) function. The newly scheduled signal is not affected by the return from the sleep( ) func-
tion.
The effect of a SIGALRM signal is not changed if the process exits a sleep( ) function call by
using the siglongjmp( ) or longjmp( ) function. Whether the signal is blocked depends on the
value of the signal mask when the corresponding sigsetjmp( ) function was called.
NOTES
To use the sleep( ) functionality in a threaded application that uses the Standard POSIX Threads
library, see spt_sleep(2).
To use this function in a threaded application that uses the POSIX User Thread Model library on
systems running H06.21 or later RVUs or J06.10 or later RVUs, you must perform all of the fol-
lowing tasks to make the function thread-aware in a multi-threaded application:
Compile the application using the _PUT_MODEL_ feature test macro or equivalent
compiler command option.
Link the application to the zputdll library (/G/system/zdllnnn/zputdll).
On systems running H06.24 or later H-series RVUs or J06.13 or later J-series RVUs, you can use |
this function with 32-bit or 64-bit threaded applications.
To use this function in a 32-bit threaded application on systems running H06.24 or later RVUs or |
J06.13 or later RVUs, perform the same tasks (described above) used to make the function |
thread-aware in a multi-threaded application on systems running H06.21/J06.10 or later RVUs.
To use this function in a 64-bit threaded application on systems running H06.24 or later RVUs or |
J06.13 or later RVUs, you must perform all of the following tasks to make the function thread- |
aware in a multi-threaded application:
Compile the application using the _PUT_MODEL_ feature test macro or equivalent |
compiler command option.
Compile the application using the -Wlp64 compiler command option. |
Link the application to the yputdll library (/G/system/zdllnnn/yputdll). |
For detailed information about writing multi-threaded and 64-bit applications for the Open Sys- |
tem Services environment, see the Open System Services Programmers Guide.
RETURN VALUES
If the sleep() function returns because the requested time has elapsed, the value 0 (zero) is
returned. If the sleep( ) function returns because a signal was caught, the number of seconds still
remaining when the signal was delivered is returned.
ERRORS
If a signal is received via pthread_kill( ) and is not blocked, ignored, or handled, EOF is returned
with an errno of [EINTR].
RELATED INFORMATION
Functions: alarm(3), pause(3), sigaction(2), spt_sleep(2), usleep(3).
STANDARDS CONFORMANCE
The POSIX standards leave some features to the implementing vendor to define. The following
features are affected in the HP implementation:
The SIGALRM signal does not terminate the sleep( ) function if the signal is blocked or
ignored.
527187-017 Hewlett-Packard Company 673