projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added depend label
[unix-history]
/
usr
/
src
/
usr.bin
/
systat
/
swap.c
diff --git
a/usr/src/usr.bin/systat/swap.c
b/usr/src/usr.bin/systat/swap.c
index
155dc86
..
94602f4
100644
(file)
--- a/
usr/src/usr.bin/systat/swap.c
+++ b/
usr/src/usr.bin/systat/swap.c
@@
-1,6
+1,12
@@
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
#ifndef lint
#ifndef lint
-static char
*sccsid = "@(#)swap.c 1.8
(Berkeley) %G%";
-#endif
+static char
sccsid[] = "@(#)swap.c 5.4
(Berkeley) %G%";
+#endif
not lint
#include "systat.h"
#include <sys/dir.h>
#include "systat.h"
#include <sys/dir.h>
@@
-195,7
+201,7
@@
initswap()
nlist("/vmunix", nlst);
if (nlst[X_PROC].n_type == 0) {
error("namelist on /vmunix failed");
nlist("/vmunix", nlst);
if (nlst[X_PROC].n_type == 0) {
error("namelist on /vmunix failed");
- return;
+ return
(0)
;
}
}
if (nswdev == 0) {
}
}
if (nswdev == 0) {
@@
-203,6
+209,8
@@
initswap()
dmmax = getw(nlst[X_DMMAX].n_value);
dmtext = getw(nlst[X_DMTEXT].n_value);
nswdev = getw(nlst[X_NSWDEV].n_value);
dmmax = getw(nlst[X_DMMAX].n_value);
dmtext = getw(nlst[X_DMTEXT].n_value);
nswdev = getw(nlst[X_NSWDEV].n_value);
+ if (nswdev > MAXSWAPDEV)
+ nswdev = MAXSWAPDEV;
swdevt = (struct swdevt *)calloc(nswdev, sizeof (*swdevt));
klseek(kmem, nlst[X_SWDEVT].n_value, L_SET);
read(kmem, swdevt, nswdev * sizeof (struct swdevt));
swdevt = (struct swdevt *)calloc(nswdev, sizeof (*swdevt));
klseek(kmem, nlst[X_SWDEVT].n_value, L_SET);
read(kmem, swdevt, nswdev * sizeof (struct swdevt));
@@
-218,11
+226,12
@@
initswap()
if (kprocp == NULL)
kprocp = (struct proc *)calloc(nproc, sizeof (struct proc));
if (usrpt != NULL)
if (kprocp == NULL)
kprocp = (struct proc *)calloc(nproc, sizeof (struct proc));
if (usrpt != NULL)
- return;
+ return
(1)
;
usrpt = (struct pte *)nlst[X_USRPT].n_value;
Usrptma = (struct pte *)nlst[X_USRPTMAP].n_value;
if (pt == NULL)
pt = (struct p_times *)malloc(nproc * sizeof (struct p_times));
usrpt = (struct pte *)nlst[X_USRPT].n_value;
Usrptma = (struct pte *)nlst[X_USRPTMAP].n_value;
if (pt == NULL)
pt = (struct p_times *)malloc(nproc * sizeof (struct p_times));
+ return(1);
}
fetchswap()
}
fetchswap()
@@
-257,10
+266,12
@@
char *devnames[] =
{ "hp", "ht", "up", "rk", "sw", "tm", "ts", "mt", "tu", "ra", "ut",
"rb", "rx", "rl" };
#endif
{ "hp", "ht", "up", "rk", "sw", "tm", "ts", "mt", "tu", "ra", "ut",
"rb", "rx", "rl" };
#endif
+#ifdef tahoe
+char *devnames[] = { "ud", "vd", "xp", "cy", "sw" };
+#endif
labelswap()
{
labelswap()
{
- register int i, j;
register int row;
if (nswdev == 0) {
register int row;
if (nswdev == 0) {