Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)

alarm(3) Guardian Native C Library Calls Reference Manual
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 Species 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 sys-
tem maximum without informing the caller.
DESCRIPTION
The alarm() function is used to obtain notication of a timeout after the number of real-time
seconds specied by the seconds parameter have elapsed.
When the number of seconds specied 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
conicts.
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 undened 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 specication:
A SIGLIMIT signal is delivered to the process if the function call fails.
112 Hewlett-Packard Company 527192-007