Thorsten Glaser wrote:
exactly 22 leap seconds until then (since 1970-01-01), so if we treat both 48 and 26 as correct, will this be sufficient?
Until the next leap second occurs, yes. But it seems like there won't be another for a few semesters at the moment, dur to changing earth rotation.
But leap seconds are not inserted into the past, I suppose. As I said, it tests a fixed date (1999-11-29, for no particular reason, I think it was when the test was originally written), and the number of leap seconds between 1970-01-01 and 1999-11-29 should not change anymore. Any leap second inserted now or in the future is outside of this interval.
(As to POSIX: it makes impossible to determine age of something or duration of an event; also, if you need UTC (instead of TAI) to be displayed, using xntpd for example, your clock jumps for- and backwards instead of being monotonic, which is required for precision time- and logkeeping - but I doubt it's on topic)
If it jumps, it's indeed bad. I read somewhere that the clock is adjusted to run a bit slower or faster for a short time in order to remain monotonic. I don't remember exactly where I read it, but I'd have thought these programs do the same. BTW, monotonic clocks are also required for things like make (which brings us back near the original topic ;-).
Frank