Query: dtk_nanosleep
OS: debian
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
DTK_NANOSLEEP(3) Draw Toolkit manual DTK_NANOSLEEP(3)NAMEdtk_nanosleep - high-resolution sleepSYNOPSIS#include <dtk_time.h> int dtk_nanosleep(int abs, const struct dtk_timespec* req, struct dtk_timespec* rem);DESCRIPTIONThe function dtk_nanosleep() allows the caller to sleep for an interval with nanosecond precision. If the argument abs is zero, the speci- fied interval is interpretated as a relative value, otherwise an absolute value. The interval is specified by the req argument which is a pointer to a dtk_timespec structure defined as: struct dtk_timespec { long sec; /* seconds */ long nsec; /* nanoseconds */ }; If interpreted as an absolute value, it represents seconds and nanoseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). dtk_nanosleep() suspends the execution of the calling thread until either at least the time specified by req has elapsed, or a signal is delivered that causes a signal handler to be called or that terminates the process. If the call is interrupted by a signal handler, dtk_nanosleep() returns -1, and sets errno to EINTR. In addition, if rem is not NULL, and abs is zero, it returns the remaining unslept time in rem. This value can then be used to call dtk_nanosleep() again and complete a (rela- tive) sleep.RETURN VALUEOn successfully sleeping for the requested interval, dtk_nanosleep() returns 0. If the call is interrupted by a signal handler or encoun- ters an error, then it returns -1 and errno is set appropriately.ERRORSdtk_nanosleep() will fail if: EINTR The sleep was interrupted by a signal handler. EINVAL The value in the nsec field was not in the range 0 to 999999999 or sec was negative.NOTEThis function is a wrapper to clock_nanosleep(2) if it is provided by the system. Otherwise, it implements the function by using the sleep function with the highest precision available on the system.SEE ALSOdtk_nanosleep(3), clock_nanosleep(2)EPFL2011 DTK_NANOSLEEP(3)
Related Man Pages |
---|
nanosleep(2) - redhat |
clock_nanosleep(2) - linux |
clock_nanosleep(2) - debian |
clock_nanosleep(2) - suse |
nanosleep(2) - hpux |
Similar Topics in the Unix Linux Community |
---|
Capture running process or 2 hours with an interval of 10 sec |
Capture running process for 2 hours with an interval of 10 sec |