diff options
| author | Matt Jacob <mjacob@FreeBSD.org> | 2001-01-23 00:09:30 +0000 |
|---|---|---|
| committer | Matt Jacob <mjacob@FreeBSD.org> | 2001-01-23 00:09:30 +0000 |
| commit | 97ace1c6acadf1fff16836bb26a7a270471f796b (patch) | |
| tree | d3dcc84d0f92a0986c20bbca40334e8f00c2e921 /usr.bin/vmstat | |
| parent | 6d84d742df9924d001160a5c1e2b2b5ea628ad5d (diff) | |
Notes
Diffstat (limited to 'usr.bin/vmstat')
| -rw-r--r-- | usr.bin/vmstat/vmstat.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 2e5814f3fd63..9c5f15100a0b 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -866,6 +866,7 @@ domem() void dozmem() { + static SLIST_HEAD(vm_zone_list, vm_zone) zlist; vm_zone_t zonep; int nmax = 512; int zused_bytes = 0; @@ -880,7 +881,10 @@ dozmem() "mem-use" ); - kread(X_ZLIST, &zonep, sizeof(zonep)); + SLIST_INIT(&zlist); + kread(X_ZLIST, &zlist, sizeof(zlist)); + zonep = SLIST_FIRST(&zlist); + while (zonep != NULL && nmax) { struct vm_zone zone; char buf[32]; @@ -904,7 +908,7 @@ dozmem() zused_bytes += (zone.ztotal - zone.zfreecnt) * zone.zsize; ztotal_bytes += zone.ztotal * zone.zsize; --nmax; - zonep = zone.znext; + zonep = SLIST_NEXT(&zone, zent); } printf( "------------------------------------------\n" |
