Hi.
Can someone guide me to the right direction?
I want to make an application that just extracts the cpu speed, and vendorname from the file /proc/cpuinfo.
My current distro is Ubuntu 8.10 desktop.
Regards
Hi.
Can someone guide me to the right direction?
I want to make an application that just extracts the cpu speed, and vendorname from the file /proc/cpuinfo.
My current distro is Ubuntu 8.10 desktop.
Regards
cat /proc/cpuinfo
Read the file to see how the information you want is stored.
Write a program to parse the file.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
And what exactly are you having problems with?
Somebody already did that:
egrep ("processor|cpu MHz|vendor_id") /proc/cpuinfo
I threw "processor" in since that is the processor number; if you have more than one this info prints out for each, eg:
Code:processor : 0 vendor_id : GenuineIntel cpu MHz : 2200.074 processor : 1 vendor_id : GenuineIntel cpu MHz : 2200.074
Last edited by MK27; 08-01-2009 at 05:33 PM.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
Yes, now we're getting somewhere .
I've got some ideas.
Thank you all!
N