From owner-freebsd-stable Wed Mar 3 12:43:35 1999 Delivered-To: freebsd-stable@freebsd.org Received: from alcanet.com.au (border.alcanet.com.au [203.62.196.10]) by hub.freebsd.org (Postfix) with ESMTP id EFDF614ED0 for ; Wed, 3 Mar 1999 12:43:27 -0800 (PST) (envelope-from peter.jeremy@auss2.alcatel.com.au) Received: by border.alcanet.com.au id <40360>; Thu, 4 Mar 1999 07:31:38 +1100 Date: Thu, 4 Mar 1999 07:43:00 +1100 From: Peter Jeremy Subject: Re: tzset in libc To: marcolz@stack.nl Cc: stable@FreeBSD.ORG Message-Id: <99Mar4.073138est.40360@border.alcanet.com.au> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Marc Olzheim 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