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).
This commit is contained in:
Antoine Jacoutot 2019-01-02 17:10:02 +01:00
parent 7276e963eb
commit 67297c8791
1 changed files with 1 additions and 1 deletions

View File

@ -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)