PDA

View Full Version : sysctlbyname


uslanmaz
November 25th, 2009, 07:49
Hi everyone, I have a problem with getting the memory size. when I use the folloeing:
int a=sysctlbyname("hw.physmem", &physmem, &len, NULL, 0);

I get an error saying implicit declaration of function sysctlbyname

(I include sysctl.h) is there any way to get rid of this or any other way to get the memory info in the kernel source code?

Thanks in advance.

Ole
November 25th, 2009, 09:36
sys/types.h needed too.

Also you can look this (http://forums.freebsd.org/showthread.php?t=1102&highlight=sysctlbyname)

uslanmaz
November 25th, 2009, 20:32
I include sys/types.h too, but still I have the error

lyuts
December 1st, 2009, 10:28
Can you show this code?

expl
December 1st, 2009, 16:03
Are you trying to include this code into kernel? It will not work, its part of libc(userland).