![]() |
|
|||||||
| FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|||
|
Hi!
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? Thanks! EDIT: 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 10:45 AM. |
|
||||
|
See sysctl(3).
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
|||
|
Thanks, Carpetsmoker, but I've found it after a short time after I posted to the forum - that's why I've edited my post above
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to learn to program under BSD? | Sunnz | Programming | 5 | 24th December 2008 10:45 PM |
| Learning how to program | Solaris_Delta | Programming | 9 | 24th December 2008 06:58 PM |
| run linux's program | johnzlly | OpenBSD General | 38 | 8th November 2008 11:10 AM |
| sysctl and cpu information and temperature | neurosis | FreeBSD General | 11 | 22nd October 2008 09:16 PM |
| Problem with lid switch Inspiron 1300 sysctl: unknown oid 'hw.acpi.video.lcd0.active' | pax | FreeBSD General | 2 | 6th August 2008 11:49 AM |