Size bug in top(1)

phil at rice.UUCP phil at rice.UUCP
Sat Jul 12 07:52:18 AEST 1986


In article <895 at bu-cs.UUCP>, bzs at bu-cs.UUCP (Barry Shein) writes:
> >In top(1), where it prints out the size of the job and the resident
> >size of the job, it assumes that clicks are 512 bytes.  It does a

Thank you for pointing the bug out.  It will be fixed in the new version.

> >right shift by 1 to convert to K and then prints out the numbers.  The
> >correct thing to do is to use the macro ctob() which is defined in
> >param.h.

Actually, this won't work on a pyramid, where ctob isn't defined.

> -------------begin fix----------
> /*
>  *	BZS at BU-CS.BU.EDU 7/4/86
>  *	 - fix suggested in net.sources.bugs, mostly for SUN
>     (pp->p_tsize + pp->p_dsize + pp->p_ssize) >> 1,
>     pp->p_rssize >> 1,
>  */
> #if PGSHIFT > 10
>       (pp->p_tsize + pp->p_dsize + pp->p_ssize) << (PGSHIFT-10),
>       pp->p_rssize << (PGSHIFT-10),
> #else
>       (pp->p_tsize + pp->p_dsize + pp->p_ssize) >> (10-PGSHIFT),
>       pp->p_rssize >> (10-PGSHIFT),
> #endif
> ------------end fix---------------

That's basically the gist of it.  I have something a little better that
I use in the new version.

I am currently in the process of finishing up version 2.0 of Top.
In it, I hope to incorporate all the changes and fixes that people
have sent to me.  There are also many other important differences.
For example, I have completely abandoned "curses".  It turns out that
not using curses results in the program starting up in about half the
time.  I have also added a small interactive mode, making it possible
to do redraws on demand, and to change the number of displayed processes
and the seconds delay while the program is running.

Watch for it......


-- 
			William LeFebvre
			Department of Computer Science
			Rice University
			<phil at Rice.edu>



More information about the Comp.sources.bugs mailing list