commit | 1d64b76f559c0969ee2a6eb8e0ac9d268713880c | [log] [tgz] |
---|---|---|
author | Ian Lance Taylor <iant@golang.org> | Wed Jan 22 11:06:03 2020 -0800 |
committer | Ian Lance Taylor <iant@golang.org> | Wed Jan 22 23:07:39 2020 +0000 |
tree | 11c083b1fc7715763e5b3a4f3bef9b2a454b8fb3 | |
parent | 9ae2223f91c4ca642885b80d88eb0baf756acf94 [diff] |
runtime: for Solaris, add osinit, and drop duplicate getncpu Fixes a build breakage introduced in the 1.14beta1 upgrade. Change-Id: I6e416645ca78d35a58a8abdd178ab5f72af3b3d6 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/215857 Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/libgo/go/runtime/os3_solaris.go b/libgo/go/runtime/os3_solaris.go index 001feed..b2fa1d3 100644 --- a/libgo/go/runtime/os3_solaris.go +++ b/libgo/go/runtime/os3_solaris.go
@@ -17,12 +17,11 @@ //extern sysconf func sysconf(int32) _C_long -func getncpu() int32 { - n := int32(sysconf(__SC_NPROCESSORS_ONLN)) - if n < 1 { - return 1 +func osinit() { + ncpu = getncpu() + if physPageSize == 0 { + physPageSize = uintptr(getPageSize()) } - return n } func sysargs(argc int32, argv **byte) {