You need to use the file system interface: fopen
, fread
, etc (or open
, read
, if you prefer).
And about the C function called sysctl
, don't use it:
Use of this system call has long been discouraged, and it is so unloved that it is likely to disappear in a future kernel version. Since Linux 2.6.24, uses of this system call result in warnings in the kernel log. Remove it from your programs now; use the
/proc/sys
interface instead.