Skip to content

Commit 37daabb

Browse files
MatthieuSarterianlancetaylor
authored andcommitted
runtime: support for AIX's procfs tree
On AIX, the process executable file is available under /proc/<pid>/object/a.out Issue golang/go#19200 Change-Id: I26b6748c3f600cbcaa97ffa13d798e393fca780b Reviewed-on: https://go-review.googlesource.com/37842 Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent ff62647 commit 37daabb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libgo/go/os/executable_procfs.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package os
99
import (
1010
"errors"
1111
"runtime"
12+
"syscall"
1213
)
1314

1415
// We query the executable path at init time to avoid the problem of
@@ -27,6 +28,8 @@ var executablePath, executablePathErr = func() (string, error) {
2728
procfn = "/proc/curproc/file"
2829
case "dragonfly":
2930
procfn = "/proc/curproc/file"
31+
case "aix":
32+
procfn = "/proc/" + itoa(syscall.Getpid()) + "/object/a.out"
3033
}
3134
return Readlink(procfn)
3235
}()

0 commit comments

Comments
 (0)