You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
482 B
16 lines
482 B
https://go-review.googlesource.com/#/c/34794/
|
|
|
|
diff --git a/src/runtime/os_linux.go b/src/runtime/os_linux.go
|
|
index 542f214..9151aff 100644
|
|
--- a/src/runtime/os_linux.go
|
|
+++ b/src/runtime/os_linux.go
|
|
@@ -91,6 +91,9 @@ func getproccount() int32 {
|
|
const maxCPUs = 64 * 1024
|
|
var buf [maxCPUs / (sys.PtrSize * 8)]uintptr
|
|
r := sched_getaffinity(0, unsafe.Sizeof(buf), &buf[0])
|
|
+ if r <= 0 {
|
|
+ return 1
|
|
+ }
|
|
n := int32(0)
|
|
for _, v := range buf[:r/sys.PtrSize] {
|
|
for v != 0 {
|
|
|