This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: RFC [PATCH] BZ#1077902: New API gettimezone
- From: P J P <pj dot pandit at yahoo dot co dot in>
- To: "libc-help at sourceware dot org" <libc-help at sourceware dot org>
- Date: Fri, 4 Apr 2014 17:49:53 +0800 (SGT)
- Subject: Re: 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> <533CF5E8 dot 9010009 at cs dot ucla dot edu> <1396518081 dot 53447 dot YahooMailNeo at web192403 dot mail dot sg3 dot yahoo dot com> <533D73DF dot 1040009 at cs dot ucla dot edu> <1396546236 dot 69027 dot YahooMailNeo at web192401 dot mail dot sg3 dot yahoo dot com> <20140403194040 dot GG26358 at brightrain dot aerifal dot cx> <533DD86D dot 10908 at redhat dot com> <533DE5CA dot 5040905 at cs dot ucla dot edu> <1396589568 dot 22200 dot YahooMailNeo at web192403 dot mail dot sg3 dot yahoo dot com> <533E53B0 dot 90804 at cs dot ucla dot edu>
- Reply-to: P J P <pj dot pandit at yahoo dot co dot in>
> On Friday, 4 April 2014 12:09 PM, Paul Eggert wrote:
> If you consider this to be a problem, then I suggest campaigning to
> change this practice, so that TZ is set by default.
No, I don't consider that to be a problem. Because one '/etc/localtime' is always accessible to regular(non-chroot) applications and second every system does not have to run programs inside chroot(2) jail. So that campaign is a non-solution.
> That is much simpler than trying to convince library developers to add a new API with
> hard-to-explain semantics,
If you think that is simpler, feel free to start your campaign for setting TZ variable. About hard-to-explain semantics, which part of gettimezone(or tzget) is hard-to-explain?
> and then to convince application developers to use it.
There is no need for that. They'll use it if and when they need it. Point is, an API should exist for when they need it.
> There should be no need to add a complicated API
Which part of gettimezone(or tzget) is complicated?
> to work around an operational problem that is easily addressed
> by configuring systems correctly in the first place.
It's not an operational problem. These default settings are done by distributions, of which there are millions of them. It would be a long shot to expect them all to set TZ variable by default.
Instead, having a standard portable API to query local time-zone database is certainly a better solution. As Carlos said, it's an API deficiency to have tzset() without tzget().
---
Regards
-Prasad
http://feedmug.com