mirror of
https://github.com/jahruz67/wisp-open.git
synced 2026-08-08 18:14:08 +00:00
12 lines
287 B
Go
12 lines
287 B
Go
//go:build linux
|
|
package linux
|
|
|
|
import "syscall"
|
|
|
|
// IsProcessRunning checks if a process with the given PID exists on Linux.
|
|
func IsProcessRunning(pid int) bool {
|
|
// sending signal 0 checks if the process exists and we have permission
|
|
err := syscall.Kill(pid, 0)
|
|
return err == nil
|
|
}
|