2021-08-23 13:14:53 +00:00
|
|
|
//go:build darwin
|
2016-08-01 12:03:50 +00:00
|
|
|
// +build darwin
|
|
|
|
|
2018-02-05 21:05:59 +00:00
|
|
|
package pidfile // import "github.com/docker/docker/pkg/pidfile"
|
2016-08-01 12:03:50 +00:00
|
|
|
|
|
|
|
import (
|
2017-05-23 14:22:32 +00:00
|
|
|
"golang.org/x/sys/unix"
|
2016-08-01 12:03:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func processExists(pid int) bool {
|
|
|
|
// OS X does not have a proc filesystem.
|
|
|
|
// Use kill -0 pid to judge if the process exists.
|
2017-05-23 14:22:32 +00:00
|
|
|
err := unix.Kill(pid, 0)
|
2016-12-13 20:10:11 +00:00
|
|
|
return err == nil
|
2016-08-01 12:03:50 +00:00
|
|
|
}
|