Questions about CPU related sysctls

Craig Rodrigues rodrigc at
Wed Feb 25 13:46:16 PST 2004


I want to write some C code to get a count of the number of
CPU's on a running system.

What is the difference between these two sysctls?

kern.smp.cpus: Number of CPUs online
hw.ncpu: Number of active CPUs

Also, can someone give a brief description of these sysctls (sysctl -d
doesn't show anything for them).

Would it be a good idea to add some text to these syctls?


Craig Rodrigues
rodrigc at

More information about the freebsd-hackers mailing list