Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)
Guardian Native C Library Calls (a - e) alarm(3)
NAME
alarm - Sets or changes the timeout value for interval timers
LIBRARY
G-series native Guardian processes: system library
G-series native OSS processes: system library
H-series native Guardian processes: implicit libraries
H-series OSS processes: implicit libraries
SYNOPSIS
#include <unistd.h>
unsigned int alarm(
unsigned int seconds);
PARAMETERS
seconds Specifies the number of real-time seconds before the timer expires. Any value
greater than the system maximum of 0x7FFFFFFF one-hundredths of a second
is reduced to the system maximum without informing the caller.
DESCRIPTION
The alarm() function is used to obtain notification of a timeout after the number of real-time
seconds specified by the seconds parameter have elapsed.
When the number of seconds specified by the seconds parameter have elapsed, a SIGALRM sig-
nal is sent to the process. The receipt of this signal might be delayed because of scheduling
conflicts.
Each call to alarm() overrides any previous setting. Calling alarm() with the value 0 (zero) in
the seconds parameter cancels the timer.
Use From the Guardian Environment
The actions of this function are undefined if it is called from a TNS or accelerated Guardian pro-
cess or from any privileged process.
RETURN VALUES
The alarm() function returns the number of seconds remaining from the previous alarm() call,
if any. Otherwise, the alarm( ) function returns 0 (zero).
ERRORS
The alarm() function never sets the value of errno. However, if the function call is unsuccess-
ful (for example, if the system has no time-list elements, or TLEs, available), then a nondeferr-
able SIGLIMIT signal is delivered to the process.
RELATED INFORMATION
Functions: sigaction(2), signal(3), sleep(3).
Files: signal(4).
STANDARDS CONFORMANCE
The following are HP extensions to the XPG4 Version 2 specification:
• A SIGLIMIT signal is delivered to the process if the function call fails.
527192-005 Hewlett-Packard Company 1−9