Unix Technical Forum

How to add sysctl variable.

This is a discussion on How to add sysctl variable. within the comp.unix.bsd.openbsd.misc forums, part of the OpenBSD category; --> Hi, how can i add a sysctl variable under kern parent? I modified sysctl.h to include my variable: #define ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > comp.unix.bsd.openbsd.misc

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-16-2008, 08:07 AM
Newbie
 
Posts: n/a
Default How to add sysctl variable.

Hi, how can i add a sysctl variable under kern parent?

I modified sysctl.h to include my variable:

#define KERN_MYVAR 71

and change KERN_MAX.

I add { "myvar", CTLTYPE_STRING }, \

and i modified kern_sysctl.c with

CASE KERN_MYVAR:
return(sysctl_int etc.

I add int myvar=0 into kern_sysctl.c

I use some examples read into c source file, because i
have not been able to find some url or doc on Internet
where adding of sysctl variable is explained.

But when i recompile and reboot, this new variable doesn't
exists. Where's mistake?

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-16-2008, 08:08 AM
tedu
 
Posts: n/a
Default Re: How to add sysctl variable.

Newbie wrote:
> Hi, how can i add a sysctl variable under kern parent?
> I use some examples read into c source file, because i
> have not been able to find some url or doc on Internet
> where adding of sysctl variable is explained.
>
> But when i recompile and reboot, this new variable doesn't
> exists. Where's mistake?


you have to change the userland sysctl program as well unless you have
written your own.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:27 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com