Subject: Re: kernel sysctl support for vmstat/iostat
To: Matt Thomas <matt@3am-software.com>
From: Simon Burge <simonb@netbsd.org>
List: tech-kern
Date: 06/18/2000 17:47:13
Matt Thomas wrote:
> At 04:45 PM 6/18/2000 +1000, Simon Burge wrote:
>
> >The problem is that 'struct kinfo_proc' includes a 'struct vmspace',
> >so we need to include _something_ to get that structure definition.
> >Because non-kernel source always includes those 4 headers, sysctl(3)
> >just says include include <sys/param.h> and <sys/sysctl.h>. It's kernel
> >source that need to explicity include <vm/vm.h>. If we localise the
> >inclusion to <sys/sysctl.h> now that's less kernel source to fix later
> >when you do remove <vm/*.h>...
>
> You really should not use vmspace but define your own structure with the
> information you need. Then it's not a problem.
Except that some of the libkvm routines need the data in the struct
vmspace to do its work. The 'struct kinfo_proc2' stuff I did does
have its own structure, but we can't just turf out the old interface
(as much as I'd like to!).
Simon.