hrtalarm(3C) hrtalarm(3C)
NAME
hrtalarm - high resolution timer alarm
SYNOPSIS
#include <sys/hrtcntl.h>
int hrtalarm(hrtcmdt *cmdp, int cmds);
DESCRIPTION
hrtalarm() provides an interface for the alarm function of high reso-
lution or interval timers. cmds determines the number of commands for
the system call.
The following hrtcmd structure is defined in <sys/hrtcntl.h> and is
used by hrtalarm():
typedef struct hrtcmd {
int hrtccmd; /* A timer command */
int hrtcclk; /* Which clock to use */
hrtimet hrtcint; /* A time interval */
hrtimet hrtctod; /* A time of day */
int hrtcflags; /* Various flags */
int hrtcerror; /* An error code */
ecbt hrtcecb; /* An event control block */
} hrtcmdt;
hrtccmd supports the following command types:
HRTBSD
Starts a timer and sends an alarm signal when the time
elapses.
HRTRBSD
Sends an alarm signal again when the time elapses.
HRTBSDREP
Sends an alarm signal again when the time elapses depending
on the setting in the hrtctod field.
HRTBSDPEND
Calculates the remaining time before the alarm will be
issued.
HRTBSDCANCEL
Removes an alarm from the queue.
hrtcclk determines the clock type and signal issued with the HRTBSD
and HRTRBSD commands:
CLKSTD
Standard real time clock. The SIGALRM signal is sent to the
process when the set time elapses.
Page 1 Reliant UNIX 5.44 Printed 11/98
hrtalarm(3C) hrtalarm(3C)
CLKUSERVIRT
Clock measuring process virtual time (user mode). The
SIGVTALRM signal is sent to the process when the set time
elapses.
CLKPROCVIRT
Clock measuring process virtual time and when the system is
running on behalf of the process (user and system mode). The
SIGPROF signal is sent to the process when the set time
elapses.
hrtcint determines the time interval, the time resolution and the
fraction of the second.
RESULT
hrtalarm() returns the number of successfully executed calls. For each
executed command hrtcerror contains the error code or 0.
EINVAL cmds is not positive.
EINVAL Unknown timer command.
EINVAL Illegal hrtcclk value.
EFAULT cmdp points outside the allocated address space of the pro-
cess.
ENOPKG The timer command is not supported.
ERANGE Value of hrtcint is less 0 or the interval is to small.
EAGAIN All timer structures are currently used.
NOTES
The hrtsleep() and hrtcancel() functions are not supported and simply
return the error ENOPKG.
SEE ALSO
signal(2), getitimer(3C), hrtcntl(3C).
Page 2 Reliant UNIX 5.44 Printed 11/98