Subject: Re: dynamic sysctl
To: David Laight <david@l8s.co.uk>
From: Andrew Brown <atatat@atatdot.net>
List: tech-kern
Date: 11/17/2003 16:08:57
>> >Why not just make:
>> >	sysctl((void *)"kern.maxproc", 0, &buf, sizeof buf, NULL, 0);
>> >return the value of kern.maxproc (etc).
>> 
>> sounds nice, but how does that communicate the type of the returned
>> data to the caller?  or maybe buf could then consist of a type number,
>> followed by a length number, followed by the actual data...
>
>Well, in most cases (ie everything except the sysctl program) the
>caller knows what he expects. For sysctl maybe "kern.?" could return
>the types of the subfields
>- better have 'kern.*' return "name:type.name:type"

and...in most cases (ie, everything except the sysctl program) the
caller knows where the thing is that he's looking for, and does not
have to do auto-discovery.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
werdna@squooshy.com       * "information is power -- share the wealth."