How to access kernel variable in c program

Hello,

Can anyone help me and tell how to access a kernel variable from in a c source code?

For example, the command sysctl -A returns a list of variables and I need to access one of them in my c source file.

Thank you.
 
Logan89 said:
Is there any other way because sysctl() appears in FreeBSD 4.4 and I am looking for an older version

Can you be more specific when referring to older version? You can always check source code for 'sysctl' command on the FreeBSD version you are interested in, to see what routines it uses to get the values.
 
Back
Top