Subject: Re: dynamic sysctl
To: David Laight <email@example.com>
From: Andrew Brown <firstname.lastname@example.org>
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" >-----|
email@example.com * "ah! i see you have the internet
firstname.lastname@example.org (Andrew Brown) that goes *ping*!"
email@example.com * "information is power -- share the wealth."