]> git.saurik.com Git - apple/xnu.git/blame_incremental - osfmk/man/mapped_tvalspec.html
xnu-7195.60.75.tar.gz
[apple/xnu.git] / osfmk / man / mapped_tvalspec.html
... / ...
CommitLineData
1<h2>mapped_tvalspec</h2>
2<hr>
3<p>
4<strong>Structure</strong> - Specifies the format the kernel uses to maintain a mapped clock's time.
5<h3>SYNOPSIS</h3>
6<pre>
7<strong>struct mapped_tvalspec</strong>
8<strong>{</strong>
9 <strong>tvalspec_t</strong> <var>mtv_time</var><strong>;</strong>
10 <strong>unsigned int</strong> <var>mtv_csec</var><strong>;</strong>
11<strong>};</strong>
12
13<strong>typedef struct mapped_tvalspec mapped_tvalspec_t;</strong>
14</pre>
15<h3>FIELDS</h3>
16<dl>
17<dt> <var>mtv_time</var>
18<dd>
19Clock time.
20<p>
21<dt> <var>mtv_csec</var>
22<dd>
23A field used to synchronize with the kernel's setting of the time.
24</dl>
25<h3>DESCRIPTION</h3>
26<p>
27The <strong>mapped_tvalspec</strong> structure defines the format of the
28current-time structure
29maintained by the kernel and visible through a mapped clock
30(<strong>clock_map_time</strong>). The data in this structure is updated at the
31clock's current resolution and contains the same <strong>tvalspec</strong> value that
32would be returned by <strong>clock_get_time</strong>.
33<h3>NOTES</h3>
34<p>
35Because of the race between the referencing of the multiple fields
36in the clock
37value and the kernel's setting them, they should be referenced as follows:
38<p>
39<pre>
40 <strong>tvalspec_t* ts;</strong>
41 <strong>do</strong>
42 <strong>{</strong>
43 <strong>ts-> tv_sec = mtime -> mtv_time.tv_sec;</strong>
44 <strong>ts -> tv_nsec = mtime -> mtv_time.tv_nsec;</strong>
45 <strong>} while (ts -> tv_sec != mtime -> mtv_csec);</strong>
46</pre>
47<h3>RELATED INFORMATION</h3>
48<p>
49Functions:
50<a href="clock_map_time.html"><strong>clock_map_time</strong></a>,
51<a href="clock_get_time.html"><strong>clock_get_time</strong></a>.
52<p>
53Data Structures:
54<a href="tvalspec.html"><strong>tvalspec</strong></a>.