mirror of
https://github.com/golang/go.git
synced 2025-05-30 19:52:53 +00:00
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>
15 lines
285 B
Go
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
|
|
)
|