Certainly works on Linux 2.2+, Solaris 8+, Windows 2k, and Windows XP. Probably should work on AIX, Cray, HP-UX, Tru64 Unix, and the rest...
Public Domain. However, if you find it useful, please consider forking out for something on my amazon wishlist
$ cc -o numcpus numcpus.c
$ mv numcpus /wherever/bin/numcpus
If you have a half-decent make implementation you can probably just run:
$ make numcpus
This technique certainly works with GNU make.
Just run it and it will print out as much info as it can get on the processor configuration. This varies a lot from platform to platform.
If you know of a way to detect this information on a platform this code does not work on, or you know how to get extended info on a particular platform, please drop me an email. My address firstname.lastname@example.org.
Name Last modified Size DescriptionApache Server at csgsoft.doc.ic.ac.uk Port 80
Parent Directory - numcpus.c 2003-01-29 19:40 2.5K README.html 2003-06-16 21:02 1.1K