Standards / Extensions | C or C++ | Dependencies |
---|---|---|
XPG4.2 |
both | POSIX(ON) |
#define _XOPEN_SOURCE_EXTENDED 1
#include <unistd.h>
useconds_t ualarm(useconds_t uscs, useconds_t intrval)
The ualarm() function causes the SIGALRM signal to be generated for the calling process after the number of real-time microseconds specified by the uscs argument has elapsed. When the intrval argument is nonzero, repeated timeout notification occurs with a period in microseconds specified by the intrval argument. If the notification signal, SIGALRM, is not caught or ignored, the calling process is terminated.
The ualarm() function is a simplified interface to setitimer() and uses the ITIMER_REAL interval timer.
ualarm() returns the number of microseconds remaining from the previous ualarm(), alarm(), or setitimer(ITIMER_REAL) call.
If no timeouts are pending, ualarm() returns 0.
No errnos are defined for the ualarm() function.