chris@umcp-cs.UUCP (Chris Torek) (06/19/85)
[There are also 4.1BSD and 4.2-Pyramid changes, under separate cover.] The following is a set of changes to 4.2BSD Vax Unix to add a twenex-like control-T ``usestat'' character. Most of the code was written by Rehmi Post (who also made up the diff listings). The following note (by me, Chris Torek) certainly applies to the Vax 4.2 code, and probably to the other changes as well. We originally turned this on via ``options USESTAT'' in the kernel config files. This is actually a bad idea, because then ``pstat -t'' breaks. I'd suggest that you put a #define USESTAT in ioctl.h right before the first #ifdef USESTAT, instead. However, I will also note that since we haven't got things set up that way right now, I don't know if that really works right. Without further ado, the 4.2BSD Vax Unix changes: -------- *** /tmp/,RCSt1000250 Sat Aug 11 17:21:22 1984 --- tty.h Sat Aug 11 01:32:57 1984 *************** *** 61,66 char t_col; /* tty */ char t_ispeed, t_ospeed; /* device */ char t_rocount, t_rocol; /* tty */ struct ttychars t_chars; /* tty */ /* be careful of tchars & co. */ #define t_erase t_chars.tc_erase --- 61,69 ----- char t_col; /* tty */ char t_ispeed, t_ospeed; /* device */ char t_rocount, t_rocol; /* tty */ + #ifdef USESTAT + short t_mflags; /* some of both */ + #endif struct ttychars t_chars; /* tty */ /* be careful of tchars & co. */ #define t_erase t_chars.tc_erase *************** *** 77,82 #define t_flushc t_chars.tc_flushc #define t_werasc t_chars.tc_werasc #define t_lnextc t_chars.tc_lnextc }; #define TTIPRI 28 --- 80,89 ----- #define t_flushc t_chars.tc_flushc #define t_werasc t_chars.tc_werasc #define t_lnextc t_chars.tc_lnextc + #ifdef USESTAT + #define t_usemap t_chars.tc_usemap + #define t_usest t_chars.tc_usest + #endif }; #define TTIPRI 28 *************** *** 128,130 #define TAB 4 #define VTAB 5 #define RETURN 6 --- 135,141 ----- #define TAB 4 #define VTAB 5 #define RETURN 6 + + #ifdef USESTAT /* t_mflags bits */ + #define Ust_Timing 0x0001 /* We're timing out, ignore ^T's */ + #endif *** /tmp/,RCSt1000250 Sat Aug 11 17:21:27 1984 --- ttychars.h Fri Aug 10 23:55:06 1984 *************** *** 21,26 char tc_flushc; /* flush output (toggles) */ char tc_werasc; /* word erase */ char tc_lnextc; /* literal next character */ }; #define CTRL(c) ('c'&037) --- 21,30 ----- char tc_flushc; /* flush output (toggles) */ char tc_werasc; /* word erase */ char tc_lnextc; /* literal next character */ + #ifdef USESTAT + short tc_usemap; /* usestat info bitmap */ + char tc_usest; /* usestat character */ + #endif }; #define CTRL(c) ('c'&037) *************** *** 41,44 #define CFLUSH CTRL(o) #define CWERASE CTRL(w) #define CLNEXT CTRL(v) #endif --- 45,52 ----- #define CFLUSH CTRL(o) #define CWERASE CTRL(w) #define CLNEXT CTRL(v) + #ifdef USESTAT + #define CUSEST CTRL(t) + #define CUSEMAP (~(Ust_uptime|Ust_flags|Ust_childs)) + #endif USESTAT #endif *** /tmp/,RCSt1000250 Sat Aug 11 17:21:31 1984 --- ioctl.h Sat Aug 11 00:54:36 1984 *************** *** 29,34 char t_werasc; /* word erase */ char t_lnextc; /* literal next character */ }; #ifndef _IO /* --- 29,40 ----- char t_werasc; /* word erase */ char t_lnextc; /* literal next character */ }; + #ifdef USESTAT + struct auxchars { + short t_usemap; /* usestat info bitmap */ + char t_usest; /* usestat character */ + }; + #endif #ifndef _IO /* *************** *** 170,175 #define TIOCMBIC _IOW(t, 107, int) /* bic modem bits */ #define TIOCMGET _IOR(t, 106, int) /* get all modem bits */ #define TIOCREMOTE _IO(t, 105) /* remote input editing */ #define OTTYDISC 0 /* old, v7 std tty driver */ #define NETLDISC 1 /* line discip for berk net */ --- 176,198 ----- #define TIOCMBIC _IOW(t, 107, int) /* bic modem bits */ #define TIOCMGET _IOR(t, 106, int) /* get all modem bits */ #define TIOCREMOTE _IO(t, 105) /* remote input editing */ + + #ifdef USESTAT + #define TIOCSAUXC _IOW(t, 59, struct auxchars)/* set extra tty chars */ + #define TIOCGAUXC _IOR(t, 58, struct auxchars)/* get extra tty chars */ + #define Ust_load1 0x0001 /* one-minute load average */ + #define Ust_load5 0x0002 /* five-minute load average */ + #define Ust_load15 0x0004 /* fifteen-minute load average */ + #define Ust_uptime 0x0008 /* time since last boot */ + #define Ust_pgrp 0x0010 /* pgroup leader */ + #define Ust_childs 0x0020 /* and N children */ + #define Ust_pcpu 0x0040 /* %cpu they're getting */ + #define Ust_incore 0x0080 /* size and rss of them */ + #define Ust_flags 0x0100 /* OR of all their flags */ + #define Ust_state 0x0200 /* rough state (in i/o wait, etc) */ + #define Ust_rawcpu 0x0400 /* raw or cooked cpu %'age */ + + #endif USESTAT #define OTTYDISC 0 /* old, v7 std tty driver */ #define NETLDISC 1 /* line discip for berk net */ *** /tmp/,RCSt1000264 Sat Aug 11 17:23:02 1984 --- tty.c Sat Aug 11 01:55:56 1984 *************** *** 125,130 struct ttychars ttydefaults = { CERASE, CKILL, CINTR, CQUIT, CSTART, CSTOP, CEOF, CBRK, CSUSP, CDSUSP, CRPRNT, CFLUSH, CWERASE,CLNEXT }; ttychars(tp) --- 125,133 ----- struct ttychars ttydefaults = { CERASE, CKILL, CINTR, CQUIT, CSTART, CSTOP, CEOF, CBRK, CSUSP, CDSUSP, CRPRNT, CFLUSH, CWERASE,CLNEXT + #ifdef USESTAT + , CUSEMAP,CUSEST + #endif }; ttychars(tp) *************** *** 281,286 case TIOCLBIC: case TIOCLSET: case TIOCSTI: #define bit(a) (1<<(a-1)) while (tp->t_line == NTTYDISC && u.u_procp->p_pgrp != tp->t_pgrp && tp == u.u_ttyp && --- 284,292 ----- case TIOCLBIC: case TIOCLSET: case TIOCSTI: + #ifdef USESTAT + case TIOCSAUXC: + #endif #define bit(a) (1<<(a-1)) while (tp->t_line == NTTYDISC && u.u_procp->p_pgrp != tp->t_pgrp && tp == u.u_ttyp && *************** *** 469,474 bcopy((caddr_t)&tp->t_suspc, data, sizeof (struct ltchars)); break; /* * Modify local mode word. */ --- 475,482 ----- bcopy((caddr_t)&tp->t_suspc, data, sizeof (struct ltchars)); break; + #ifdef USESTAT + /* * Set/get local aux chars */ *************** *** 470,475 break; /* * Modify local mode word. */ case TIOCLBIS: --- 478,496 ----- #ifdef USESTAT /* + * Set/get local aux chars + */ + case TIOCGAUXC: + bcopy((caddr_t)&tp->t_usemap, data, sizeof (struct auxchars)); + break; + + case TIOCSAUXC: + bcopy(data, (caddr_t)&tp->t_usemap, sizeof (struct auxchars)); + break; + + #endif + + /* * Modify local mode word. */ case TIOCLBIS: *************** *** 781,793 goto endcase; } /* * BRL: proc printout. Should have ioctl to turn this on and off. */ if (c == CTRL(t)) { ttyinfo(tp); goto endcase; } /* * New line discipline, * check word erase/reprint line. --- 802,821 ----- goto endcase; } + #ifndef USESTAT /* bye bye, till that ioctl. */ /* * BRL: proc printout. Should have ioctl to turn this on and off. */ if (c == CTRL(t)) { ttyinfo(tp); goto endcase; } + #else USESTAT + if (c == tp->t_usest) { + ttystatout(tp); + goto endcase; + } + #endif /* * New line discipline, * check word erase/reprint line. *************** *** 1577,1583 } #endif ! /* * T T Y I N F O *** BRL 4.2 only! *** * --- 1605,1611 ----- } #endif ! #ifndef USESTAT /* * T T Y I N F O *** BRL 4.2 only! *** * *************** *** 1655,1657 } } } --- 1683,1907 ----- } } } + #endif + + + #ifdef USESTAT + + /* + * print out primitive system stats (for now) rehmi 18 Apr 83 + * Last modification rehmi & chris 10 Jun 83 + * Added clearer stats and a few other fixes rehmi 2 Jul 83 + * Shortened message and kludged tty wait check rehmi 16 Nov 83 + * Fixed problem with "k of" in previous version. chris 19 Nov 83 + * Fixed problem with zombie memory measurements. james 20 Nov 83 + * Added priorities on states, 1 second timeouts. rehmi 30 Apr 84 + * Converted from 4.1 to osx. rehmi@maryland 5 Aug 84 + * Converted from osx to BRL 4.2. rehmi 10 Aug 84 + */ + + /* States of a process. */ + char *states[] = { + "losing", "waiting", "swapped", "running", + "idling", "zombied", "stopped", "kbd wait" + }; + + /* which states are most important to know (least best) */ + char st_pri[] = { + 7, 3, 4, 1, + 2, 6, 5, 0 + }; + + ttystatout(tp) + register struct tty *tp; + { + register struct proc *p; + register int x, f = 0, cf = 0; + int size = 0, rss = 0, ptime = 0, state = 0, pflg = 0; + float pcpu = 0.0; + static double magic = 4294967296.0; + extern double avenrun[]; + struct proc *this; + char *s; + int ttystatgo(); + + /* + * Macro to use &s[l] if nothing else has been printed + */ + #define comma(s,l) (s + (cf++ ? 0 : l)) + + /* + * Should we break to next line? + */ + #define newp if (tp->t_col > 64) {ttyoutput('\n', tp); cf=0;} else + + /* + * If waiting on hoggage, discard + * If timing out, discard + */ + if (tp->t_state & TS_ASLEEP || tp->t_mflags & Ust_Timing) + return; + + /* + * set up the timeout + */ + tp->t_mflags |= Ust_Timing; /* disable ^T */ + timeout(ttystatgo, tp, hz); /* wait a second before re_enabling */ + + /* + * Print uptime + */ + if (tp->t_usemap&Ust_uptime) { + x = (int) (time.tv_sec - boottime.tv_sec); + if (x < 0) + x = 0; + ttyout("up ", tp); + if (x/86400 > 0) { /* days */ + ttyoutint(x/86400, 10, 1, tp); + ttyout("d ", tp); + x %= 86400; + } + if (x/3600 > 0) { /* hours */ + ttyoutint(x/3600, 10, 1, tp); + ttyout("h ", tp); + x %= 3600; + } + ttyoutint(x/60, 10, 2, tp); /* minutes */ + ttyout("m", tp); + cf++; + } + newp; + + #define ttyoutfloat(f) (ttyoutint((f)/100, 10, 1, tp), \ + ttyoutput('.', tp), \ + ttyoutint((f)%100, 10, 2, tp)) + + /* + * Print load average + */ + if (tp->t_usemap&(Ust_load1|Ust_load5|Ust_load15)) { + ttyout(comma(", load", 2), tp); + if (tp->t_usemap&Ust_load1) { + ttyoutput(' ', tp); + x = avenrun[0]*100.0 + 0.5; + if (x < 0) + x = 0; + ttyoutfloat(x); + } + if (tp->t_usemap&Ust_load5) { + ttyoutput(' ', tp); + x = avenrun[1]*100.0 + 0.5; + if (x < 0) + x = 0; + ttyoutfloat(x); + } + if (tp->t_usemap&Ust_load15) { + ttyoutput(' ', tp); + x = avenrun[2]*100.0 + 0.5; + if (x < 0) + x = 0; + ttyoutfloat(x); + } + newp; + } + + for (p = proc; p < procNPROC; p++) { + if (p->p_pgrp == tp->t_pgrp) { + if (tp->t_pgrp == p->p_pid) + this = p; + if (st_pri[p->p_stat] < st_pri[state]) + state = p->p_stat; + if(p->p_stat==SSLEEP && + p->p_wchan==(caddr_t)&tp->t_rawq) + state=7; + if (p->p_stat != SZOMB) { + pcpu = pcpu + (float)p->p_pctcpu; + size += p->p_tsize + p->p_ssize + p->p_dsize; + rss += p->p_rssize; + pflg |= p->p_flag; + ptime += p->p_time; + } + f++; + } + } + + if (f) { + /* + * Print pid, %cpu, size, rss + */ + if (tp->t_usemap&Ust_pgrp) { + ttyout(comma(", pid ", 2), tp); + ttyoutint(tp->t_pgrp, 10, 1, tp); + } + newp; + if (tp->t_usemap&Ust_childs) { + ttyout(comma(" children ", 1), tp); + ttyoutint(f, 10, 1, tp); + } + newp; + if (tp->t_usemap&Ust_pcpu) { + ttyout(comma(", %cpu ", 2), tp); + if (tp->t_usemap&Ust_rawcpu) + x = pcpu*10000.0 + 0.5; + else + x = 10000.0*pcpu / + (1.0 - ( (1<<(ptime>>2)) / magic) ); + /* sick!!!!!!!!!!!!! */ + ttyoutfloat(x); + } + newp; + if (tp->t_usemap&Ust_incore) { + ttyout(comma(", ", 2), tp); + ttyoutint(rss>>1, 10, 1, tp); + ttyout("k of ", tp); + ttyoutint(size>>1, 10, 1, tp); + ttyoutput('k', tp); + } + newp; + if (tp->t_usemap&Ust_flags) { + ttyout(comma(", flags ", 2), tp); + ttyoutint(pflg, 16, 1, tp); + } + newp; + if (tp->t_usemap&Ust_state) { + ttyout(comma(", ", 2), tp); + ttyout(states[state], tp); + cf++; + } + if (cf) + ttyoutput('\n', tp); + } + else + ttyout(comma("; no process\n", 2), tp); + + /* really should make some use of the BRL sleep comments here... someday... */ + + /* + * Reset "t_rocount" so pending input will + * be retyped if backspacing follows. + */ + + tp->t_rocount = 0; + } + + ttystatgo(tp) + register struct tty *tp; + { + tp->t_mflags &= ~Ust_Timing; + } + + ttyoutint(n, base, min, tp) + register int n, base, min; + register struct tty *tp; + { + char info[16]; + register char *p = info; + + while (--min >= 0 || n) { + *p++ = "0123456789abcdef"[n%base]; + n /= base; + } + while (p > info) + ttyoutput(*--p, tp); + } + #endif USESTAT *** sys/stty.c Tue Aug 7 19:09:23 1984 --- /usr/src/bin/stty.c Fri Aug 31 18:10:13 1984 *************** *** 1,5 #ifndef lint ! static char *sccsid ="@(#)stty.c 4.15 (Maryland) 8/8/84"; #endif /* * set teletype modes --- 1,5 ----- #ifndef lint ! static char *sccsid ="@(#)stty.c 4.14 (Berkeley) 7/6/83"; #endif /* * set teletype modes *************** *** 8,16 #include <stdio.h> #include <sgtty.h> - #define pcol(x,y) pcoln(x,y,7) - #define pco2(x,y) pcoln(x,y,6) - struct { char *string; --- 8,13 ----- #include <stdio.h> #include <sgtty.h> struct { char *string; *************** *** 33,40 "9600", B9600, "exta", EXTA, "19200", EXTA, - "19.2k", EXTA, - "19.2", EXTA, "extb", EXTB, "38400", EXTB, "38.4k", EXTB, --- 30,35 ----- "9600", B9600, "exta", EXTA, "19200", EXTA, "extb", EXTB, "38400", EXTB, 0, *************** *** 37,44 "19.2", EXTA, "extb", EXTB, "38400", EXTB, - "38.4k", EXTB, - "38.4", EXTB, 0, }; struct --- 32,37 ----- "19200", EXTA, "extb", EXTB, "38400", EXTB, 0, }; struct *************** *** 131,178 0, }; - #ifdef USESTAT - struct Ust_option { - char *uo_name; - short uo_set, uo_clear; - } Ust_options[] = { - "load1", Ust_load1, 0, - "-load1", 0, Ust_load1, - "load5", Ust_load5, 0, - "-load5", 0, Ust_load5, - "load15", Ust_load15, 0, - "-load15", 0, Ust_load15, - "load", Ust_load1|Ust_load5|Ust_load15, 0, - "-load", 0, Ust_load1|Ust_load5|Ust_load15, - "uptime", Ust_uptime, 0, - "-uptime", 0, Ust_uptime, - "pid", Ust_pgrp, 0, - "-pid", 0, Ust_pgrp, - "children", Ust_childs, 0, - "-children", 0, Ust_childs, - "cpu", Ust_pcpu, 0, - "-cpu", 0, Ust_pcpu, - "size", Ust_incore, 0, - "-size", 0, Ust_incore, - "flags", Ust_flags, 0, - "-flags", 0, Ust_flags, - "state", Ust_state, 0, - "-state", 0, Ust_state, - "rawcpu", Ust_rawcpu, 0, - "-rawcpu", 0, Ust_rawcpu, - "cookedcpu", 0, Ust_rawcpu, - "stdusest", Ust_load1|Ust_load5|Ust_load15|Ust_pgrp| - Ust_pcpu|Ust_incore|Ust_state|Ust_rawcpu, - Ust_uptime|Ust_childs|Ust_flags, - "-usest", 0, 0, - "-stdusest", Ust_load1|Ust_load15|Ust_uptime| - Ust_pcpu|Ust_incore|Ust_state, - Ust_childs|Ust_pgrp|Ust_flags| - Ust_rawcpu|Ust_load5, - 0, 0, 0 - }; - #endif USESTAT - struct tchars tc; struct ltchars ltc; struct sgttyb mode; --- 124,129 ----- 0, }; struct tchars tc; struct ltchars ltc; struct sgttyb mode; *************** *** 176,184 struct tchars tc; struct ltchars ltc; struct sgttyb mode; - #ifdef USESTAT - struct auxchars auxil; - #endif USESTAT int lmode; int oldisc, ldisc; --- 127,132 ----- struct tchars tc; struct ltchars ltc; struct sgttyb mode; int lmode; int oldisc, ldisc; *************** *** 182,188 int lmode; int oldisc, ldisc; - struct special { char *name; char *cp; --- 130,135 ----- int lmode; int oldisc, ldisc; struct special { char *name; char *cp; *************** *** 202,210 "flush", <c.t_flushc, CFLUSH, "werase", <c.t_werasc, CWERASE, "lnext", <c.t_lnextc, CLNEXT, - #ifdef USESTAT - "usest", &auxil.t_usest, CUSEST, - #endif USESTAT 0 }; char *arg; --- 149,154 ----- "flush", <c.t_flushc, CFLUSH, "werase", <c.t_werasc, CWERASE, "lnext", <c.t_lnextc, CLNEXT, 0 }; char *arg; *************** *** 214,220 main(iargc, iargv) char **iargv; { ! register int i; register struct special *sp; char obuf[BUFSIZ]; --- 158,164 ----- main(iargc, iargv) char **iargv; { ! int i; register struct special *sp; char obuf[BUFSIZ]; *************** *** 227,235 ioctl(1, TIOCGETC, &tc); ioctl(1, TIOCLGET, &lmode); ioctl(1, TIOCGLTC, <c); - #ifdef USESTAT - ioctl(1, TIOCGAUXC, &auxil); - #endif USESTAT if(argc == 1) { prmodes(0); exit(0); --- 171,176 ----- ioctl(1, TIOCGETC, &tc); ioctl(1, TIOCLGET, &lmode); ioctl(1, TIOCGLTC, <c); if(argc == 1) { prmodes(0); exit(0); *************** *** 321,328 } for(i=0; speeds[i].string; i++) if(eq(speeds[i].string)) { ! mode.sg_ispeed = ! mode.sg_ospeed = speeds[i].speed; goto cont; } if (eq("speed")) { --- 262,268 ----- } for(i=0; speeds[i].string; i++) if(eq(speeds[i].string)) { ! mode.sg_ispeed = mode.sg_ospeed = speeds[i].speed; goto cont; } if (eq("speed")) { *************** *** 341,347 mode.sg_flags |= modes[i].set; lmode &= ~modes[i].lreset; lmode |= modes[i].lset; - goto cont; } #ifdef USESTAT for(i=0; Ust_options[i].uo_name; i++) --- 281,286 ----- mode.sg_flags |= modes[i].set; lmode &= ~modes[i].lreset; lmode |= modes[i].lset; } if(arg) fprintf(stderr,"unknown mode: %s\n", arg); *************** *** 343,356 lmode |= modes[i].lset; goto cont; } - #ifdef USESTAT - for(i=0; Ust_options[i].uo_name; i++) - if(eq(Ust_options[i].uo_name)) { - auxil.t_usemap |= Ust_options[i].uo_set; - auxil.t_usemap &= ~Ust_options[i].uo_clear; - continue; - } - #endif USESTAT if(arg) fprintf(stderr,"unknown mode: %s\n", arg); cont: ; --- 282,287 ----- lmode &= ~modes[i].lreset; lmode |= modes[i].lset; } if(arg) fprintf(stderr,"unknown mode: %s\n", arg); cont: *************** *** 353,359 #endif USESTAT if(arg) fprintf(stderr,"unknown mode: %s\n", arg); ! cont: ; } done: ioctl(1, TIOCSETN, &mode); --- 284,291 ----- } if(arg) fprintf(stderr,"unknown mode: %s\n", arg); ! cont: ! ; } done: ioctl(1, TIOCSETN, &mode); *************** *** 360,368 ioctl(1, TIOCSETC, &tc); ioctl(1, TIOCSLTC, <c); ioctl(1, TIOCLSET, &lmode); ! #ifdef USESTAT ! ioctl(1, TIOCSAUXC, &auxil); ! #endif USESTAT } eq(string) --- 292,298 ----- ioctl(1, TIOCSETC, &tc); ioctl(1, TIOCSLTC, <c); ioctl(1, TIOCLSET, &lmode); ! exit(0); } eq(string) *************** *** 366,372 } eq(string) ! register char *string; { register int i; --- 296,302 ----- } eq(string) ! char *string; { int i; *************** *** 368,374 eq(string) register char *string; { ! register int i; if(!arg) return(0); --- 298,304 ----- eq(string) char *string; { ! int i; if(!arg) return(0); *************** *** 437,443 int newcrt = (lmode&(LCTLECH|LCRTBS)) == (LCTLECH|LCRTBS) && (lmode&(LCRTERA|LCRTKIL)) == ((mode.sg_ospeed > B300) ? LCRTERA|LCRTKIL : 0); ! int nothing = 1; if (newcrt) { if (all==2) fprintf(stderr, "crt: (crtbs crterase crtkill ctlecho) "); --- 367,373 ----- int newcrt = (lmode&(LCTLECH|LCRTBS)) == (LCTLECH|LCRTBS) && (lmode&(LCRTERA|LCRTKIL)) == ((mode.sg_ospeed > B300) ? LCRTERA|LCRTKIL : 0); ! int nothing = 1; if (newcrt) { if (all==2) fprintf(stderr, "crt: (crtbs crterase crtkill ctlecho) "); *************** *** 463,469 lpit(LLITOUT, "-litout "); lpit(LNOHANG, "-nohang "); if (any) { ! fprintf(stderr, "\n"); any = 0; nothing = 0; } --- 393,399 ----- lpit(LLITOUT, "-litout "); lpit(LNOHANG, "-nohang "); if (any) { ! fprintf(stderr,"\n"); any = 0; nothing = 0; } *************** *** 494,500 break; case NTTYDISC: - #ifdef USESTAT fprintf(stderr,"\ erase kill weras rprnt flush lnext susp intr quit stop eof usest\n"); pco2(mode.sg_erase, -1); --- 424,429 ----- break; case NTTYDISC: fprintf(stderr,"\ erase kill werase rprnt flush lnext susp intr quit stop eof\ \n"); *************** *** 496,517 case NTTYDISC: #ifdef USESTAT fprintf(stderr,"\ ! erase kill weras rprnt flush lnext susp intr quit stop eof usest\n"); ! pco2(mode.sg_erase, -1); ! pco2(mode.sg_kill, -1); ! pco2(ltc.t_werasc, -1); ! pco2(ltc.t_rprntc, -1); ! pco2(ltc.t_flushc, -1); ! pco2(ltc.t_lnextc, -1); ! pco2(ltc.t_suspc, ltc.t_dsuspc); ! pco2(tc.t_intrc, -1); ! pco2(tc.t_quitc, -1); ! pco2(tc.t_stopc, tc.t_startc); ! pco2(tc.t_eofc, tc.t_brkc); ! pco2(auxil.t_usest, -1); ! #else USESTAT ! fprintf(stderr,"\ ! erase kill werase rprnt flush lnext susp intr quit stop eof\n"); pcol(mode.sg_erase, -1); pcol(mode.sg_kill, -1); pcol(ltc.t_werasc, -1); --- 425,432 ----- case NTTYDISC: fprintf(stderr,"\ ! erase kill werase rprnt flush lnext susp intr quit stop eof\ ! \n"); pcol(mode.sg_erase, -1); pcol(mode.sg_kill, -1); pcol(ltc.t_werasc, -1); *************** *** 523,529 pcol(tc.t_quitc, -1); pcol(tc.t_stopc, tc.t_startc); pcol(tc.t_eofc, tc.t_brkc); - #endif USESTAT fprintf(stderr,"\n"); break; } --- 438,443 ----- pcol(tc.t_quitc, -1); pcol(tc.t_stopc, tc.t_startc); pcol(tc.t_eofc, tc.t_brkc); fprintf(stderr,"\n"); break; } *************** *** 542,569 if (!first) fprintf(stderr, "\n"); } - #ifdef USESTAT - #define map(str,bit) fprintf(stderr, str + ((auxil.t_usemap&bit) != 0)) - #define Ust_load3 (Ust_load1|Ust_load5|Ust_load15) - if (all == 2 && ldisc == NTTYDISC) { - if ((auxil.t_usemap&Ust_load3)==Ust_load3) - fprintf (stderr, "load (load1 load5 load15) "); - else { - map("-load1 ", Ust_load1); - map("-load5 ", Ust_load5); - map("-load15 ", Ust_load15); - } - map("-uptime ", Ust_uptime); - map("-pid ", Ust_pgrp); - map("-children ", Ust_childs); - map("-cpu ", Ust_pcpu); - map("-size ", Ust_incore); - map("-flags ", Ust_flags); - map("-state ", Ust_state); - map("-rawcpu ", Ust_rawcpu); - putc ('\n', stderr); - } - #endif USESTAT } pcoln(ch1, ch2, n) --- 456,461 ----- if (!first) fprintf(stderr, "\n"); } } pcol(ch1, ch2) *************** *** 566,573 #endif USESTAT } ! pcoln(ch1, ch2, n) ! int ch1, ch2, n; { int nout = 0; --- 458,465 ----- } } ! pcol(ch1, ch2) ! int ch1, ch2; { int nout = 0; *************** *** 599,605 nout++; } } ! while (nout < n) { fprintf(stderr, " "); nout++; } --- 491,497 ----- nout++; } } ! while (nout < 7) { fprintf(stderr, " "); nout++; } -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251) UUCP: seismo!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@maryland