Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Mar 1999 07:43:00 +1100
From:      Peter Jeremy <peter.jeremy@auss2.alcatel.com.au>
To:        marcolz@stack.nl
Cc:        stable@FreeBSD.ORG
Subject:   Re: tzset in libc
Message-ID:  <99Mar4.073138est.40360@border.alcanet.com.au>

next in thread | raw e-mail | index | archive | help
Marc Olzheim <marcolz@stack.nl> wrote:
>I was wondering why it was that each time you call localtime() or strftime(),
>tzset() is called also.
The Open Group's Single Unix Specification states: In localtime():
"Local timezone information is used as though localtime() calls
tzset()".  In strftime(): "Local timezone information is used as
though strftime() called tzset()".

> Isn't it so that it only has to be called once
>per process and then be regearded as already set ?
The process could change TZ.  (I'm currently writing some code that
continually updates TZ so it can determine the time in various
timezones).

>When the timezone changes, you'd have to call tzset() manually, but in my
>case, it's worth it.
The problem would be finding all existent code that relies on the current
behaviour.

Unfortunately, I can't think of a simple solution that would maintain
compatibility with the standard and current behaviour.

Peter



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?99Mar4.073138est.40360>