This is the mail archive of the 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: [PING^2] RFC [PATCH] BZ#1077902: New API gettimezone

On 05/01/2014 02:21 AM, Paul Eggert wrote:
> Carlos O'Donell wrote:
>> even if you had identical files there is presently no programmatic
>> API to determine your own TZ
> But there is a programmatic API, namely getenv ("TZ").  If the
> chrooted files are identical, and if the TZ value (or lack of value)
> is propagated into the chrooted process, localtime should behave the
> same way inside the chrooted jail as it does outside.

Sure, but getenv ("TZ"); right now on an OpenShift gear returns "",
and if I pass my cartridge to someone running in Mumbai, and they
use it the chroot'd process prints the wrong time.

As the user I get to decide how to run my servers and UTC isn't
what I want.

How do I get the TZ out of the running system?
> That is, it's not necessary to set TZ to the same string both inside
> and outside the jail.  All that's necessary is that if TZ is set
> outside the jail, it must be set to the same value inside the jail,
> and vice versa.

Sure, but what do I set TZ to?

It seems way more sensible to just provide the missing symmetric
portion of the API than to say "You just have to get all other
distros or frameworks you use to set TZ."

>> Do we agree that there is a flaw in the API here?
> That depends on what one means by "flaw".  :-)  My impression so far
> has been that most of the problem has been due to a lack of
> understanding of how time zones work in glibc.  If my impression is
> correct, then perhaps all we need to do is improve the
> documentation.

I think it's my own failing at explaining why it's relevant and or

On top of all this copying in /etc/localtime for say Docker containers
forces a COW for the changed file and that's a size and performance
issue. Assume you have the same TZ's and all you want is to detect
the local timezone, and pass it to all of your children via env var
TZ. Today you can't detect the local timezone via any API.

Leave the discussion of binary data in TZ out of this discussion
and for another day.


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