Files
QSfera/vendor/github.com/gookit/goutil/sysutil/process/process_darwin.go
T
2023-04-19 20:24:34 +02:00

17 lines
304 B
Go

//go:build darwin
// +build darwin
package process
import (
"golang.org/x/sys/unix"
)
// Exists check process running by given pid
func Exists(pid int) bool {
// OS X does not have a proc filesystem.
// Use kill -0 pid to judge if the process exists.
err := unix.Kill(pid, 0)
return err == nil
}