Hello,
I'm trying to read "hw.ncpu" from a kernel module, but I can't find the header to use the sysctlbyname(3) function.
With:
I get:
How can I read this value?
Thank you,
Best Regards.
I'm trying to read "hw.ncpu" from a kernel module, but I can't find the header to use the sysctlbyname(3) function.
With:
C:
#include <sys/types.h>
#include <sys/sysctl.h>
/* ... */
int ncpu, result;
size_t len;
len = sizeof(ncpu);
result = sysctlbyname("hw.ncpu", &ncpu, &len , 0, 0);
I get:
Code:
error: implicit declar
result = sysctlbyname("hw.ncpu", &ncpu, &len , 0, 0);
^
1 error generated.
*** Error code 1
Stop.
How can I read this value?
Thank you,
Best Regards.