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: Paul Eggert <eggert at cs dot ucla dot edu>
- To: 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: Wed, 30 Apr 2014 11:30:32 -0700
- 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>
On 04/30/2014 08:49 AM, P J P wrote:
It sounds more of incorrect or buggy time zone file.
No, that time zone file is not buggy. It's generated by the standard
tzdata distribution, it uses the documented file layout, and many other
time zone files are like it. For details, please see the tzfile man page.
TZ variable provides offsets which are added to the UTC times to get
the local time, right?
That's basically right. (TZ also can provide leap-second info, which
maps TAI to UTC, but let's ignore that for now.)
Goal is to make local system time zone definition available to
processes running inside of a chroot(2) jail; On the same host.
Sorry, that point was never made clear to me. In that case, please let
me rephrase my remark, as follows:
I'm afraid no other option is available or possible under reasonable
constraints, if the goal is to have gmtime->localtime conversion in the
chrooted jail exactly match gmtime->localtime conversion with TZ unset
outside the jail regardless of whether the jail and the main host have
identical tz files.
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.