From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4290 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Add support for leap seconds in zoneinfo files Date: Wed, 27 Nov 2013 19:43:07 +0100 Message-ID: <20131127184307.GN1685@port70.net> References: <5294EE35.8040603@skarnet.org> <20131126233212.GE24286@brightrain.aerifal.cx> <529570BB.2060804@skarnet.org> <20131127042550.GI24286@brightrain.aerifal.cx> <529588D8.3020006@skarnet.org> 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 1385577798 27238 80.91.229.3 (27 Nov 2013 18:43:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Nov 2013 18:43:18 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4294-gllmg-musl=m.gmane.org@lists.openwall.com Wed Nov 27 19:43:24 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 1Vlk56-0001YW-Nw for gllmg-musl@plane.gmane.org; Wed, 27 Nov 2013 19:43:24 +0100 Original-Received: (qmail 9621 invoked by uid 550); 27 Nov 2013 18:43:22 -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 9612 invoked from network); 27 Nov 2013 18:43:22 -0000 Content-Disposition: inline In-Reply-To: <529588D8.3020006@skarnet.org> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:4290 Archived-At: * Laurent Bercot [2013-11-27 05:53:28 +0000]: > * the point of using TAI-10 instead of UTC is to have a linear system > clock, so leap seconds must not be applied to clock_gettime() and > friends. TAI is non-linear for every moving object in the universe it's wobbling and inaccurate like UT1 just on a smaller scale the mistake was made in 1972 to broadcast leapsecond adjusted atomic time for civil usage (UTC) instead of the earlier elastic seconds (UT1) based on the rotation of the earth or plain SI seconds (TAI,GPS,..) with deltaT information for display there is an effort to redefine UTC though http://www.ucolick.org/~sla/leapsecs/ > To sum it up: > - leap seconds break POSIX anyway, but should break as little as possible > - leap second users only care about system clock time, not broken-down time > - so gmtime() should always return UTC, this is relied on by userland so > it's more important than the exact relationship between tm and secs > - so time() should ignore leap seconds but broken-down time should apply them > - so the right place to apply them is in __secs_to_tm and __tm_to_secs, the > conversion routines > - using a posix/ zone will make everything POSIX in any case. i think with the leap second patch localtime is no longer correct: __secs_to_tm((long long)*t - tm->__tm_gmtoff, tm) < 0 the leap second will be added at the wrong time (briefly making gmtime - localtime != gmtoff)