Merge nux: process util
This commit is contained in:
@@ -1,13 +1,3 @@
|
||||
// Package util provides utility functions for Gas Town.
|
||||
// This file was created as part of an E2E polecat workflow test.
|
||||
package util
|
||||
|
||||
import "os"
|
||||
|
||||
// ProcessExists checks if a process with the given PID exists.
|
||||
// It uses the Unix convention of sending signal 0 to test for process existence.
|
||||
func ProcessExists(pid int) bool {
|
||||
proc, err := os.FindProcess(pid)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return proc.Signal(nil) == nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user