mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-12-01 12:26:25 +01:00
21 lines
365 B
Go
21 lines
365 B
Go
//go:build !windows
|
|
|
|
package processguard
|
|
|
|
import "syscall"
|
|
|
|
// ProcessGroupExists reports whether the group can still have running members.
|
|
func ProcessGroupExists(pgid int) bool {
|
|
if pgid <= 0 {
|
|
return false
|
|
}
|
|
switch syscall.Kill(-pgid, 0) {
|
|
case syscall.ESRCH:
|
|
return false
|
|
case nil:
|
|
return !processGroupOnlyZombies(pgid)
|
|
default:
|
|
return true
|
|
}
|
|
}
|