Source file src/runtime/os_only_solaris.go
Documentation: runtime
1 // Copyright 2019 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Solaris code that doesn't also apply to illumos. 6 7 //go:build !illumos 8 // +build !illumos 9 10 package runtime 11 12 func getncpu() int32 { 13 n := int32(sysconf(__SC_NPROCESSORS_ONLN)) 14 if n < 1 { 15 return 1 16 } 17 18 return n 19 } 20