From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2214 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: localtime() isn't local Date: Fri, 26 Oct 2012 14:00:27 +0200 Message-ID: <20121026120025.GG24157@port70.net> References: <20121026075736.GD16801@mahoro.ispfabriek.nl> <20121026081507.GF24157@port70.net> <20121026083405.GE16801@mahoro.ispfabriek.nl> 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 1351252842 17195 80.91.229.3 (26 Oct 2012 12:00:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Oct 2012 12:00:42 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2215-gllmg-musl=m.gmane.org@lists.openwall.com Fri Oct 26 14:00:50 2012 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 1TRian-0004xO-Nm for gllmg-musl@plane.gmane.org; Fri, 26 Oct 2012 14:00:49 +0200 Original-Received: (qmail 21668 invoked by uid 550); 26 Oct 2012 12:00:41 -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 21660 invoked from network); 26 Oct 2012 12:00:41 -0000 Content-Disposition: inline In-Reply-To: <20121026083405.GE16801@mahoro.ispfabriek.nl> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2214 Archived-At: * Yoran Heling [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..