github.com/polvi/nsproxy@v0.0.0-20140119202807-96ac732fa7f3/third_party/src/bitbucket.org/kardianos/osext/osext_plan9.go (about)

     1  // Copyright 2012 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 osext
     6  
     7  import "syscall"
     8  
     9  func executable() (string, error) {
    10  	f, err := Open("/proc/" + itoa(Getpid()) + "/text")
    11  	if err != nil {
    12  		return "", err
    13  	}
    14  	defer f.Close()
    15  	return syscall.Fd2path(int(f.Fd()))
    16  }