From owner-freebsd-current@FreeBSD.ORG Wed Jun 7 23:25:54 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 29D0C16B765 for ; Wed, 7 Jun 2006 22:27:38 +0000 (UTC) (envelope-from mi+mx@aldan.algebra.com) Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id A54E743D49 for ; Wed, 7 Jun 2006 22:27:37 +0000 (GMT) (envelope-from mi+mx@aldan.algebra.com) Received: from corbulon.video-collage.com (static-151-204-231-237.bos.east.verizon.net [151.204.231.237]) by aldan.algebra.com (8.13.6/8.13.6) with ESMTP id k57MRZZA023502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 7 Jun 2006 18:27:36 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) Received: from [172.21.130.86] (mx-broadway [38.98.68.18]) by corbulon.video-collage.com (8.13.6/8.13.6) with ESMTP id k57MRTwD083268 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 7 Jun 2006 18:27:30 -0400 (EDT) (envelope-from mi+mx@aldan.algebra.com) From: Mikhail Teterin Organization: Virtual Estates, Inc. To: current@freebsd.org Date: Wed, 7 Jun 2006 18:27:24 -0400 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200606071827.24207.mi+mx@aldan.algebra.com> X-Virus-Scanned: ClamAV 0.88/1519/Wed Jun 7 15:17:46 2006 on corbulon.video-collage.com X-Virus-Status: Clean X-Scanned-By: MIMEDefang 2.43 X-Mailman-Approved-At: Wed, 07 Jun 2006 23:43:53 +0000 Cc: Subject: getrusage() -- negative ru_maxrss?! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jun 2006 23:26:01 -0000 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