diff options
author | ache <ache@FreeBSD.org> | 1994-11-03 11:41:34 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1994-11-03 11:41:34 +0000 |
commit | fcbce983732fc053ebe891598105f5717e6debf6 (patch) | |
tree | 3314576e2dc8483b3ac63f0421879044ce9413ef /usr.sbin/pstat | |
parent | bbd23b334df6ee37516cf9398aff07483aeadb58 (diff) | |
download | FreeBSD-src-fcbce983732fc053ebe891598105f5717e6debf6.zip FreeBSD-src-fcbce983732fc053ebe891598105f5717e6debf6.tar.gz |
Fix for 'pstat -t' works on vtys
Submitted by: jhay@mikom.csir.co.za
Diffstat (limited to 'usr.sbin/pstat')
-rw-r--r-- | usr.sbin/pstat/pstat.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c index 5e22d39..c2395ad 100644 --- a/usr.sbin/pstat/pstat.c +++ b/usr.sbin/pstat/pstat.c @@ -124,6 +124,12 @@ struct nlist nl[] = { { "_dc_cnt" }, #endif +#ifdef __FreeBSD__ +#define PCCONS (SNPTY+1) + { "_pccons" }, +#define NPCCONS (SNPTY+2) + { "_npccons" }, +#endif { "" } }; @@ -714,10 +720,12 @@ ttymode() if ((tty = malloc(ttyspace * sizeof(*tty))) == NULL) err(1, NULL); #ifndef hp300 - (void)printf("1 console\n"); - KGET(SCONS, *tty); - (void)printf(hdr); - ttyprt(&tty[0], 0); + if (nl[SCONS].n_type != 0) { + (void)printf("1 console\n"); + KGET(SCONS, *tty); + (void)printf(hdr); + ttyprt(&tty[0], 0); + } #endif #ifdef vax if (nl[SNQD].n_type != 0) @@ -753,6 +761,10 @@ ttymode() if (nl[SNDC].n_type != 0) ttytype(tty, "dc", SDC, SNDC); #endif +#ifdef __FreeBSD__ + if (nl[NPCCONS].n_type != 0) + ttytype(tty, "vty", PCCONS, NPCCONS); +#endif if (nl[SNPTY].n_type != 0) ttytype(tty, "pty", SPTY, SNPTY); } @@ -819,7 +831,7 @@ ttyprt(tp, line) else (void)printf("%7s ", name); (void)printf("%2d %3d ", tp->t_rawq.c_cc, tp->t_canq.c_cc); - (void)printf("%3d %4d %3d %3d ", tp->t_outq.c_cc, + (void)printf("%3d %4d %3d %7d ", tp->t_outq.c_cc, tp->t_hiwat, tp->t_lowat, tp->t_column); for (i = j = 0; ttystates[i].flag; i++) if (tp->t_state&ttystates[i].flag) |