You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ntool/nsys/sysutil_nonwin.go

18 lines
288 B
Go

//go:build !windows
package nsys
import (
"syscall"
)
// Kill a process by pid
func Kill(pid int, signal syscall.Signal) error {
return syscall.Kill(pid, signal)
}
// ProcessExists check process exists by pid
func ProcessExists(pid int) bool {
return nil == syscall.Kill(pid, 0)
}