[lkml]   [2009]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [ntpwg] Bug: Status/Summary of slashdot leap-second crash on new years 2008-2009
M. Warner Losh skrev:
> In message: <>
> David Newall <> writes:
> : Linas Vepstas wrote:
> : > Currently, the Linux kernel keeps time in UTC. This means
> : > that it must take special actions to tick twice when a leap
> : > second comes by.
> :
> : Except it doesn't have to tick twice. Refer to
> : in which I show that a time_t (what
> : time() returns) counts leap seconds (According to Bernstein this is what
> : UTC means), and using zoneinfo, the library processes leap seconds
> : correctly.
> This is *NOT* POSIX time_t. In order to be posix compliant, you can't
> do what Bernstein suggests. You can be non-complaint and deal it with
> zoneinfo.

You are free to keep your core time in whatever form you wish, but if
you want your time_t to be POSIX compatible when accessed over POSIX
interfaces you would need to honour the POSIX time_t mapping. While
POSIX tried to avoid the leapsecond issue, the mapping they do perform
has a peculiar effect on what happends on time_t if you also want to
honour the UTC to time_t mapping while accepting UTC from external sources.

> : I just realised that the Notes in man 2 time are confusing and probably
> : unnecessary. Suffice to say that (assuming correctly configured
> : zoneinfo) time() returns the number of seconds elapsed since start 1970.
> That's not POSIX complaint.

It just *appears* to be the number of "seconds" since 1970. This
appearence is important to some and causing a greif to others.


 \ /
  Last update: 2009-01-08 17:55    [W:0.138 / U:3.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site