Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20121026073720.06b2d225.idunham@lavabit.com>
Date: Fri, 26 Oct 2012 07:37:20 -0700
From: Isaac Dunham <idunham@...abit.com>
To: musl@...ts.openwall.com
Subject: Re: localtime() isn't local

On Fri, 26 Oct 2012 08:26:36 -0400
Rich Felker <dalias@...ifal.cx> wrote:

> On Fri, Oct 26, 2012 at 02:00:27PM +0200, Szabolcs Nagy wrote:
> > * Yoran Heling <info@...hel.nl> [2012-10-26 10:34:06 +0200]:
> > > Ah, I didn't realize that the use of /etc/localtime wasn't part of
> > > POSIX. I don't have a TZ variable set, so that explains the output.
> > > TZ=CEST didn't work, but TZ=CEST-2 did the trick.
> > > 
> > > This is quite a bummer, though. I use musl to create static binaries for
> > > Linux, and every glibc-based distribution (i.e. the vast majority) uses
> > > /etc/localtime rather than the TZ variable. :-(
> > > 
> > 
> > i guess you can hack the implementation at
> > http://cs.ucla.edu/~eggert/tz/tz-link.htm
> 
> Adding zoneinfo support to musl is on the agenda, but not based on the
> "official" source which is bloated and invalid C. A while back I was
> reading the (very minimal) spec and it doesn't look that bad, but it
> was complex enough that I didn't write the support code immediately.
> I'll get around to it sometime, sooner rather than later if there's
> really a demand for it.
FWIW, the last line in /etc/localtime seems in proper format for the TZ variable (that is, export TZ=`tail -n 1 /etc/localtime` should give you a valid POSIX timezone).  I don't know why there's so much more cruft, and I've only checked with my timezone.

Isaac Dunham <idunham@...abit.com>

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.