bug in sps memory size reporting for Sun-3

Richard A. O'Keefe ok at quintus.UUCP
Thu Jun 2 15:34:29 AEST 1988


In article <618 at vsi1.UUCP>, bitbug at vsi1.UUCP (James Buster) writes:
> In article <11753 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
> >Why not simply use the macro that is provided for this purpose?
> >	#include <sys/param.h>
> >	#define KBYTES(size) (ctob(size) >> 10) /* or ctob(size) / 1024 */
> 
> The KBYTES() macro doesn't exist on Suns (our machines are Sun 3s running
> SunOs 3.5), at least, not anywhere in /usr/include/sys, /usr/include,
> /sys/h, and /sys/ufs. Do you refer to SunOs 4.0, or 4.3 BSD?

Since Chris Torek was suggesting that YOU should #define KBYTES
it is hardly surprising that the macro doesn't already exist.

If the only thing you want is ctob() (or PGSHIFT or NBPG) it suffices
to get it from <machine/param.h> (which <sys/param.h> includes).
That's where they are in SunOS 3.2 and on a Sequent. 
So the two lines YOU have to write to define KBYTES are
	#include <machine/param.h>
And (
	#define KBYTES(size) (ctob(size) >> 10)
Or
	#define KBYTES(size) ((size)*NBPG/1024)
)



More information about the Comp.sources.bugs mailing list