hardware info header
im looking for a simple c header that will find out various basic hardware info under unix eg memory / cpu type + speed.
perhaps also distribution version as well
ta zed
I am just finishing up a project for work that had to do this. Let me tell you, getting hardware and system information as a user space process is a pain in the butt. For most things there is no friendly API to get the information as is the case in Windows.
You will definitely want to look at /proc as one place to get information. Also get the source code for utilities that do something similar to what you want and see how they do it.
To get system memory you can use
sysinfo
Edit:
For cpu information you either have to use assembly to query thecpu directly or parse the information in /proc/cpuinfo
You will definitely want to look at /proc as one place to get information. Also get the source code for utilities that do something similar to what you want and see how they do it.
To get system memory you can use
sysinfo
Edit:
For cpu information you either have to use assembly to query thecpu directly or parse the information in /proc/cpuinfo
"Pfft, Facts! Facts can be used to prove anything!" -- Homer J. Simpson
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement