Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121026120025.GG24157@port70.net>
Date: Fri, 26 Oct 2012 14:00:27 +0200
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: localtime() isn't local

* 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

into musl

note that after a quick look at the impementation
it does not seem to be entirely correct

it invokes undefined behaviour with signed
shift in its decoder of the binary tz data
(this is usual in old code, but bad)

they assume that read returns "enough" data
(which is not guaranteed by posix and it
might not be true on certain filesystems)

etc

glibc seems to have its own implementation
that's even uglier..

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.