Files
run/runtime/process_alive_default.go
2026-08-26 09:56:43 +08:00

20 lines
260 B
Go

//go:build !windows
package runtime
import (
"os"
"syscall"
)
func processAlivePID(pid int) bool {
if pid <= 0 {
return false
}
process, err := os.FindProcess(pid)
if err != nil {
return false
}
return process.Signal(syscall.Signal(0)) == nil
}