osfmk/man/mapped_tvalspec.html
Structure - Specifies the format the kernel uses to maintain a mapped clock's time.
**struct mapped\_tvalspec**** { ****tvalspec\_t** mtv\_time **;**** unsigned int **mtv\_csec** ; ****};**** typedef struct mapped\_tvalspec mapped\_tvalspec\_t;**
mtv_timeClock time.
mtv_csecA field used to synchronize with the kernel's setting of the time.
The mapped_tvalspec structure defines the format of the current-time structure maintained by the kernel and visible through a mapped clock ( clock_map_time ). The data in this structure is updated at the clock's current resolution and contains the same tvalspec value that would be returned by clock_get_time.
Because of the race between the referencing of the multiple fields in the clock value and the kernel's setting them, they should be referenced as follows:
**tvalspec\_t\* ts;**** do ****{**** ts-\> tv\_sec = mtime -\> mtv\_time.tv\_sec; ****ts -\> tv\_nsec = mtime -\> mtv\_time.tv\_nsec;**** } while (ts -\> tv\_sec != mtime -\> mtv\_csec);**
Functions: clock_map_time, clock_get_time.
Data Structures: tvalspec.