From dalias at libc.org  Thu Feb  4 22:32:49 2016
From: dalias at libc.org (Rich Felker)
Date: Thu, 4 Feb 2016 16:32:49 -0500
Subject: [Rd] Fwd:  [musl] strptime() question
In-Reply-To: <CAJDAfTBwMx5eb5L+A2fbCpMB1ez-N+KdNViu69HkxAqfZs6RCg@mail.gmail.com>
References: <CAJDAfTDpBrooMDDJ=p1xf5c_j6Rn9nAuAnBCvdotzUcgBkQRzA@mail.gmail.com>
	<20160204160708.GP9349@brightrain.aerifal.cx>
	<CAJDAfTCENy0dyAYP5612OSMnNBc5U-AGjEoOgVgF1VisjDs8=g@mail.gmail.com>
	<E98A2A10-27B5-48EF-988E-506F69E84BA6@r-project.org>
	<CAJDAfTBwMx5eb5L+A2fbCpMB1ez-N+KdNViu69HkxAqfZs6RCg@mail.gmail.com>
Message-ID: <20160204213249.GT9349@brightrain.aerifal.cx>

On Thu, Feb 04, 2016 at 04:35:22PM -0200, Alba Pompeo wrote:
> I forwarded our talk on musl mailing list to R mailing list.
> I got this response.
> Does it help?
> Also, what do you think about making a new email that's sent to both
> musl and R mailing list, that way devs from both projects can
> communicate? It's a tad inefficient for me to keep forwarding messages
> like this back and forth.

I'm cc'ing both lists now.

> ---------- Forwarded message ----------
> From: Simon Urbanek <simon.urbanek at r-project.org>
> Date: Thu, Feb 4, 2016 at 3:01 PM
> Subject: Re: [Rd] [musl] strptime() question
> To: Alba Pompeo <albapompeo at gmail.com>
> Cc: r-devel <r-devel at r-project.org>
> 
> 
> 
> On Feb 4, 2016, at 11:20 AM, Alba Pompeo <albapompeo at gmail.com> wrote:
> 
> > There is incompatibility between R strptime and musl libc. I posted
> > about it on their mailing list, but they need more information I can't
> > provide, so I'm forwarding the message here in hope R developers can
> > help. Thanks.
> 
> Generally, it's using the standard tzset() call to set the time zone
> http://pubs.opengroup.org/onlinepubs/009695399/functions/tzset.html

The tzset function doesn't really do much interesting; it just updates
some global state to match the current value of the TZ environment
variable, but most time.h functions do this already anyway. Anyway
this doesn't really answer the question of what R's strptime function
is doing to add timezone functionality onto the underlying system's
strptime. Is R changing the environment (this is highly unsafe in any
potentially-multithreaded process, BTW)? Is it using the globals set
by tzset to compute adjustments to the result?

Rich



[Rd] Fwd: [musl] strptime() question
Rich Felker