1 // Copyright 2016 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.
9 var executablePath string // set by sysauxv in ../runtime/os3_solaris.go
11 var initCwd, initCwdErr = Getwd()
13 func executable() (string, error) {
14 path := executablePath
16 path, err := syscall.Getexecname()
21 if len(path) > 0 && path[0] != '/' {
22 if initCwdErr != nil {
23 return path, initCwdErr
25 if len(path) > 2 && path[0:2] == "./" {
29 return initCwd + "/" + path, nil