Provide a clock through clock_gettime() that returns the current TAI time (UTC without leap seconds) as a complement to CLOCK_REALTIME. This provides compatibility with Linux, which also provides a CLOCK_TAI, and this seems to be becoming the standard way to acquire TAI time. Unlike Linux, this code will return EINVAL if the TAI offset (set by ntpd, ptpd, etc.) is not known since it seems pathological for CLOCK_TAI to silently give the wrong (UTC) time if the offset is not known as it does on Linux.
When using the feed-forward clock framework, this should handle the period during a leap second gracefully. Using the normal feedback clocks, because of the way NTP adjusts the kernel time, and that the kernel time is UTC, there is a potential for brief glitches at the moment of a leap second. I did not see any obvious way to fix this, but would very much appreciate any thoughts on how to avoid such glitches.