aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pstat
diff options
context:
space:
mode:
authorJohn Dyson <dyson@FreeBSD.org>1996-03-04 12:40:29 +0000
committerJohn Dyson <dyson@FreeBSD.org>1996-03-04 12:40:29 +0000
commit739a189a107d5d5b43337f68079b9248463c997e (patch)
treeef490b0d8a40a327acb2358e964cdd1ceab3de0c /usr.sbin/pstat
parentdaf818451bf2be70f8bdd1a2ee5a265cd6a44ced (diff)
Notes
Diffstat (limited to 'usr.sbin/pstat')
-rw-r--r--usr.sbin/pstat/pstat.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c
index c20469c6d54e..c787fe1f53e4 100644
--- a/usr.sbin/pstat/pstat.c
+++ b/usr.sbin/pstat/pstat.c
@@ -1061,13 +1061,14 @@ swapmode()
struct swdevt *sw;
long blocksize, *perdev;
struct rlist head;
- struct rlist *swaplist;
+ struct rlisthdr swaplist;
+ struct rlist *swapptr;
u_long ptr;
KGET(VM_NSWAP, nswap);
KGET(VM_NSWDEV, nswdev);
KGET(VM_DMMAX, dmmax);
- KGET(VM_SWAPLIST, swaplist);
+ KGET1(VM_SWAPLIST, &swaplist, sizeof swaplist, "swaplist");
if ((sw = malloc(nswdev * sizeof(*sw))) == NULL ||
(perdev = malloc(nswdev * sizeof(*perdev))) == NULL)
err(1, "malloc");
@@ -1077,10 +1078,11 @@ swapmode()
/* Count up swap space. */
nfree = 0;
memset(perdev, 0, nswdev * sizeof(*perdev));
- while (swaplist) {
+ swapptr = swaplist.rlh_list;
+ while (swapptr) {
int top, bottom, next_block;
- KGET2(swaplist, &head, sizeof(struct rlist), "swaplist");
+ KGET2(swapptr, &head, sizeof(struct rlist), "swapptr");
top = head.rl_end;
bottom = head.rl_start;
@@ -1108,7 +1110,7 @@ swapmode()
perdev[(bottom / dmmax) % nswdev] +=
top - bottom + 1;
- swaplist = head.rl_next;
+ swapptr = head.rl_next;
}
header = getbsize(&hlen, &blocksize);