alarm(S) 6 January 1993 alarm(S) Name alarm - set a process alarm clock Syntax cc . . . -lc unsigned int alarm (seconds) unsigned int seconds; Description The alarm function causes the system to send the calling process a SIGALRM signal after the number of real time seconds has elapsed. If seconds is zero (0), a pending alarm request, if any, is cancelled. Pro- cessor scheduling delays may prevent the process from handling the signal as soon as it is generated. Refer to signal(S) for more information on SIGALRM. alarm requests are not stacked; successive calls reset the alarm clock of the calling process. The fork(S) system call sets the alarm clock of a child process to 0. A process created by the exec(S) family of calls inherits the time left on the old process's alarm clock. See also exec(S), fork(S), getitimer(S), signal(S), sigaction(S) Diagnostics The alarm function is always successful and no return value is reserved to indicate an error. This function returns the amount of time, in seconds, remaining before the system is scheduled to generate the SIGALRM signal from the previous call to alarm, or zero if there was no previous alarm request. Standards conformance alarm is conformant with: X/Open Portability Guide, Issue 3, 1989; IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1); and NIST FIPS 151-1.