jit: Fix Darwin bootstrap after r15-1699.
[official-gcc.git] / libgo / go / os / executable_plan9.go
blob8d8c83260f59ca6601be1499cedd522fd76b8fea
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 //go:build plan9
7 package os
9 import (
10 "internal/itoa"
11 "syscall"
14 func executable() (string, error) {
15 fn := "/proc/" + itoa.Itoa(Getpid()) + "/text"
16 f, err := Open(fn)
17 if err != nil {
18 return "", err
20 defer f.Close()
21 return syscall.Fd2path(int(f.Fd()))