schedule SIGALRM delivery
function schedules the
SIGALRM signal for delivery
to the calling process after the given number of
seconds have elapsed.
If an alarm is already pending, another call to
will supersede the prior call.
If seconds is zero, any pending alarm is cancelled.
alarm() returns the number of seconds
remaining until the pending alarm would have expired. If the alarm has
already expired, the alarm was cancelled, or no alarm was ever scheduled,
alarm() returns zero.
setitimer(2), sigaction(2), sigsuspend(2), signal(3), sleep(3), ualarm(3)
alarm() function conforms to
IEEE Std 1003.1-2008 (“POSIX.1”).
alarm() system call first appeared
outside of Bell Labs in the “50 changes” tape for
Version 6 AT&T UNIX. It was first
officially released with PWB/UNIX 1.0. For 4.1cBSD,
it was reimplemented as a wrapper around the
setitimer(2) system call.
alarm() function is implemented with
ITIMER_REAL timer described in
setitimer(2). Use of both
setitimer(2) in the same program may yield confusing behavior.