Path: utzoo!mnetor!uunet!husc6!mailrus!ames!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hpda!hpcupt1!hpisod2!decot From: decot@hpisod2.HP.COM (Dave Decot) Newsgroups: comp.sys.hp Subject: Re: time.h header files on HP9000/300. Message-ID: <16710009@hpisod2.HP.COM> Date: 5 May 88 00:07:11 GMT References: <12279@sri-spam.istc.sri.com> Organization: Hewlett Packard, Cupertino Lines: 27 > I believe Posix defines these guys as unsigned long. Perhaps a Posix > guru could confirm. The P1003.1 (POSIX kernel) draft standard does not specify high-precision time routines such as gettimeofday() or gettimer(). Draft 2 of P1003.4 (POSIX Realtime Extension) describes a variety of functions that refer to the following structure, defined in : struct timestruc { unsigned long tv_sec; /* seconds */ long tv_nsec; /* and nanoseconds */ }; There is currently no rationale in that document explaining why the tv_sec type is unsigned long. The reason we have unsigned long on HP-UX is to maximize the available range of times for HP-UX systems. tv_nsec does not need to be unsigned because there are only 1 billion nanoseconds in a second. The difference shouldn't affect anything; if you use unsigned long variables to store values of tv_sec in your program, it will work correctly on both HP-UX and Sun systems. Dave Decot hpda!decot