Results 1 to 4 of 4
Hello,
I'm looking for a function in c to get the processor type and number of processors of the machine in c / c++.
I know I can read it ...
- 10-06-2008 #1Just Joined!
- Join Date
- May 2008
- Location
- Barcelona
- Posts
- 5
Get processor type in c/c++
Hello,
I'm looking for a function in c to get the processor type and number of processors of the machine in c / c++.
I know I can read it from /proc/cpuinfo, but it would be great if there was a function that just do it like GetSystemInfo() in windows systems.
thanks,
Rafa
- 10-06-2008 #2
Don't forget that you also have arch and uname depending on the info you need. Can't think of much else right now...
Registered Linux User: #479567
Asking a question? Read this page first.
Now... sudo make me a sandwich.
ratiocinativeroot.blogspot.com
- 10-06-2008 #3Just Joined!
- Join Date
- May 2008
- Location
- Barcelona
- Posts
- 5
Well... thanks Daniel, but I'm looking for a c/c++ function, not a system command.
Thanks anyway...
- 10-06-2008 #4
You could try an assembler routine that calls cpuid....
If you google linux cpuid this you'll see plenty of examples on how to integrate it into c/c++


Reply With Quote