Subject: Re: new sysctl(KERN_PROC, ...) interface (was: sysinfo(2))
To: None <tech-kern@netbsd.org>
From: None <erh@nimenees.com>
List: tech-kern
Date: 04/17/2000 03:51:07
On Mon, Apr 17, 2000 at 01:30:09PM +1000, Simon Burge wrote:
> Darren Reed said:
> > I'm not sure if I've seen it mentioned already, but maybe ps should be
> > using a sysctl() which return a block of such sanitized data.  In that
> This is pretty much what I'm proposing.  The current KERN_PROC returns
> a 'struct kinfo_proc' which includes a struct proc plus some other bits
> and pieces.  The 'struct kinfo_proc2' I'm proposing returns "sanitized
> data" (to use your words), even more so after Eric's suggestions to
> handle NETBSD_COMPAT32.
	First: misquoted: I didn't mention the compat32 changes.

re: sanitized data: Yes.  thank you.  that's exactly the point of this.

	re: compat32 changes: ugh.  Changing everything into a u_intXX_t
seems like a bit of a hack, even if it does help keep the structure static
across 32/64-bit and across changes in size of the types of it's elements.
It's also error prone: for instance, from one of your earlier emails, look
at (u_int64_t)(long)ptr and think sign-extension.
	Doing this means that any program using this needs to know how
to convert from u_intXX_t to actualtype_t.  On the other hand, not doing
it means more sensitivity to changes in type sizes.  lose-lose :(

	However, your patch definitely looks like a step in the right
direction.  cool.

eric