pidfile_darwin.go 267 B

123456789101112131415161718
  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. if err != nil {
  11. return false
  12. }
  13. return true
  14. }