[time-nuts] Leap seconds and POSIX

Magnus Danielson magnus at rubidium.dyndns.org
Fri Jan 2 03:35:59 EST 2009


Joe Gwinn skrev:
> Having worked in the POSIX committee for many years, I can shed some 
> light on how POSIX handles leap seconds:
> 
> In short, POSIX adamantly ignores leap seconds.  All days in POSIX 
> have the same length, 86,400 seconds.
> 
> This omission is not by accident, instead having been violently 
> debated at length, and voted upon.
> 
> The rationale is that one cannot assume that all POSIX systems have 
> access to leap second information, or even the correct time, and yet 
> must work in a reasonable manner.  In particular, file modification 
> timestamps must allow one to determine causal order (to within one 
> second in the old days) by comparison of timestamps.  (Yes, people do 
> realize that timestamps are not the perfect way to establish causal 
> order, but are nonetheless widely used in non-critical applications. 
> Critical applications instead use some kind of atomic sequence-number 
> scheme.)
> 
> So, at least in theory, POSIX time is a form of TAI, having a 
> constant offset from TAI.
> 
> In practice, in platforms that have access to GPS, NTP is used to 
> servo the local computer clock into alignment with UTC (or GPS System 
> Time (UTC without the accumulated leaps) in systems that abhor time 
> steps), and there is a transient error just after a leap second while 
> NTP recovers.

The problem with the POSIX time is that it can't be UTC but fails to 
identify itself as either TAI, UT1 or even UT2. If it clearly identified 
itself as being one of those, or similar (say GPS time) then things 
would be much improved. However, it is being interprented as being UTC 
which it fails to handle. I think the UT1 and UT2 alternatives would be 
best suited.

I don't mind that the default time in POSIX remains there, but I don't 
think it helps that there is no way to get propper UTC time by a 
standardized interface.

Attempting to say "It's UTC, except on leap seconds" is not a workable 
solution if you are locked up and a leap-second do occur. It only works 
if you are not locked up and free runs on whatever you have. However, 
more and more systems actually needs to be locked up and they may also 
need to have propper UTC. We see needs to have logs in UTC and 
coordinated over many countries and time-zones.

This is not only a matter of how we deal with leap-seconds, but how we 
deal with time. We need to be able to actually deal with propper UTC 
regardless, and we need to know it is UTC "traceable" (in a wider sense 
most of the time, but occasionally in propper sense) or not.

I find the current situation unsatisfactory.

Cheers,
Magnus




More information about the time-nuts mailing list