[1123] in Athena Bugs
RT 6.0R (kernel): control-T sizes off by factor of four.
daemon@ATHENA.MIT.EDU (Bill Sommerfeld)
Wed Oct 5 00:46:22 1988
Date: Wed, 5 Oct 88 00:46:01 EDT
From: Bill Sommerfeld <wesommer@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU
The size reported by typing control-T while a process is running is
off by a factor of four on the RT.
Examination of the code in question (/sys/sys/tty.c) shows an
assumption of a 512 byte page size (yick); `rss' and `size' are in
units of pages, and the RT has a 2KB pagesize.
SUGGESTED FIX (untested; this _should_ work on both machine types):
change this code (at around line 1965 or so):
if (tp->t_statmask&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);
}
to:
if (tp->t_statmask&UST_INCORE) {
ttyout(comma(", ", 2), tp);
ttyoutint(ptob(rss)>>10, 10, 1, tp);
ttyout("k of ", tp);
ttyoutint(ptob(size)>>10, 10, 1, tp);
ttyoutput('k', tp);
}
`ptob' ("pages to bytes") is a macro defined in /sys/h/vmmac.h; if it
is not already included in tty.c, tty.c should be changed to include
"../h/vm.h" (vmmac.h depends on definitions included by vm.h).
For sanity, this change should be made to both RT and VAX kernels.
- Bill