mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: [PATCHv2] Add support for leap seconds in zoneinfo files
Date: Thu, 5 Dec 2013 09:43:11 -0500	[thread overview]
Message-ID: <20131205144311.GG24286@brightrain.aerifal.cx> (raw)
In-Reply-To: <529FD33A.8000509@skarnet.org>

On Thu, Dec 05, 2013 at 01:13:30AM +0000, Laurent Bercot wrote:
>  The new version of the patch, provided in attachment, reads leap seconds
> directly from the mmapped zoneinfo file instead of storing them in a static
> table, as requested by Rich; and it's still not invasive.
>  The leap second table scan is still linear, because:
>  * when substracting leap seconds, the scan is done from the future to the past.
> Since the huge majority of calls involve the current time or a time close to it,
> the scan usually stops at the first or second element.
>  * when adding leap seconds, the scan has to be done from the past to the future
> linearly anyway, to apply successive corrections while testing the correct TAI-10
> transition time instead of comparing a UTC value to a TAI-10 value. The previous
> version of the patch didn't get this right.
> 
>  I would love it if this version, modulo any bugs, could make it into 0.9.15.

I don't want to disappoint you but I don't think that's feasible.
There's still a lot to be considered about this patch, and it _is_
invasive. The biggest invasive changes are the interface contract
violations for gmtime; after the patch:

- gmtime depends on the TZ variable

- gmtime behaves unpredictably depending on whether a function that
  loads the timezone has or has not been called prior to calling
  gmtime.

- there's no synchronization in gmtime's (or gmtime_r's) access to the
  leap seconds data so the latter isn't even thread-safe.

There may still be other things too I'm not aware of, but the above
are what I noticed immediately.

What I can tell you is that this code (the time internals) is not
something I expect to make any changes to between now and some time
after 1.0, so for your own usage or usage by anybody else who wants
it, your patch should continue to apply successfully. And I don't mind
further discussion of how to improve it in the mean time, but in the
immediate future my focus on musl will be getting 0.9.15 and 1.0.0
releases ready according to the existing plan, without big invasive
changes.

Rich


  parent reply	other threads:[~2013-12-05 14:43 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-26 18:53 [PATCH] " Laurent Bercot
2013-11-26 18:59 ` Laurent Bercot
2013-11-26 23:32 ` Rich Felker
2013-11-27  1:06   ` Rich Felker
2013-11-27  4:10   ` Laurent Bercot
2013-11-27  4:25     ` Rich Felker
2013-11-27  5:53       ` Laurent Bercot
2013-11-27 18:43         ` Szabolcs Nagy
2013-11-27 20:33           ` Laurent Bercot
2013-12-05  1:13             ` [PATCHv2] " Laurent Bercot
2013-12-05  5:18               ` Szabolcs Nagy
2013-12-05  8:58                 ` Laurent Bercot
2013-12-05 14:21                   ` Szabolcs Nagy
2013-12-05 14:43               ` Rich Felker [this message]
2013-12-05 16:31                 ` Laurent Bercot
2013-12-05 16:40                   ` Rich Felker
2013-12-06  0:36                     ` Laurent Bercot
2013-12-06  0:45                       ` Rich Felker
2013-12-06  1:15                         ` Laurent Bercot
2013-12-06  5:31                           ` Szabolcs Nagy
2013-12-06 10:48                             ` Laurent Bercot
2013-12-06 11:38                               ` Raphael Cohn
2013-12-06 23:29                                 ` Laurent Bercot
2013-12-07  2:31                                   ` Rich Felker
2013-12-07  4:02                                     ` Szabolcs Nagy
2013-12-07  8:52                                     ` Laurent Bercot
2013-12-06  6:29                           ` Rich Felker
2013-12-06 10:37                             ` Laurent Bercot
2013-12-06 12:50                               ` Rich Felker
2013-12-06 13:27                                 ` Szabolcs Nagy
2013-12-06 15:48                                   ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131205144311.GG24286@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).