Path: utzoo!mnetor!uunet!husc6!im4u!ut-sally!utastro!bigtex!james From: james@bigtex.uucp (James Van Artsdalen) Newsgroups: comp.unix.microport Subject: Re: YAMB: times(2) is broken in large model Message-ID: <1447@bigtex.uucp> Date: 4 Apr 88 08:07:34 GMT References: <463@splut.UUCP> Reply-To: james@bigtex.UUCP (James Van Artsdalen) Organization: F.B.N. Software, Austin TX Lines: 27 Keywords: this one's a real pain, too... IN article <463@splut.UUCP>, jay@splut.UUCP (Jay Maynard) wrote: > times(2) is documented to return, besides the cpu times in the structure > that is passed as its parameter, a monotonically increasing number that > is the elapsed real time in 60ths of a second since the machine was > booted. In small model, it does this just fine; in large model, it > always returns -1. (argh!!) My documentation does not guarantee that the values returned by times() are monotonically increasing. It would be a useful assumption, and the include file /usr/include/sys/proc.h would indicate it is true, but the effect on times(2) of stime(2) is not defined. It would be academic except that BSD unix *does* go to the trouble of guaranteeing a monotonically increasing clock, and the fact that many uPort 286 users have trouble with cron due to the need to constantly adjust the clock... In the program included, > struct tms *timesbuf; should be "struct tms timesbuf", and > thistime = times(timesbuf); should be "thistime = times(×buf)", according to my documentation. -- James R. Van Artsdalen jva@astro.as.utexas.edu "Live Free or Die" Home: 512-346-2444 Work: 328-0282; 110 Wild Basin Rd. Ste #230, Austin TX 78746