gettimeofday()

Guy Harris guy at gorodish.Sun.COM
Fri Apr 29 18:39:33 AEST 1988


> I've noticed that gettimeofday() (the A/UX emulation of the BSD system
> call) may run slower than many people think (a number of programs - CAP, X
> NeWS etc use this heavily), in BSD the timezone information is obtained
> from the kernel, in A/UX it must come from disk ..... 5 minutes with adb
> shows that if you don't want the timezone information (most applications
> do not) the following macro can be used:
> 
> 
> 		#define	gettimeofday(time, timezone) _gettimeofday(time)

1) Could not "gettimeofday()" have a static flag that indicates whether it's
   called "tzset()" or not, so that only the first call to "gettimeofday()"
   calls "tzset()"?

2) Does not "gettimeofday()" avoid calling "tzset()" at all if "timezone" is
   NULL?  Lots of programs (all the properly-written ones) that call
   "gettimeofday()" explicitly indicate their disinterest in the timezone
   information by passing a (properly-case, of course) null pointer as the
   second argument, and most programs that call "gettimeofday()" don't want the
   timezone information.



More information about the Comp.unix.aux mailing list