Subject: Re: sysctl - struct or separate mibs?
To: Simon Burge <>
From: Matt Thomas <>
List: tech-kern
Date: 06/16/2000 09:46:04
At 11:15 PM 6/16/2000 +1000, Simon Burge wrote:

>Also, there would probably have to be a way to return multiple MIB
>entries with one call - image the overhead for ps (for example) if each
>field for each process had to be retrieved with individual syscalls
>(that's 11 x 137 just for the data retrieval plus a few to get numbers
>on my home box right now, vs 2 + 137 with the current sysctl method
>(including one each for each argv string)).

An alternative it to add a SYSCTL_xxx_ALL_CHILDREN which would return all
the data for the next level down in a described format.

struct {
         int mib_tag;
         int mib_flags;          /* length, padding, type, RW/RO, 
         union {
                 int32_t v_int32;
                 int64_t v_int64;
                 char v_string[1];

or something like that.
Matt Thomas               Internet:
3am Software Foundry      WWW URL:
Cupertino, CA             Disclaimer: I avow all knowledge of this message