You'll need to use some logic to separate Linux, OSX, and Windows systems. That's not hard to do. Each OS will tell your program if it's the operating system.
Originally Posted by Once-ler2
I'm going to skip over that for the time being, and show one simple way to get the info you want, on a Windows OS. Just a caution: this may not be the easiest way to do this, and may not work with other versions of Windows before Windows 7.
[Which I googled from http://superuser.com/questions/22655...-on-windows-7]
system("WMIC CPU Get /Format:List >sysInfo.txt");
Will put this info, into a file named sysInfo.txt. Now just open that file, and read in each line of text with fgets(), until you reach "Number of logical Processors: "
And that is the number of processes your system can run simultaneously. i.e. an i7 may have 4 cores, but 8 logical processors.
Example of file:
Caption=Intel64 Family 6 Model 26 Stepping 4
Description=Intel64 Family 6 Model 26 Stepping 4
Name=Intel(R) Core(TM) i7 CPU 940 @ 2.93GHz