Make use of sysconf(3) _SC_NPROCESSORS_ONLN and _SC_NPROCESSORS_CONF
Make use of _SC_NPROCESSORS_ONLN if it exists and fallback to _SC_NPROCESSORS_CONF for really old operating systems. This adds support for retrieving the number of CPUs on a few OS's such as NetBSD, DragonFly and a few others.
Edited by Brad Smith