[LEAPSECS] leap smear

Michael Deckers michael.deckers at yahoo.com
Sun Sep 18 15:04:27 EDT 2011



On 2011-09-18 17:14, Joe Gwinn wrote:


> The handling of leap seconds is not defined in POSIX, which does not

> apply leap seconds. ................................................


POSIX requires that the time_t value returned by time() had
to increase by 3 while UTC increased from 2008-12-31T23:59:58 to
2009-01-01T00:00:01. This interval included a leap second and
was 4 s long, so POSIX arguably must "apply" leap seconds. Moreover,
different flavors of UNIX press these 4 s into 3 units of
time_t (and timeval or timespec) in different ways, as a monotone
and continuous function of TAI.


> ................... The result is that the handling of leap seconds

> depends on some combination of the GPS timeserver providing UTC to the

> computer, [and] the operating-system kernel implementation.


Yes. My point is that POSIX fails to give guidelines on how to
make these time_t (and timeval or timespec) values precisely
understandable to applications, and comparable across systems.
Currently, only struct tm values can be used for that purpose.
No wonder some people want to eliminate future leap seconds --
this would also remove all those problems.

Michael Deckers.


More information about the LEAPSECS mailing list