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 5package runtime 6 7import _ "unsafe" 8 9var executablePath string 10 11//extern getexecname 12func getexecname() *byte 13 14//extern getpagesize 15func getPageSize() int32 16 17//extern sysconf 18func sysconf(int32) _C_long 19 20func osinit() { 21 ncpu = getncpu() 22 if physPageSize == 0 { 23 physPageSize = uintptr(getPageSize()) 24 } 25} 26 27func 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. 35func solarisExecutablePath() string { 36 return executablePath 37} 38