Subject: kern/30115: getrusage returns bogus ru_utime values
To: None <,,>
From: None <>
List: netbsd-bugs
Date: 05/02/2005 14:50:00
>Number:         30115
>Category:       kern
>Synopsis:       getrusage returns bogus ru_utime values
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 02 14:50:00 +0000 2005
>Release:        NetBSD 1.6.1_STABLE
	Iowa State University
System: NetBSD 1.6.1_STABLE NetBSD 1.6.1_STABLE (NETREG) #0: Mon May 10 14:59:57 CDT 2004 i386
Architecture: i386
Machine: i386
	Two calls of getrusage surround a function which does some amount
	of work.  Sometimes the second call indicates that the process has
	used less user time (ru_utime) than was used before the function.
	For example the first call might return 0 seconds, 913842 usecs
        and then second call might later return 0 seconds, 913803 usecs
        which would seem to indicate that the function used the cpu for
	a negative 39 usecs.  This does not always happen, and I
	have never seen it happen in the system time (ru_stime)
	several times, call getrusage() around a function that does
	some small amount of work.  See if the second call shows a
	lower value than the first in ru_stime.