github.com/vvnotw/moby@v1.13.1/pkg/pidfile/pidfile_darwin.go (about)

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