-
Zhengyu He authored
The current code can potentially return a smaller processor count on a linux kernel when its cpumask_size (controlled by both kernel config and boot parameter) is not a multiple of the pointer size, because r/sys.PtrSize will be rounded down. Since sched_getaffinity returns the size in bytes, we can just allocate the buf as a byte array to avoid the extra calculation with the pointer size and roundups. Change-Id: I0c21046012b88d8a56b5dd3dde1d158d94f8eea9 Reviewed-on: https://go-review.googlesource.com/75591 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
eaf60360