MCPcopy Create free account
hub / github.com/JordanCoin/codemap / processCommandLine

Function processCommandLine

watch/process_unix.go:13–19  ·  view source on GitHub ↗
(pid int)

Source from the content-addressed store, hash-verified

11)
12
13func processCommandLine(pid int) (string, error) {
14 out, err := exec.Command("ps", "-p", strconv.Itoa(pid), "-o", "command=").Output()
15 if err != nil {
16 return "", err
17 }
18 return strings.TrimSpace(string(out)), nil
19}
20
21// processAlive reports whether a process with the given PID is currently
22// running. FindProcess always succeeds on Unix, so liveness is probed with

Calls

no outgoing calls