pidfile_darwin.go 237 B

1234567891011121314
  1. // +build darwin
  2. package pidfile
  3. import (
  4. "syscall"
  5. )
  6. func processExists(pid int) bool {
  7. // OS X does not have a proc filesystem.
  8. // Use kill -0 pid to judge if the process exists.
  9. err := syscall.Kill(pid, 0)
  10. return err == nil
  11. }