Subject: Re: Easier vendor specific sysctl
To: Pavel Cahyna <pcah8322@artax.karlin.mff.cuni.cz>
From: Andrew Brown <atatat@atatdot.net>
List: tech-kern
Date: 11/28/2003 09:07:06
>> >>     sysctl -w //create=vender.foo,type=int,symbol=thing,flags=w 
>> >
>> >Please, what is the "symbol" field referring to?
>> 
>> the name of the thing being referenced.  for example, i have the
>
>I hope such nodes won't be created by default, because I suppose that it
>is dangerous to write to kernel variables directly from userland. But if
>you create them manually and know what you are doing, that's fine.

that is indeed the idea.  here i have rope and i am choosing the
manner in which i will shoot myself in the foot.  that was some of the
stuff from my sysctl.conf file; those are not sysctl variables that
are created by default (except on my machine).

>Second question - will it be possible to create a sysctl that does not
>correspond to a kernel variable, but rather the storage for it is
>allocated on-demand? That way, it could be possible to even have a
>Win32-like Registry :-).

yes.

	//create=foo,type=struct,size=48
	//create=foo,type=string,size=128
	//create=foo,type=int
	//create=foo,type=quad,flags=o

for the latter two, you may assert "flags=o" (ie, sysctl should "own"
the data) or not, but if you do not, then the value is stored in the
sysctl node itself.  that may not matter much, unless the value is
something you do not wish regular users to see.  for the former two,
sysctl has no choice but to own the data, since they will not fit into
the sysctl node.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
werdna@squooshy.com       * "information is power -- share the wealth."