[tz] POSIX epoch in the news?

Guy Harris guy at alum.mit.edu
Mon Feb 15 13:48:16 UTC 2016


On Feb 15, 2016, at 5:34 AM, Brian Inglis <Brian.Inglis at systematicsw.ab.ca> wrote:

> I would hope by now that Mach is using POSIX standard struct timespec in ns rather than still using the old struct timeval in us.

The version of Mach inside XNU isn't using either one at the lowest level.  It's using a uint64_t with platform-dependent units.  (It looks as if the units are nanoseconds on x86; I don't know what they are on ARM.)

That value can be converted to unsigned-seconds-and-unsigned-microseconds with absolutetime_to_microtime(), or to nanoseconds-since-the-Epoch with absolutetime_to_nanoseconds().

Inside the "BSD" part of the kernel, struct timeval, with a signed time_t for seconds, is still used in some places.


More information about the tz mailing list