4 <strong>System Trap
</strong> - Sleep until a given time.
7 <strong>kern_return_t clock_sleep
</strong>
8 <strong>(mach_port_t
</strong> <var>clock_name
</var>,
9 <strong>sleep_type_t
</strong> <var>sleep_type
</var>,
10 <strong>tvalspec_t
</strong> <var>sleep_time
</var>,
11 <strong>clock_name
</strong> <var>wake_time
</var><strong>);
</strong>
16 <dt><var>clock_name
</var>
18 [in clock-name send right] The name (or control) port for the clock.
20 <dt><var>sleep_type
</var>
22 [in scalar] How to interpret the sleep_time value:
25 <dt><strong>TIME_RELATIVE
</strong>
27 Interpret the sleep time as relative to the current time.
29 <dt><strong>TIME_ABSOLUTE
</strong>
31 Interpret the sleep time as an absolute time.
34 <dt><var>sleep_time
</var>
36 [in structure] The time when the sleep is to terminate.
38 <dt><var>wake_time
</var>
40 [out structure] The actual (absolute) time at which the sleep terminated.
45 The
<strong>clock_sleep
</strong> system trap delays the invoking
46 thread until a specified time. This sleep may be aborted by
47 <strong>thread_abort
</strong>. Not all clocks provide this service
48 but the REALTIME clock must.
50 If the specified time is in the past, the call returns immediately
51 with the wake time being the current time. If the clock's time is
52 changed (
<strong>clock_set_time
</strong>), the sleep will be
53 interrupted. The thread will waken at the service time nearest the
54 specified sleep time as governed by the current clock alarm
56 <h3>RETURN VALUES
</h3>
59 <dt> <strong>KERN_FAILURE
</strong>
61 The clock does not support a sleep service.
63 <dt> <strong>KERN_ABORTED
</strong>
65 The sleep was interrupted by thread_abort or terminated via use of
68 <h3>RELATED INFORMATION
</h3>
71 <a href=
"host_get_clock_service.html"><strong>host_get_clock_service
</strong></a>,
72 <a href=
"clock_get_attributes.html"><strong>clock_get_attributes
</strong></a>,
73 <a href=
"clock_get_time.html"><strong>clock_get_time
</strong></a>,
74 <a href=
"clock_alarm.html"><strong>clock_alarm
</strong></a>,
75 <a href=
"clock_set_time.html"><strong>clock_set_time
</strong></a>,
76 <a href=
"thread_abort.html"><strong>thread_abort
</strong></a>,