Okay. Digging through Go's standard library implementation and the syscall surface, I believe the truth is:
Linux's CLOCK_REALTIME counts time as the number of UTC seconds since 1970-01-01 00:00:00 UTC, including leap seconds.
The kernel itself has no awareness of leap seconds, and relies on external synchronization (e.g. NTP) to adjust CLOCK_REALTIME when a leap second happens. As well as adjust its ticking rate to beat close to the metronome of UTC/TAI's clocks.
A userspace synchronizer such as ntpd can also provide the kernel with a TAI offset, in which case CLOCK_TAI will give you TAI time, with none of the leap seconds.
It's not clear to me that any of these return "TAI seconds since UTC Epoch" any more, now that NTP is more or less universal and dragging CLOCK_REALTIME along with UTC. But if the kernel is being fed the TAI offset, it could still comply with posix, by returning CLOCK_TAI+10 whenever it needs a "true" Unix timestamp. I think?
=> More informations about this toot | View the thread | More toots from danderson@hachyderm.io
text/gemini
This content has been proxied by September (3851b).