xref: /xnu-10002.1.13/osfmk/man/clock_set_time.html (revision 1031c584a5e37aff177559b9f69dbd3c8c3fd30a)
1*1031c584SApple OSS Distributions<h2>clock_set_time</h2>
2*1031c584SApple OSS Distributions<hr>
3*1031c584SApple OSS Distributions<p><strong>Function</strong> - Set the current time.
4*1031c584SApple OSS Distributions<h3>SYNOPSIS</h3>
5*1031c584SApple OSS Distributions<pre>
6*1031c584SApple OSS Distributions<strong>kern_return_t   clock_set_time</strong>
7*1031c584SApple OSS Distributions                <strong>(clock_ctrl_t</strong>                     <var>clock_control</var>,
8*1031c584SApple OSS Distributions                 <strong>tvalspec_t</strong>                            <var>new_time</var><strong>);</strong>
9*1031c584SApple OSS Distributions</pre>
10*1031c584SApple OSS Distributions<h3>PARAMETERS</h3>
11*1031c584SApple OSS Distributions<dl>
12*1031c584SApple OSS Distributions<p>
13*1031c584SApple OSS Distributions<dt> <var>clock_control</var>
14*1031c584SApple OSS Distributions<dd>
15*1031c584SApple OSS Distributions[in clock-control send right]
16*1031c584SApple OSS DistributionsThe control port for the clock.
17*1031c584SApple OSS Distributions<p>
18*1031c584SApple OSS Distributions<dt> <var>new_time</var>
19*1031c584SApple OSS Distributions<dd>
20*1031c584SApple OSS Distributions[in structure]
21*1031c584SApple OSS DistributionsNew time
22*1031c584SApple OSS Distributions</dl>
23*1031c584SApple OSS Distributions<h3>DESCRIPTION</h3>
24*1031c584SApple OSS Distributions<p>
25*1031c584SApple OSS DistributionsThe <strong>clock_set_time</strong> function sets the time kept by a
26*1031c584SApple OSS Distributionsclock.  Setting the clock
27*1031c584SApple OSS Distributionstime will cause all pending clock alarms and sleeps to be terminated with
28*1031c584SApple OSS Distributionstimestamps set to the current clock time just prior to the new
29*1031c584SApple OSS Distributionstime being set with a
30*1031c584SApple OSS Distributionsreturn code of <strong>KERN_ABORTED</strong>.
31*1031c584SApple OSS Distributions<h3>CAUTIONS</h3>
32*1031c584SApple OSS Distributions<p>
33*1031c584SApple OSS DistributionsThe use of this function is \*Vstrongly discouraged\*O since it could affect the
34*1031c584SApple OSS Distributionsmonotonically increasing nature of the clock.
35*1031c584SApple OSS Distributions<h3>RETURN VALUES</h3>
36*1031c584SApple OSS Distributions<p>
37*1031c584SApple OSS DistributionsOnly generic errors apply.
38*1031c584SApple OSS Distributions<h3>RELATED INFORMATION</h3>
39*1031c584SApple OSS Distributions<p>
40*1031c584SApple OSS DistributionsFunctions:
41*1031c584SApple OSS Distributions<a href="host_get_clock_control.html"><strong>host_get_clock_control</strong></a>,
42*1031c584SApple OSS Distributions<a href="clock_set_attributes.html"><strong>clock_set_attributes</strong></a>,
43*1031c584SApple OSS Distributions<a href="clock_get_time.html"><strong>clock_get_time</strong></a>,
44*1031c584SApple OSS Distributions<a href="clock_alarm.html"><strong>clock_alarm</strong></a>,
45*1031c584SApple OSS Distributions<a href="clock_sleep.html"><strong>clock_sleep</strong></a>.
46*1031c584SApple OSS Distributions<p>
47*1031c584SApple OSS DistributionsData Structures:
48*1031c584SApple OSS Distributions<a href="tvalspec.html"><strong>tvalspec</strong></a>.
49