libgo: export NetBSD-specific types in mksysinfo.sh
[gcc.git] / libgo / go / runtime / os3_solaris.go
1 // Copyright 2011 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 package runtime
6
7 import _ "unsafe"
8
9 var executablePath string
10
11 //extern getexecname
12 func getexecname() *byte
13
14 //extern getpagesize
15 func getPageSize() int32
16
17 //extern sysconf
18 func sysconf(int32) _C_long
19
20 func osinit() {
21 ncpu = getncpu()
22 if physPageSize == 0 {
23 physPageSize = uintptr(getPageSize())
24 }
25 }
26
27 func sysargs(argc int32, argv **byte) {
28 executablePath = gostringnocopy(getexecname())
29 }
30
31 //go:linkname solarisExecutablePath os.solarisExecutablePath
32
33 // solarisExecutablePath is called from the os package to fetch the
34 // saved executable path.
35 func solarisExecutablePath() string {
36 return executablePath
37 }