Sign in to follow this  

hardware info header

This topic is 4306 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
ta guys, i was hoping that someone had already written something similar ( which no doubt has occured >30,000x in the past )
i want it, so i can see what ppls hardware + distributions are if they have problems running my game, to aid in the debugging.

Share this post


Link to post
Share on other sites
Sign in to follow this