MCPcopy
hub / github.com/wavetermdev/waveterm / IsPidRunning

Function IsPidRunning

pkg/util/unixutil/unixutil_unix.go:72–82  ·  view source on GitHub ↗
(pid int)

Source from the content-addressed store, hash-verified

70}
71
72func IsPidRunning(pid int) bool {
73 if pid <= 0 {
74 return false
75 }
76 err := syscall.Kill(pid, 0)
77 // EPERM means no permission, but it exists (ESRCH is not found)
78 if err == nil || err == syscall.EPERM {
79 return true
80 }
81 return false
82}
83
84func SendSignalByName(pid int, sigName string) error {
85 sig := ParseSignal(sigName)

Callers 1

BadgeWatchPidCommandMethod · 0.92

Calls 1

KillMethod · 0.65

Tested by

no test coverage detected