Subject: Re: sysctl(KERN_PROC2) implementation
To: Simon Burge <simonb@netbsd.org>
From: Eduardo Horvath <eeh@turbolinux.com>
List: tech-kern
Date: 04/16/2000 13:21:13
On Mon, 17 Apr 2000, Simon Burge wrote:

> I've put an unpolished, mostly undocumented implementation of
> sysctl(KERN_PROC2) on
> 
> 	ftp://ftp.NetBSD.ORG/pub/NetBSD/misc/simonbsysctl-kproc2.diff

You're missing a slash in there.

> 
> Any comments, suggestions, criticisms or flames on the work so far would
> be much appreciated.

I looked at it.  Apparently a struct kinfo_proc2 gets filled in by
fill_kproc2() which is called from sysctl_doeproc() which copies it
out and is called from sys___sysctl().   kinfo_proc2 seems to have lots of
pointer fields that need to be changed when translating from LP64 to
ILP32.

You should either get rid of all these pointers and convert them to a
u_int64_t so the structure does not change, or provide some mechanism to
repack te structure before the copyout() so this entire mess does not need
to be reimplemented inside COMPAT_NETBSD32 code.

Eduardo Horvath