Get sysctl value from a C program
I was wondering how could I get/set a sysctl value from a C program. For example I want to get the value of 'sysctl kern.osrelease' or something else.. For setting env variables I could use setenv() or getenv(), but can I get the value of a sysctl string from a C program and how?
I've found it, I must have missed the sysctl() prototype in sys/sysctl.h. After reading the sysctl(3) man page gave me the needed results
Last edited by DNAeon; 29th September 2008 at 11:45 AM.
|Thread||Thread Starter||Forum||Replies||Last Post|
|How to learn to program under BSD?||Sunnz||Programming||5||24th December 2008 11:45 PM|
|Learning how to program||Solaris_Delta||Programming||9||24th December 2008 07:58 PM|
|run linux's program||johnzlly||OpenBSD General||38||8th November 2008 12:10 PM|
|sysctl and cpu information and temperature||neurosis||FreeBSD General||11||22nd October 2008 10:16 PM|
|Problem with lid switch Inspiron 1300 sysctl: unknown oid 'hw.acpi.video.lcd0.active'||pax||FreeBSD General||2||6th August 2008 12:49 PM|