github.com/robryk/drone@v0.2.1-0.20140602202253-40fe4305815d/Godeps/_workspace/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  }