Find the answer to your Linux question:
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 ...
  1. #1
    Just 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......

  2. #2
    Linux Guru Rubberman's Avatar
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...