Subject: Re: Replacing the sysctl() interface.
To: Eduardo Horvath <>
From: Darren Reed <>
List: tech-kern
Date: 06/06/2000 17:27:16
In some email I received from Eduardo Horvath, sie wrote:
> On Mon, 5 Jun 100, Darren Reed wrote:
> > I'm musing over working on replacing the current sysctl with something
> > that's much more flexible and supports (at the very least) it being
> > dynamic in nature.
> > 
> > Some of changes I think are worthwhile making:
> Something that is lacking in the current sysctl setup is some way to
> determine the type of a sysctl variable so it can be converted if needed
> (for 32-bit emulation).

Currently, there is a sysctl function to deal with int's, quad's,
strings and struct's.  "int" is presumed to be 32bit, quad is...
potentially vague.  Should we even be using {u_,}quad_t (use int64_t
in its place) in the kernel ?

To me, it is a problem for the in-kernel sysctl code.  There, the code
knows the size of the userland object into which the value is being
stored, as well as the size of the object in the kernel to be copied back.
From that information, it should be relatively easy to determine if it
is a 64bit object into a 32bit container.