aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/numcpu_freebsd_test.go
AgeCommit message (Collapse)Author
2017-03-10runtime: use cpuset_getaffinity for runtime.NumCPU() on FreeBSDDavid NewHamlet
In FreeBSD when run Go proc under a given sub-list of processors(e.g. 'cpuset -l 0 ./a.out' in multi-core system), runtime.NumCPU() still return all physical CPUs from sysctl hw.ncpu instead of account from sub-list. Fix by use syscall cpuset_getaffinity to account the number of sub-list. Fixes #15206 Change-Id: If87c4b620e870486efa100685db5debbf1210a5b Reviewed-on: https://go-review.googlesource.com/29341 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>