diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-04-26 10:26:46 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-04-26 10:26:46 +0000 |
commit | 1ba2c5434053d6febb4d5ecd1d3a26a4f6bcd6a8 (patch) | |
tree | 7c2d51687a37a72323ccfe4e09f2c5e6188d8e7d /bin/ps/nlist.c | |
parent | 71f2eb9c6cfad8bb1c9647f92805b0fdbfdcaae2 (diff) |
Use the physmem variable to get at the physical memory size (instead of the
avail_end - avail_start difference which is only correct on machines with
contiguous memory); is@netbsd
Diffstat (limited to 'bin/ps/nlist.c')
-rw-r--r-- | bin/ps/nlist.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/bin/ps/nlist.c b/bin/ps/nlist.c index cad80ec609d..534bdaae330 100644 --- a/bin/ps/nlist.c +++ b/bin/ps/nlist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nlist.c,v 1.3 1997/08/04 05:37:04 deraadt Exp $ */ +/* $OpenBSD: nlist.c,v 1.4 1998/04/26 10:26:45 deraadt Exp $ */ /* $NetBSD: nlist.c,v 1.11 1995/03/21 09:08:03 cgd Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)nlist.c 8.4 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: nlist.c,v 1.3 1997/08/04 05:37:04 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: nlist.c,v 1.4 1998/04/26 10:26:45 deraadt Exp $"; #endif #endif /* not lint */ @@ -62,10 +62,8 @@ struct nlist psnl[] = { #define X_FSCALE 0 {"_ccpu"}, #define X_CCPU 1 - {"_avail_start"}, -#define X_AVAILSTART 2 - {"_avail_end"}, -#define X_AVAILEND 3 + {"_physmem"}, +#define X_PHYSMEM 2 {NULL} }; @@ -83,7 +81,6 @@ int donlist() { int rval; - int tmp; rval = 0; nlistread = 1; @@ -96,16 +93,10 @@ donlist() warnx("fscale: %s", kvm_geterr(kd)); eval = rval = 1; } - if (kread(X_AVAILEND, mempages)) { + if (kread(X_PHYSMEM, mempages)) { warnx("avail_start: %s", kvm_geterr(kd)); eval = rval = 1; } - if (kread(X_AVAILSTART, tmp)) { - warnx("avail_end: %s", kvm_geterr(kd)); - eval = rval = 1; - } - mempages -= tmp; - mempages /= getpagesize(); if (kread(X_CCPU, ccpu)) { warnx("ccpu: %s", kvm_geterr(kd)); eval = rval = 1; |