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/15/2000 20:51:40
On Sat, Apr 15, 2000 at 08:35:56PM -0400, Aidan Cully wrote:
> Those 'len = ' assignments would be the only place the old structure
> definitions would be used in the kernel, and even though this
> probably isn't what the kernel routine would look like, I don't know
> how to get around something like that 'switch' block.
well, you'll need the switch again as soon as the version
chanages, but I think I agree with you now.
> interface, except for the actual structure changes. And if it's
> considered necessary to change the structure, I think we should try to
> make it easy to do so.
yep, passing a length parameter should obviate the need to keep track
of as many different structures.
> Anyway, it's taken three pages, but I've said my bit now... Duke it
> out with Simon. :-)
then, to Simon (or whoever else cares):
What about the make snapshot, return snapshot split. sysctl(KINFO_PROC2)
with a total length of zero would take a snapshot of the processes
at that point, save it until the next call with a non-zero total length,
and return the number of entries needed. Then the program doing the
sysctl could allocate exactly as much memory as needed and do another
call with a non-zero length to get the saved data back.
eric