Subject: Re: kernel sysctl support for vmstat/iostat
To: Simon Burge <>
From: Matt Thomas <>
List: tech-kern
Date: 06/18/2000 00:17:33
At 04:45 PM 6/18/2000 +1000, Simon Burge wrote:
>matthew green wrote:
> >    I also plan to remove the "#ifndef _KERNEL" around sysctl.h's inclusion
> >    of
> >
> >       #include <sys/time.h>
> >       #include <sys/ucred.h>
> >       #include <sys/proc.h>
> >       #include <vm/vm.h>
> >
> >    It's a pain to have to remember to include these files (especially
> >    <vm/vm.h> just to include <sys/sysctl.h>.
> >
> >
> > i don't care about the first 3, but i definately wouldn't mind seeing
>                                                    would mind ??
> > <vm/vm.h> going into <sys/sysctl.h> for now.  after 1.5 branch, i am
> > planning on removing <vm/*.h>.  if you make this change, please update
> > the documentation as such.
>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.
Matt Thomas               Internet:
3am Software Foundry      WWW URL:
Cupertino, CA             Disclaimer: I avow all knowledge of this message