Go to the first, previous, next, last section, table of contents.


alarm

Syntax

#include <unistd.h>

unsigned alarm(unsigned seconds);

Description

This function causes the signal SIGALRM to be raised in seconds seconds. A value of zero for seconds cancels any pending alarm. If an alarm has previously been set, the new alarm delay will superceed the prior call.

Return Value

The number of seconds remaining on the timer (i.e. always seconds).

Portability

not ANSI, POSIX

Example

signal(SIGALRM,my_alarm_routine);
alarm(5);


Go to the first, previous, next, last section, table of contents.