This is the mail archive of the libc-alpha@sourceware.org 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: RFC [PATCH] BZ#1077902: New API gettimezone


> On Friday, 4 April 2014 4:21 AM, Paul Eggert wrote:
> glibc doesn't need an API change.

  It is not an API change. But a fresh new API.

> People who have this problem can save the contents of the TZ
> environment variable (or record that it's unset), 
> and standardize on UTC in /etc/localtime.  That's good enough.

  TZ is not set by default on most systems for '/etc/localtime' is almost always accessible.

For cases when it is not accessible, we need to know appropriate value for the TZ variable. Which is precisely what this new API 'gettimezone()' provides.

Defaulting to UTC when TZ is not set is an easy solution. Many applications did that in the past. But it does not work for users. First, it's a usability disaster and second they have to maintain separate scripts to do time conversions from UTC to their local time when reading timestamps. Imagine reading a log file wherein timestamps are in UTC. First question any user would ask is why is not local time?

> about helping someone use the system than about changing the libc API. 

  It is about a new API that is genuinely useful. Not about changing any existing API.

---
Regards
   -Prasad
http://feedmug.com


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