aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime/os3_solaris.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/runtime/os3_solaris.go')
-rw-r--r--libgo/go/runtime/os3_solaris.go21
1 files changed, 19 insertions, 2 deletions
diff --git a/libgo/go/runtime/os3_solaris.go b/libgo/go/runtime/os3_solaris.go
index e67d32c..d5fbccd 100644
--- a/libgo/go/runtime/os3_solaris.go
+++ b/libgo/go/runtime/os3_solaris.go
@@ -12,10 +12,27 @@ var executablePath string
func getexecname() *byte
//extern getpagesize
-func getpagesize() int32
+func getPageSize() int32
+
+//extern sysconf
+func sysconf(int32) _C_long
+
+func getncpu() int32 {
+ n := int32(sysconf(__SC_NPROCESSORS_ONLN))
+ if n < 1 {
+ return 1
+ }
+ return n
+}
+
+func osinit() {
+ ncpu = getncpu()
+ if physPageSize == 0 {
+ physPageSize = uintptr(getPageSize())
+ }
+}
func sysargs(argc int32, argv **byte) {
- physPageSize = uintptr(getpagesize())
executablePath = gostringnocopy(getexecname())
}