Back to Darwin Xnu

Mapped Tvalspec

osfmk/man/mapped_tvalspec.html

latest1.3 KB
Original Source

mapped_tvalspec


Structure - Specifies the format the kernel uses to maintain a mapped clock's time.

SYNOPSIS

**struct mapped\_tvalspec**** { ****tvalspec\_t** mtv\_time **;**** unsigned int **mtv\_csec** ; ****};**** typedef struct mapped\_tvalspec mapped\_tvalspec\_t;**

FIELDS

mtv_timeClock time.

mtv_csecA field used to synchronize with the kernel's setting of the time.

DESCRIPTION

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.

NOTES

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.