Source file src/runtime/os_only_solaris.go

     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  
     9  package runtime
    10  
    11  func getncpu() int32 {
    12  	n := int32(sysconf(__SC_NPROCESSORS_ONLN))
    13  	if n < 1 {
    14  		return 1
    15  	}
    16  
    17  	return n
    18  }
    19  

View as plain text