NetBSD Problem Report #587

From gnats  Thu Nov 24 04:35:27 1994
Received: from pain.lcs.mit.edu (pain.lcs.mit.edu [128.52.46.239]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id EAA13380 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Thu, 24 Nov 1994 04:35:26 -0800
Message-Id: <199411241239.VAA04260@vectra1.hplj.yhp.hp.com>
Date: Thu, 24 Nov 1994 21:39:05 +0900
From: Fumitoshi UKAI <ukai@vectra1.hplj.yhp.hp.com>
Reply-To: ukai@vectra1.hplj.yhp.hp.com
To: gnats-bugs@NetBSD.ORG
Subject: incorrect %MEM of ps
X-Send-Pr-Version: 3.2

>Number:         587
>Category:       bin
>Synopsis:       incorrect %MEM of ps
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 24 04:50:05 +0000 1994
>Closed-Date:    Sat Nov 26 21:41:48 +0000 1994
>Last-Modified:  
>Originator:     Fumitoshi UKAI
>Release:        1.0
>Organization:
	"Hewlett-Packard Laboratories Japan, Inc."
>Environment:
	machine		HP Vectra 66/XM
	os		NetBSD/i386 1.0
	target		i386
System: NetBSD vectra1.hplj.yhp.hp.com 1.0 NetBSD 1.0 (VECTRA) #0: Wed Nov 9 11:05:37 JST 1994 ukai@vectra1.hplj.yhp.hp.com:/usr/src/sys/arch/i386/compile/VECTRA i386


>Description:
	``ps aux'' tells the percentage of real memory about almost
	all processes is 0.0.
	This is because mempages, which is number of pages of
	phys. memory (in nlist.c) is not counted in pagesize but in
	bytes.

>How-To-Repeat:
	% ps aux

>Fix:
	apply this patch

--- /usr/src/bin/ps/nlist.c.orig	Thu Nov 24 21:28:18 1994
+++ /usr/src/bin/ps/nlist.c	Thu Nov 24 21:28:58 1994
@@ -46,6 +46,7 @@
 #include <nlist.h>
 #include <stdio.h>
 #include <string.h>
+#include <unistd.h>

 #include "ps.h"

@@ -109,6 +110,7 @@
 		eval = rval = 1;
 	}
 	mempages -= tmp;
+	mempages /= getpagesize();
 #else
 	if (kread(X_ECMX, mempages)) {
 		warnx("ecmx: %s", kvm_geterr(kd));


--
Fumitoshi UKAI,                                           ukai@hplj.hpl.hp.com
Hewlett-Packard Laboratories Japan, Inc.       Kawasaki-shi Kanagawa 213 JAPAN
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: deraadt 
State-Changed-When: Sat Nov 26 13:41:48 PST 1994 
State-Changed-Why:  
The fix was right. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.