From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4387 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCHv2] Add support for leap seconds in zoneinfo files Date: Sat, 7 Dec 2013 05:02:06 +0100 Message-ID: <20131207040205.GE1685@port70.net> References: <52A0AA6A.60608@skarnet.org> <20131205164022.GK24286@brightrain.aerifal.cx> <52A11C0D.1080705@skarnet.org> <20131206004535.GT24286@brightrain.aerifal.cx> <52A12548.80508@skarnet.org> <20131206053146.GC1685@port70.net> <52A1AB77.3060100@skarnet.org> <52A25DDD.70400@skarnet.org> <20131207023114.GK24286@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1386388934 12501 80.91.229.3 (7 Dec 2013 04:02:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Dec 2013 04:02:14 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4391-gllmg-musl=m.gmane.org@lists.openwall.com Sat Dec 07 05:02:21 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Vp95u-0004gd-LE for gllmg-musl@plane.gmane.org; Sat, 07 Dec 2013 05:02:18 +0100 Original-Received: (qmail 18237 invoked by uid 550); 7 Dec 2013 04:02:17 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 18229 invoked from network); 7 Dec 2013 04:02:17 -0000 Content-Disposition: inline In-Reply-To: <20131207023114.GK24286@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:4387 Archived-At: * Rich Felker [2013-12-06 21:31:14 -0500]: > On Fri, Dec 06, 2013 at 11:29:33PM +0000, Laurent Bercot wrote: > > On 06/12/2013 11:38, Raphael Cohn wrote: > > >Date and time match has been got wrong in every system > > >(...) > > >Personally, I think apps should just use a monotonic source of seconds > > > from an epoch, and use a well-developed third party lib dedicated to > > > the problem if they need date math (eg Joda time in Java). > > > > I absolutely agree with you on the first part. I disagree on the second > > part. Dealing with time shouldn't be a burden on the application - devs > > have other things to think about, and experience shows that most of them > > won't care, they'll just use the primitives provided by the system. So, > > the system should do the right thing, i.e. provide something that works > > no matter how applications are using it. Here, it means providing a > > linear CLOCK_REALTIME, because people use it as if it were CLOCK_MONOTONIC. > > If that's your only goal, it's easily achieved without storing TAI-10 > in the CLOCK_REALTIME clock, assuming by "linear" you just mean > "monotonic, continuous, and accurate within the margin of measurement > error". Discontinuous jumps and non-monotonicity in CLOCK_REALTIME > were a monstrosity invented by the NTPD folks in their implementation > for mapping TAI onto POSIX time, not any fundamental requirement. it's worse than that, the proposed solution does put a burden on userspace (unix time can no longer be used to calculate or represent dates) while with the standard 1 day == 86400 s apps and admins do not even need to know about leapseconds (only the time daemon and kernel) about linearity: if you only smooth out a leapsecond in the month it was inserted, then a unix second would be about 30*86400/(30*86400+1)-1 = -0.386 ppm (= 386ns) shorter than a SI second in that month, by comparision (according to the ntp clock quality faq) the oscillator used by most hw usually have more than 1 ppm frequency error and it can change 1 ppm/C when heated up if no temperature correction is done, so apps already have to deal with larger errors and the smoothing logic is in the kernel/ntpd they just don't apply it to leapseconds this will work for more than 1000 years (earth rotation drift is <12s/year) and somewhere during that time leapseconds will be abolished and it stops being a problem..