ALARM(3V) — C LIBRARY FUNCTIONS
NAME
alarm − schedule signal after specified time
SYNOPSIS
unsigned int alarm(seconds)
unsigned int seconds;
DESCRIPTION
alarm() sends the signal SIGALRM (see sigvec(2)), to the invoking process after seconds seconds. Unless caught or ignored, the signal terminates the process.
alarm() requests are not stacked; successive calls reset the alarm clock. If the argument is 0, any alarm() request is canceled. Because of scheduling delays, resumption of execution of when the signal is caught may be delayed an arbitrary amount. The longest specifiable delay time is 2147483647 seconds.
The return value is the amount of time previously remaining in the alarm clock.
SEE ALSO
sigpause(2V), sigvec(2), signal(3V), sleep(3V), ualarm(3), usleep(3)
WARNINGS
alarm() is slightly incompatible with the default version of sleep(3V). The alarm signal is not sent when one would expect for programs that wait one second of clock time between successive calls to sleep(). Each sleep() call postpones the alarm signal that would have been sent during the requested sleep period for one second. Use System V sleep(3V) to avoid this delay.
Solbourne Computer, Inc. — 13 Dec 1990