A final system call related to signals is called alarm(). The prototype for this call is:
#include <unistd.h> long alarm(long secs);
Each process has an alarm clock timer associated with it which it can use to send itself SIGALRM signals after preset amounts of time have elapsed. The alarmo call takes a single parameter (secs), which is the number of seconds to elapse before the alarm goes off. If a value of zero is passed to alarm() then this will switch off any currently running alarm timer.
The return value from alarm() is the previous alarm timer value. This will be zero if no timer is currently set, or the time which remained in the clock when the call was made.