mirror of
https://github.com/rwinkhart/rcw.git
synced 2026-08-28 12:56:31 -04:00
15 lines
257 B
Go
15 lines
257 B
Go
//go:build linux || freebsd
|
|
|
|
package daemon
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
// pidToPath returns the path of the executable that has the given PID.
|
|
func pidToPath(pid int) string {
|
|
path, _ := os.Readlink(fmt.Sprintf("/proc/%d/"+pidPathFile, pid))
|
|
return path
|
|
}
|