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