alarm(2) — SYSTEM CALLS
NAME
alarm − set a process alarm clock
SYNOPSIS
#include <unistd.h>
unsigned alarm(unsigned sec);
DESCRIPTION
alarm instructs the alarm clock of the calling process to send the signal SIGALRM to the calling process after the number of real time seconds specified by sec have elapsed [see signal(2)].
Alarm requests are not stacked; successive calls reset the alarm clock of the calling process.
If sec is 0, any previously made alarm request is canceled.
fork sets the alarm clock of a new process to 0 [see fork(2)]. A process created by the exec family of routines inherits the time left on the old process’s alarm clock.
SEE ALSO
fork(2), exec(2), pause(2), signal(2), sigset(2), sleep(3C), Machine Monitoring and Tuning
DIAGNOSTICS
alarm returns the amount of time previously remaining in the alarm clock of the calling process.
NOTE
alarm is implemented using a 1 second interval timer. In order to provide some minimum level of accuracy, two system tunable parameters are provided in the kernel master.d file. The tunables are ALARM_ACCURACY and ALARM_TENTHS_OF_SECOND. The default configuration provides alarms of 1 second with a minimum value of .5 seconds.