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: [PING^3] RFC [PATCH] BZ#1077902: New API gettimezone


 ÂHello,

> On Tuesday, 27 May 2014 11:38 PM, OndÅej BÃlka <neleai@seznam.cz> wrote:
> As was previously said I prefer to stick with existing API instead of
> new one, so localtime_rz is preferable.

 Previously said, here? I missed it I guess.

> pthread_mutex_t l;

>Â
> localtime_rz(new, resultp)
> {
>   pthread_mutex_lock (l);
>   char *old = strdup (getenv ("TZ"));
>   setenv ("TZ", (char *) new);
>   tzset ();
>   result = localtime (resultp);
>   setenv ("TZ", old);
>   tzset ();
>   free (old);
>   pthread_mutex_unlock (l);
>   return result;
>Â
> }

 It depends on the user to set TZ variable. Idea is to have an API which will return the 'best fit' value for the TZ variable, which a user can use to set the TZ variable.

---
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]