libgslutil
1.2.3
|
Functions | |
int | safe_sleep_fixed (int s, int ns) |
Sleep for fixed period of time. More... | |
These routines are similar to sleep(3)
but more convenient.
int safe_sleep_fixed | ( | int | s, |
int | ns | ||
) |
Sleep for fixed period of time.
s | Number of seconds to sleep for. |
ns | Number of nanoseconds to sleep for. |
0 | on success. |
-1 | on error (and see errno). |
This function performs a simple, fixed sleep. It is implemented with nanosleep(2)
internally. It will restart the sleep with the remainder of time in the case of signals. It is not very accurate.
It should only ever fail with EINVAL
, and then only if s or ns is not in the valid range.