This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: First draft of the Y2038 design document


On Tue, Oct 27, 2015 at 01:59:00PM -0700, Paul Eggert wrote:
> On 10/27/2015 01:56 PM, Rich Felker wrote:
> >A program which does not use functions which
> >are specified to depend on the TZ environment variable has
> >well-defined behavior regardless of the value set in the TZ variable
> >and whether it matches the POSIX timezone form.
> 
> That's not what the standard says, and it's not what common practice does.

A relevant part (I don't claim this is the only one) of the text is
from XSH 2.9.1 Thread-Safety:

"Since multi-threaded applications are not allowed to use the environ
variable to access or modify any environment variable while any other
thread is concurrently modifying any environment variable, any
function dependent on any environment variable is not thread-safe if
another thread is modifying the environment; see XSH exec."

Because of this, whether a function accesses the environment is a part
of its interface contract. Functions which are not specified to access
the environment cannot access it, because there is no way to make
their access safe against concurrent modifications to the environment
representation from other threads. This has been discussed on
libc-alpha before in regards to using environment variables for
tunables.

Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]