ualarm()

generate SIGALRM signal after specified time 

Function


SYNOPSIS

#include <unistd.h>

useconds_t ualarm(useconds_t useconds, useconds_t interval);


DESCRIPTION

The ualarm() function causes the system to generate a SIGALRM signal after the number of real-time microseconds (specified by useconds) has elapsed. Repeated timeout notifications then occur every interval microseconds, if this parameter is non-zero. Processor scheduling delays may prevent the process from handling the signal as soon as it is generated.

Alarm requests are not stacked; only one SIGALRM generation can be scheduled in this way. Successive calls reset the alarm clock of the calling process.

If useconds is zero, any previously made alarm request is cancelled. fork() sets the alarm clock of a new process to zero. The exec() family of routines creates a process that inherits the time left on the old process's alarm clock.


PARAMETERS

seconds 

Specifies the number of real-time (as opposed to CPU-time) seconds that must elapse before the system sends the calling process a SIGALRM signal. If this parameter is 0, any pending alarm request is cancelled.


RETURN VALUES

If there is a previous ualarm() request with time remaining, ualarm() returns a non-zero value that is the number of microseconds until the previous request would have generated a SIGALRM signal. Otherwise, ualarm() returns 0.


CONFORMANCE

UNIX 98.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

ularm() is implemented in terms of setitimer().

On 10/2016/2019/11/2022/2025, waitable timers with 100-nanosecond resolution are available, so ualarm() has microsecond accuracy.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
alarm(), execl(), execle(), execlp(), execlpe(), execv(), execve(), execvp(), execvpe(), nanosleep(), nap(), pause(), setitimer(), sigaction(), signal(), sleep()


PTC MKS Toolkit 10.5 Documentation Build 40.