getrusage() -- negative ru_maxrss?!

Mikhail Teterin mi+mx at aldan.algebra.com
Wed Jun 7 23:26:01 UTC 2006


Hello!

I have a program, which uses getrusage() to report its own performance before 
exiting.

I noticed recently, that the ru_maxrss field is sometimes reported negative -- 
I don't think, I ever saw this last year, for example... Is the field 
considered usable and (semi-)accurate, or did FreeBSD abandon it (as Solaris 
did)?

I currently print it as:

	fprintf(..., "... used %ld Kb ...", ... ru.ru_maxrss*getpagesize()/1024... );

What's the right way to do it?

	-mi


More information about the freebsd-current mailing list