(pid int)
| 70 | } |
| 71 | |
| 72 | func 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 | |
| 84 | func SendSignalByName(pid int, sigName string) error { |
| 85 | sig := ParseSignal(sigName) |
no test coverage detected