Results 1 to 2 of 2
I need to take system information like CPU speed,cache size,free and available physical and virtual memory etc in effective way. I tried to get it by reading the file /proc/cpuinfo ...
- 01-04-2010 #1Just Joined!
- Join Date
- Jul 2007
- Posts
- 2
Taking System Informaion using C
I need to take system information like CPU speed,cache size,free and available physical and virtual memory etc in effective way. I tried to get it by reading the file /proc/cpuinfo and /proc/meminfo by using fread() and some string.h functions. But are there any functions or libraries or system calls exists in order to take these values directly and efficiently.PLEASE HELP ME......
- 01-04-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
You can get memory information with the sysinfo() call. See /usr/include/sys/sysinfo.h and the sysinfo man page. For cpu information the best way I know to get it is to read /proc/cpuinfo.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote