[comp.unix.wizards] SVVS user/system time tests

madd@bu-cs.BU.EDU (Jim Frost) (06/12/88)

In article <55906@sun.uucp> guy@gorodish.Sun.COM (Guy Harris) writes:
|> In the file exec1.c, there are messages indicating that the child process
|> did not inherit the system and user times of its parent. However, the test
|> actually only checks to see that the times are NON-ZERO. This appears to
|> have been the sticking point for Apollo since our system time was always 0.
|
|In this case, they should test whether the *sum* of user+system time is
|non-zero.

Even this strikes me as bogus.  It should check to see if the times
for the child are more than or equal to those of the parent.  I see no
reason why a sufficiently fast machine might not be able to execute
the test in less time than one clock tick, making it fail the actual
test and the one you propose.  Of course, I can imagine cases where my
idea is inaccurate as well, but you get the idea.

jim frost
madd@bu-it.bu.edu

guy@gorodish.Sun.COM (Guy Harris) (06/12/88)

> |In this case, they should test whether the *sum* of user+system time is
> |non-zero.
> 
> Even this strikes me as bogus.  It should check to see if the times
> for the child are more than or equal to those of the parent.  I see no
> reason why a sufficiently fast machine might not be able to execute
> the test in less time than one clock tick, making it fail the actual
> test and the one you propose.

In my original article, I stated that the test should *also* loop until the
real time since the loop began *and* the CPU time (user+system) since the loop
began was non-zero.  This ensures that the machine will take more than one
clock tick to perform that portion of the test, no matter how fast it is.

The test would have to do something such as cut the loop off after some large
amount of time, just in case the system really *is* broken and doesn't maintain
CPU time figures.

rsalz@bbn.com (Rich Salz) (06/12/88)

To put it mildly, it is annoying that the test one might have to pass
for SysVrel3 licensing has bugs.  YARNTS[*].
	/r$
[*] Yet Another Reason Not To Sign.
-- 
Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.