mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: Post-1.1.1 plans
Date: Tue, 20 May 2014 21:36:53 -0400	[thread overview]
Message-ID: <20140521013653.GA507@brightrain.aerifal.cx> (raw)
In-Reply-To: <537BFACF.6010404@skarnet.org>

On Wed, May 21, 2014 at 02:01:03AM +0100, Laurent Bercot wrote:
> >There may be other open things I'm missing; let me know if you have a
> >request that doesn't appear above.
> 
>  I would like to have a serious design discussion about how to implement
> leap second support in musl. I haven't taken the time to have a serious
> go at it since I first mentioned it, but I have thought about it for a
> bit and it is indeed more complex than it appears - because the standard
> way of supporting them, i.e. in timezone files, is broken. (Timezones are
> a process-wide setting since the default can be overriden with TZ, but
> interpretation of the system clock as a TAI or UTC clock should be a
> system-wide setting.)
>  So, before diving in and writing some more code that won't be merged in,
> I'd like to assess exactly what would be acceptable for musl and what
> would not.
> 
>  A probable spin-off of this discussion is a subject in itself: what would
> be an acceptable format, a set of conventions to follow, to add
> musl-specific extensions outside of POSIX (or whatever superset of POSIX
> musl implements).

I really don't know. My recollection from the previous thread was that
we kept running into situations where the behavior would be
non-conforming. I've since been told by glibc developers that, on
glibc, setting TZ to a zone with leapseconds results in a discrepency
between the results of gmtime() and localtime() -- they don't differ
just by the local offset but also by the leap seconds offset. If
correct, this is obviously atrociously bad behavior, but at least it
seems to be conforming.

So I don't really know what to tell you. As you know I'm rather an
anti-fan of leapseconds/TAI, so while in some ways it's an interesting
and challenging problem, it's not something I'm really excited about
spending my mental energy on.

Probably in the short term, the best thing you can do is keep whatever
patches work for you; it's fine to link them on the wiki, and it would
be great to document what properties of libc they affect (e.g.
thread-safety of interfaces, functions that newly depend on
environment, etc.). This would also help in evaluating whether the
patches would eventually be acceptable upstream.

I also really question whether there's a superior kernel-based
approach to the transformation of time_t. I haven't read it in detail,
but there's a thread here that may be relevant:

http://lkml.iu.edu//hypermail/linux/kernel/1205.2/01644.html

If this interface was committed and works, the way to configure
leapseconds for the libc time_t conversion layer might be simple: ask
the kernel how the system clock is configured. That's certainly
cleaner than having environment variables and inconsistent per-process
settings.

Rich


  reply	other threads:[~2014-05-21  1:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20 22:33 Rich Felker
2014-05-21  1:01 ` Laurent Bercot
2014-05-21  1:36   ` Rich Felker [this message]
2014-05-21  6:15 ` Timo Teras
2014-05-21 12:59   ` Rich Felker
2014-05-22  4:44 ` Rich Felker
2014-05-24  8:13   ` Szabolcs Nagy

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=20140521013653.GA507@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --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).