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 18:10:59 +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> <533E16A5 dot 5030701 at redhat dot com> <533E1AB7 dot 5090804 at cs dot ucla dot edu> <533E471F dot 9040101 at redhat dot com> <533E562C dot 3040109 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:20 PM, Paul Eggert wrote:
> but the simple solution is to not rely on /etc/localtime, and to always
> set TZ.
 It does not make sense to ask users to set TZ variable when they want to run applications inside chroot(2).
> Not "will fix".ÂÂ*Has* fixed.ÂÂIt's what people have been doing
> forÂ*decades*, and it *works*.
 For _your_ definition of it works. IMO, if users have to maintain workaround tools to convert UTC to their local timezone, it does not work. As I mentioned earlier, UTC is an easy-to-implement solution, but difficult for users who have to read time and then adjust it to their local time zone.
Say, you go to an airport and all flight times are in UTC. How would you like to convert those to your local time-zone and figure out what time is your flight? And what are the chances of errors when _all_ passengers & their relatives have to do that??
> People who want to run non-UTC servers (which is a bad idea) can set TZ.
> Problem solved.
 Not the _best_ solution.
> Something like that *might* be implemented.ÂÂBut doing it right would be
> a lot of work for a small benefit.
 Could you please elaborate on this lot of work part?
> in the time zone API, such as, why isn't there a thread-safe way to set
> and get the time zone?
 Currently there is no way to get the time zone. :(
> If you want to work on improving this area ofÂglibc,
> please work on *that*.ÂÂThat's a *real* need, and there'sÂexisting practice(NetBSD).
Since we are using BSD references, from tzset(3) manual,
Â"...4.3BSD had a function char *timezone(zone, dst) that returned the name
of the timezone corresponding to its first argument (minutes West of
UTC). If the second argument was 0, the standard name was used, otherâ
wise the daylight saving time version.Â"
That sounds much like gettimezone or tzget.
---
Regards
ÂÂ -Prasad
http://feedmug.com