Find the answer to your Linux question:
Results 1 to 2 of 2
I need to gather CPU and network interface stats from a C program. Is there a more portable way to get the CPU model name than reading the "/proc/cpuinfo" file? ...
  1. #1
    Just Joined!
    Join Date
    Nov 2008
    Posts
    2

    Getting CPU Information from C program

    I need to gather CPU and network interface stats from a C program. Is there a more portable way to get the CPU model name than reading the "/proc/cpuinfo" file? How would I get this information from a non-Linux OS or from Windows using C?

    Also, is there a system call I can make from C to get the number of packets received and sent from eth0 without having to read the "/proc/net/devs" file?

    Thanks in advance,
    BT

  2. #2
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    Quote Originally Posted by brucet4ace View Post
    Is there a more portable way?
    BT
    Depends what you mean by "more"...if your just talking about intel and AMD archectures you could try cpuid for the cpu info...Gerard4143

    Welcome to the forums

Posting Permissions

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