YAMB: times(2) is broken in large model

James Van Artsdalen james at bigtex.uucp
Mon Apr 4 18:07:34 AEST 1988


IN article <463 at splut.UUCP>, jay at 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(&timesbuf)", according to my documentation.
-- 
James R. Van Artsdalen       jva at astro.as.utexas.edu         "Live Free or Die"
Home: 512-346-2444 Work: 328-0282; 110 Wild Basin Rd. Ste #230, Austin TX 78746



More information about the Comp.unix.microport mailing list