Subject: Re: bin/1019: vmstat doesn't build on pmax.
To: Ted Lemon <mellon@fugue.com>
From: Chris G Demetriou <Chris_G_Demetriou@LAGAVULIN.PDL.CS.CMU.EDU>
List: netbsd-bugs
Date: 05/04/1995 20:01:18
> [ ... ]
> >Synopsis:       vmstat doesn't build on pmax.
> [ ... ]
>
> The following change to usr.bin/vmstat/Makefile should solve the problem.

"Don't treat the symptom, treat the disease."

The -D${MACHINE} is bogus.

the correct solution is:

for each ${MACHINE_ARCH} that have or reasonably can have (actually,
i suppose that'd be "currently can have") multiple ${MACHINE}s:

	(1) replace each ${MACHINE}'s read_names() function with a
	    ${MACHINE}_read_names().
	(2) write a read_names() wrapper (for that ${MACHINE_ARCH})
	    that strcmp()'s the machine value gotten from sysctl to
	    the known valid values of ${MACHINE} for that
	    ${MACHINE_ARCH}, then calls the appropriate
	    ${MACHINE}_read_names() function.

I suppose something would have to be done to avoid collisions from the
various #includes that'd be necessary -- maybe break things into
seperate files?  that'd be nasty, but arguably not nastier than what's
there now or what'd be necessary to do it otherwise.

It may be arguable that this functionality belongs elsewhere --
e.g. libkvm, or something similar.  


the point is, the vmstat (etc.) binaries should be shareable between
all machines with a given ${MACHINE_ARCH} designation.  (that may
require some changes from PAGE_SIZE or NBPG to getpagesize(), too;
i've not looked at the code in question lately.)



chris