From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5237 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: REG_STARTEND (regex) Date: Wed, 11 Jun 2014 21:40:47 -0400 Message-ID: <20140612014047.GX179@brightrain.aerifal.cx> References: <20130115134244.GW20323@brightrain.aerifal.cx> <5398FB90.7000109@sbcglobal.net> 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 1402537268 17463 80.91.229.3 (12 Jun 2014 01:41:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Jun 2014 01:41:08 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5242-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jun 12 03:41:00 2014 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 1Wuu0i-0004iU-Or for gllmg-musl@plane.gmane.org; Thu, 12 Jun 2014 03:41:00 +0200 Original-Received: (qmail 17761 invoked by uid 550); 12 Jun 2014 01:41:00 -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 17753 invoked from network); 12 Jun 2014 01:40:59 -0000 Content-Disposition: inline In-Reply-To: <5398FB90.7000109@sbcglobal.net> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:5237 Archived-At: On Wed, Jun 11, 2014 at 09:00:00PM -0400, bfdamkoehler wrote: > > Hello, > > I noticed an issue with localtime() in musl-1.1.2. In my environment > TZ is set to EST5EDT. There is a test program below that > demonstrates this. localtime() is returning with isdst == 1 for for > a time_t value of 1394327858 (08-Mar-14 20:17). Daylight savings > time starts on 09-Mar-14. Note that if you decrement the time_t > value in the test program isdst remains set. > > This time_t value is the st_atime value of a file on my machine, as > returned by stat64(). > > Just as further test I moved the file around to an AIX 5.2 machine, > HPUX 11.11, and OpenBSD 5.0 system and a Centos 6.5 linux machine. I > used ls and tar on them to display the file date and they all came > out as 08-Mar-14 20:17, as does the output from my application if it > is linked with the gcc libc. When my application is linked with musl > it produces a time of 08-Mar-14 21:17. > > I just wanted to mention that I had noticed this. I think the issue is just that you don't have a complete POSIX TZ rule for EST5EDT written. With TZ=EST5EDT,M3.2.0/2,M11.1.0/2 (corresponding to the current rules in effect for this timezone) I get the expected output. Without specifying the full rule like this, I don't think you can expect the right behavior since it changes every few years. However, I think musl is also wrong not to have some sort of meaningful default. I'll look into it more. BTW if you intended to use the modern zoneinfo file rather than the POSIX TZ string for EST5EDT, try TZ=:EST5EDT or TZ=US/Easter. glibc may use the zoneinfo file before treating the string as a POSIX TZ string but musl doesn't since doing so is non-conforming; the leading ':' can force it to treat it as a file though. Rich