isProcessRunning checks if a process is still running
(pid int)
| 172 | |
| 173 | // isProcessRunning checks if a process is still running |
| 174 | func isProcessRunning(pid int) bool { |
| 175 | proc, err := os.FindProcess(pid) |
| 176 | if err != nil { |
| 177 | return false |
| 178 | } |
| 179 | |
| 180 | // Try to signal the process - if it fails, it's likely dead |
| 181 | err = proc.Signal(syscall.Signal(0)) |
| 182 | return err == nil |
| 183 | } |
| 184 | |
| 185 | // isProcessZombie checks if a process is a zombie on Windows |
| 186 | // On Windows, we check if the process exists but parent doesn't exist or is invalid |
no outgoing calls
no test coverage detected