Re: [chrony-dev] Fw: leap seconds correction

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


On Sun, 9 Feb 2014 10:38:20 -0800 (PST)
Bill Unruh <unruh@xxxxxxxxxxxxxx> wrote:

> On Sun, 9 Feb 2014, Marek Behun wrote:
> 
> >
> > Hi,
> > I think there is a little misunderstanding here. I do not want to
> > not use leap seconds. I fully understand why they are applied and
> > how the systems work now. Again I suggest to read the first post at
> > http://forums.gentoo.org/viewtopic-t-980486.html where this idea is
> > explained more. I want to use another definition of UNIX time.
> >
> > Current definition of UNIX time is this:
> >  the number of seconds that have elapsed since 00:00:00 Coordinated
> >  Universal Time (UTC), Thursday, 1 January 1970, not counting leap
> >  seconds.
> > From Wikipedia: due to its handling of leap seconds, it is neither a
> > linear representation of time nor a true representation of UTC.
> 
> UTC is not TAI. UTC includes leap seconds. Ie, it is discontinuous.
> 
> Unix time is utc except if a second is lost, tnen during the course
> of that second the unix clock always returns a greater time to
> successive requests for time. Ie if there are not requests during
> that time, it returns utc always. If there are more than one, then
> each will return a (slightly) later time.
> 
> >
> > I want to use this redefinition:
> >  number of seconds that have elapsed since 00:00:00 UTC, Thursday, 1
> >  January 1970, *counting leap seconds*.
> 
> 
> 
> Yes, you want TAI, not UTC.
> 
> That is certainly your right.
> 
> >
> > Currently I'm using openrdate with -c flag to do this. This way I
> > can use the right/Europe/Prague timezone and still have the same
> > output of $ date
> > as is on a server with posix/Europe/Prague at that exact moment if
> > that server doesn't use this kind of leap seconds corrections.
> >
> > To conclude: I don't want to remove leap seconds. I want my UNIX
> > time ticks to tick continuosly, so when a leap second occurs, my
> > UNIX time won't stop for one second (or skip one), it will tick
> > normally through that leap second and the right/Europe/Prague
> > timezone will then compute the right time when formatting to human
> > readable form. That way I can for example compute the correct
> > number of seconds elapsed between two events. (And please don't
> > tell me to use CLOCK_MONOTONIC, I am talking about events happening
> > on different machines and this is still an example).
> >
> > The implementation should be trivial: if the flag is present, count
> > the
> 
> It is always nice to tell others that the work you want them to do is
> trivial. If it is, do it. 
> Note it is equally trivial to do this in Userspace. When you want
> coninuous time subtract the seconds and add the number of leap
> seconds from the file. Looking up files should not be occuring on
> system space but in user space. Someday you might persuade Unix to
> adopt TAI rather than UTC. I do not see that as happening soon.
> 
> > number of leap seconds from a leap second database and add that
> > number to the time received from time server. Openrdate does
> > exactly that with -c flag. But openrdate cannot synchronize from
> > more timeservers and uses settimeofday, so time update can still be
> > non-continuous.
> >
> > From the last post on that gentoo forum page:
> >  This idea was presented at the first Future of UTC meeting in 2011,
> >  and the problems faced by Linux kernels were documented at the
> > second meeting in 2013. See http://futureofutc.org/ for the full
> > conference proceedings, and see
> >  http://www.ucolick.org/~sla/leapsecs/right+gps.html for more about
> >  the code that can test this idea.
> >
> > Marek Behun
> >
> 
> 

Hello,
I was thinking about how to do this the best way and I have decided to
write a compatibility library (which will override time
getting/setting system calls with LD_PRELOAD), so the code of
ntp/chrony or any other software that needs to think system clock is
represented in classic POSIX timestamp doesn't need to be changed.
You can find it at https://github.com/elkablo/time2posix .

Marek

Attachment: signature.asc
Description: PGP signature



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/