cpu: prefer cpuonline on OpenBSD

This gives us the value of actual online CPUs (as opposed to the
found ones which may not be able active).
pull/624/head
Antoine Jacoutot 6 years ago
parent 7276e963eb
commit 67297c8791

@ -134,7 +134,7 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) {
}
c.Mhz = float64(u32)
if u32, err = unix.SysctlUint32("hw.ncpu"); err != nil {
if u32, err = unix.SysctlUint32("hw.ncpuonline"); err != nil {
return nil, err
}
c.Cores = int32(u32)

Loading…
Cancel
Save