ualarm

Sets or changes the timeout of interval timers.

Format

#include  <unistd.h>

useconds_t ualarm  (useconds_t mseconds, useconds_t
                   interval);

Arguments

mseconds
Specifies a number of real time microseconds.
interval
Specifies the interval for repeating the timer.

Description

This function causes the SIGALRM signal to be generated for the calling process after the number of real-time microseconds specified by useconds has elapsed. When the interval argument is nonzero, repeated timeout notification occurs with a period in microseconds specified by interval. If the notification signal SIGALRM is not caught or is ignored, the calling process is terminated.

If you call a combination of ualarm and setitimer functions, and the AST status is disabled, the return value is invalid.

If you call a combination of ualarm and setitimer functions, and the AST status is enabled, the return value is valid.

This is because you cannot invoke an AST handler to clear the previous value of the timer when ASTs are disabled or invoked from a handler that was invoked at AST level.


Note
Interactions between ualarm and either alarm, or sleep are unspecified.

See also setitimer in this section.

Return Values
The number of microseconds remaining from the previous ualarm or setitimer call. 
No timeouts are pending or ualarm not previously called. 
-1  Indicates an error. 


Previous Page | Next Page | Table of Contents | Index