go/src/runtime/defs_illumos_amd64.go
Joshua M. Clulow 91f3997ec0 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>
2019-10-28 18:06:12 +00:00

15 lines
285 B
Go

// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package runtime
const (
_RCTL_LOCAL_DENY = 0x2
_RCTL_LOCAL_MAXIMAL = 0x80000000
_RCTL_FIRST = 0x0
_RCTL_NEXT = 0x1
)