getrusage() -- negative ru_maxrss?!

From: Mikhail Teterin <mi+mx_at_aldan.algebra.com>
Date: Wed, 7 Jun 2006 18:27:24 -0400
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
Received on Wed Jun 07 2006 - 21:25:54 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:56 UTC