Subject: Re: Adding port-dependant things to sysctl
To: Bill Studenmund <wrstuden@loki.stanford.edu>
From: Chris G. Demetriou <cgd@cs.cmu.edu>
List: tech-kern
Date: 02/11/1997 00:58:44
> I'm wanting to add a mac68k-specific option to sysctl (a flag to let the
> superuser turn on or off the ability of a break on the serial console
> to drop us into the debugger).

So, last i heard, prevailing wisdom said that it was bad to add
machine-dependent sysctls to individual systems which share a common
${MACHINE_ARCH}.  It sounds like your variable is probably
machine-independent, but its use is not.

I don't know the right solution, but do want to keep you from going
down the wrong path...  8-)


> I've added it to the machine-dependant part of the kernel code, and
> it's in the header files. I can READ it without problem. I just can't
> seem to SET it. From looking at the sysctl code, each settable option
> must be explicitly defined in a case statement.
> 
> Is there some way we can change this? We export a whole tree of names and
> types. Can't sysctl just look at that, and let the kernel decide if the
> value's read-only or not?

So, the kernel doesn't export anything, in the dynamic sense.

All knowledge of the sysctl "MIB" is hard-coded into the sysctl
program and function call at compile time.

I, for one, think that the current implementation is ... rather
broken.  I've some ideas on how to fix it, but they change the sysctl
implementation dramatically.  If anybody would like to discuss them,
with an eye towards fleshing them out and actually implementing them,
get in touch with me privately.


cgd