[LEAPSECS] Crunching Bulletin B numbers (POSIX time)
Poul-Henning Kamp
phk at phk.freebsd.dk
Mon Feb 21 05:46:42 EST 2011
In message <6C98B1ED-8AF0-4321-99EF-BC57E1F5CA8D at batten.eu.org>, Ian Batten writes
:
>However, with or without leapseconds, Posix time is still monotonic
>both in time_t and , and I would be incredibly dubious of systems
>that perform interval timing using ctime or localtime or gmtime,
>rather than the raw time_t.
time_t is not guaranteed to be monotonic.
If you want a monotonic timestamp nobody messes with, you want to
call clock_gettime(CLOCK_MONOTONIC,...) which returns a timestamp
that is _not_ referenced to any timescale, but which *is* guaranteed
to be monotonic.
>> That is why, we cannot have some POSIX systems inserting leap-seconds in
>> to time_t and some POSIX systems not doing so.
>
>I don't think that's the discussion, is it?
It very much is, without a 10-20 year leap-second horizon, there is no way
we can teach time_t or the time_t successor about leapseconds, and live
up to the POSIX "isolated system" requirement.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
More information about the LEAPSECS
mailing list