diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2020-05-04 18:36:31 +0200 |
|---|---|---|
| committer | Tobias Klauser <tobias.klauser@gmail.com> | 2020-08-17 09:12:50 +0000 |
| commit | d79350bac73670c04a91b6761d334b810201f6ee (patch) | |
| tree | fa5aa16a8f0f487d76b38fc06cfca6e5511a5bf8 /src/runtime/string.go | |
| parent | 9138a2a67f7f29948f6f608bf904b3605f1b45d0 (diff) | |
| download | go-d79350bac73670c04a91b6761d334b810201f6ee.tar.xz | |
runtime: use hw.ncpuonline sysctl in getncpu on netbsd
Since NetBSD 7, hw.ncpuonline reports the number of CPUs online, while
hw.cpu reports the number of CPUs configured. Try hw.cpuonline first and
fall back to hw.ncpu in case it fails (which is the case on NetBSD
before 7.0).
This follows the behavior on OpenBSD (see CL 161757). Also, Go
in pkgsrc is patched to use hw.cpuonline, so this CL would allow said
patch to be dropped.
Updates #30824
Change-Id: Id1c19dff2c1e4401e6074179fae7c708ba0e3098
Reviewed-on: https://go-review.googlesource.com/c/go/+/231957
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Diffstat (limited to 'src/runtime/string.go')
0 files changed, 0 insertions, 0 deletions
