[comp.bugs.4bsd] Questionable optimization of localtime

per@erix.UUCP (Per Hedeland) (03/01/88)

Between 4.2 and 4.3, localtime(3) was optimized by giving it a "memory", so
it wouldn't have to gettimeofday(2) to obtain the timezone info on each call.
However, one result of this is that /usr/ucb/lisp as distributed will always
give the time in LBT (Local Berkeley Time).  Of course, remaking it "solves"
the problem by hardwiring in one's own local timezone.

I gather that this behaviour is essentially unchanged by the new ctime
package posted to .ucb-fixes. Is there a "good" solution to this problem?
I guess the simplest way out is just to decree that packages creating
executables by dumping mustn't call localtime/ctime before the dump...

Yours for side-effect-free functions :-)
Per Hedeland
per@erix.ericsson.se  or  ...{mcvax,uunet}!enea!erix!per