aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/os3_solaris.go
diff options
context:
space:
mode:
authorJoshua M. Clulow <josh@sysmgr.org>2019-10-28 09:19:48 -0700
committerBrad Fitzpatrick <bradfitz@golang.org>2019-10-28 18:06:12 +0000
commit91f3997ec09d6502f88471f384aad2fe3ddcecb9 (patch)
tree10987550fafd88ec19be7c7944217f2844b423b2 /src/runtime/os3_solaris.go
parent503bccb5d91998e22e32c6f771262ed33b72ff8b (diff)
downloadgo-91f3997ec09d6502f88471f384aad2fe3ddcecb9.tar.gz
go-91f3997ec09d6502f88471f384aad2fe3ddcecb9.zip
runtime: make NumCPU respect zone CPU cap on illumos
On illumos systems, check for the "zone.cpu-cap" resource control when determining how many usable CPUs are available. If the resource control is not set, or we are unable to read it, ignore the failure and return the value we used to return; i.e., the CPU count from sysconf(_SC_NPROCESSORS_ONLN). Fixes golang/go#35199 Change-Id: Ic8a408f84cd140d544d128f1281baad527fb5e35 Reviewed-on: https://go-review.googlesource.com/c/go/+/203758 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/os3_solaris.go')
-rw-r--r--src/runtime/os3_solaris.go8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/runtime/os3_solaris.go b/src/runtime/os3_solaris.go
index 563e981d0f..373c682f05 100644
--- a/src/runtime/os3_solaris.go
+++ b/src/runtime/os3_solaris.go
@@ -119,14 +119,6 @@ var (
var sigset_all = sigset{[4]uint32{^uint32(0), ^uint32(0), ^uint32(0), ^uint32(0)}}
-func getncpu() int32 {
- n := int32(sysconf(__SC_NPROCESSORS_ONLN))
- if n < 1 {
- return 1
- }
- return n
-}
-
func getPageSize() uintptr {
n := int32(sysconf(__SC_PAGESIZE))
if n <= 0 {