Back to Darwin Xnu

Clock Alarm

osfmk/man/clock_alarm.html

latest1.8 KB
Original Source

clock_alarm


Function - Set off an alarm.

SYNOPSIS

**kern\_return\_t clock\_alarm**** (clock\_t **clock\_name,** alarm\_type\_t **alarm\_type,** tvalspec\_t **alarm\_time,** mach\_port\_t **alarm\_reply\_port** );**

PARAMETERS

clock_name[in clock-name send right] The name (or control) port for the clock.

alarm_type[in scalar] How to interpret the alarm_time value:

TIME_RELATIVE Interpret the alarm time as relative to the current time.

TIME_ABSOLUTE Interpret the alarm time as an absolute time.

alarm_time[in structure] The time when the alarm is to be sent.

alarm_reply_port[in alarm receive (to be converted to send-once) right] A port into which the alarm message is to be sent.

DESCRIPTION

The clock_alarm function requests that a clock send an alarm message to a specified port at a given future time. The alarm message is specified by the clock_alarm_reply server interface.

NOTES

If the specified alarm time is in the past, the alarm message is sent immediately and time-stamped with the current time. Otherwise, the alarm is queued and delivered at the specified alarm time and time-stamped at that time.

The alarm will be serviced at the service time nearest the specified alarm time as governed by the current clock alarm resolution.

Not all clocks implement this service, but the REALTIME clock must. If the clock does not provide this service, this call is ignored.

RETURN VALUES

Only generic errors apply.

Functions: host_get_clock_service, clock_get_attributes, clock_get_time, clock_sleep, clock_alarm_reply.

Data Structures: tvalspec.