Tweak OpenBSD cpu detection (#92)
Tweak OpenBSD cpu detection (#92)

In OpenBSD 6.4 a new sysctl was added to enable/disable SMT on the
fly (hw.smt). At the same time a new sysctl was added which reflects
the number of online CPUs/cores (hw.ncpuonline).

num_cpus was using the hw.ncpu sysctl value which includes the number
of offline cores when hw.smt=0. Adjust num_cpus to return the actual
number of usable cores with get() and implement get_num_physical_cpus()
which returns the total number of CPUs/cores in the system.

While here adjust the sysctl(2) call for hw.ncpu to check the return
value of the syscall rather than depending on 'cpus' (oldp).
seanmonstar/num_cpus