pidfile_darwin.go 315 B

123456789101112131415
  1. //go:build darwin
  2. // +build darwin
  3. package pidfile // import "github.com/docker/docker/pkg/pidfile"
  4. import (
  5. "golang.org/x/sys/unix"
  6. )
  7. func processExists(pid int) bool {
  8. // OS X does not have a proc filesystem.
  9. // Use kill -0 pid to judge if the process exists.
  10. err := unix.Kill(pid, 0)
  11. return err == nil
  12. }