2017-07-25 Tamar Christina <tamar.christina@arm.com>
[official-gcc.git] / libgo / go / os / executable_plan9.go
bloba5947eaae1ed66ee9bc3a8706a81fc998377bded
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.
5 // +build plan9
7 package os
9 import "syscall"
11 func executable() (string, error) {
12 fn := "/proc/" + itoa(Getpid()) + "/text"
13 f, err := Open(fn)
14 if err != nil {
15 return "", err
17 defer f.Close()
18 return syscall.Fd2path(int(f.Fd()))