Subject: Re: dynamic sysctl
To: None <firstname.lastname@example.org>
From: David Laight <email@example.com>
Date: 11/17/2003 07:38:44
> >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"
David Laight: firstname.lastname@example.org