This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PING^3] RFC [PATCH] BZ#1077902: New API gettimezone
- From: P J P <pj dot pandit at yahoo dot co dot in>
- To: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Wed, 28 May 2014 16:31:29 +0800 (SGT)
- Subject: Re: [PING^3] RFC [PATCH] BZ#1077902: New API gettimezone
- Authentication-results: sourceware.org; auth=none
- References: <5361D8D1 dot 60400 at redhat dot com> <5361E805 dot 9080606 at cs dot ucla dot edu> <5361F22E dot 3070206 at redhat dot com> <53628A02 dot 9080702 at cs dot ucla dot edu> <53629388 dot 1060301 at redhat dot com> <53630B0C dot 1050305 at cs dot ucla dot edu> <53633A37 dot 7060405 at redhat dot com> <5363E223 dot 7060303 at cs dot ucla dot edu> <1399061963 dot 56150 dot YahooMailNeo at web192404 dot mail dot sg3 dot yahoo dot com> <1401211363 dot 50264 dot YahooMailNeo at web192402 dot mail dot sg3 dot yahoo dot com> <20140527180827 dot GA25042 at domone dot podge>
- Reply-to: P J P <pj dot pandit at yahoo dot co dot in>
 Â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