github.com/sym3tri/etcd@v0.2.1-0.20140422215517-a563d82f95d6/third_party/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 }