This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PING^2] RFC [PATCH] BZ#1077902: New API gettimezone
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Paul Eggert <eggert at cs dot ucla dot edu>, P J P <pj dot pandit at yahoo dot co dot in>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Thu, 01 May 2014 01:17:05 -0400
- Subject: Re: [PING^2] RFC [PATCH] BZ#1077902: New API gettimezone
- Authentication-results: sourceware.org; auth=none
- References: <1396499286 dot 85118 dot YahooMailNeo at web192405 dot mail dot sg3 dot yahoo dot com> <1397301884 dot 32837 dot YahooMailNeo at web192402 dot mail dot sg3 dot yahoo dot com> <534971E4 dot 6060001 at cs dot ucla dot edu> <53497633 dot 6060804 at redhat dot com> <1397324033 dot 69177 dot YahooMailNeo at web192403 dot mail dot sg3 dot yahoo dot com> <5349A4B0 dot 2070206 at redhat dot com> <1397375798 dot 36419 dot YahooMailNeo at web192401 dot mail dot sg3 dot yahoo dot com> <1397414803 dot 70882 dot YahooMailNeo at web192403 dot mail dot sg3 dot yahoo dot com> <534B8A9F dot 8030806 at redhat dot com> <1397469748 dot 42212 dot YahooMailNeo at web192405 dot mail dot sg3 dot yahoo dot com> <1398146221 dot 72442 dot YahooMailNeo at web192403 dot mail dot sg3 dot yahoo dot com> <1398755742 dot 94004 dot YahooMailNeo at web192405 dot mail dot sg3 dot yahoo dot com> <535F74EE dot 8010002 at redhat dot com> <1398775268 dot 92264 dot YahooMailNeo at web192405 dot mail dot sg3 dot yahoo dot com> <535FC11B dot 3000906 at cs dot ucla dot edu> <1398801168 dot 81041 dot YahooMailNeo at web192406 dot mail dot sg3 dot yahoo dot com> <5360378D dot 1060306 at cs dot ucla dot edu> <1398872997 dot 84757 dot YahooMailNeo at web192402 dot mail dot sg3 dot yahoo dot com> <53614148 dot 90603 at cs dot ucla dot edu>
On 04/30/2014 02:30 PM, Paul Eggert wrote:
> One way to work around the problem is to arrange for chrooted jail to
> have identical tz files as the main host. That is necessary anyway,
> if you want gmtime->localtime mappings to match no matter how
> applications set TZ. This sort of thing is standard practice for
> chrooted jails: one must set up configuration files, shared
> libraries, etc. to be the same in the jail as in the main host, and
> the tz files are just another part of this.
It's also necessary to have the same locales in both places if
you are expecting localization to work correctly across the
chroot.
However, even if you had identical files there is presently no
programmatic API to determine your own TZ, and that's part of
the flaw. For localization it's easy you use "setlocale(LC_ALL, NULL);".
The workaround that is suggested is to always set TZ on the
server. Unfortunately that requires administrative privileges
or knowing exactly which file was symlinked, hardlinked, or
copied into /etc/localtime. What if you're on a locked down
VM? Running in an OpenShift gear with no access to /etc/localtime
and no chance of getting OpenShift to modify the server for
you?
It would be easier to just have an API that tells you your
current tz so you can use it to set TZ.
Do we agree that there is a flaw in the API here?
Cheers,
Carlos.