standard for checking to see how many cpus are on a host?
Posted 01 September 2009 - 09:46 PM
I know openbsd has hw.ncpu in the sys variables. On linux is there a better way then to look at /proc/cpuinfo? Is there any standard way to do this on unixes?
Posted 01 September 2009 - 09:53 PM
If you really want to though, all you need to do is put all the methods together in a C file (or whatever language you're using) and protect them all with #ifdef preprocessor statements. That way, the right one will magically appear in your source code when you compile it on each platform.
BinRev is hosted by the great people at Lunarpages!