2021-08-23 09:14:53 -04:00
|
|
|
//go:build darwin
|
2016-08-01 08:03:50 -04:00
|
|
|
// +build darwin
|
|
|
|
|
2018-02-05 16:05:59 -05:00
|
|
|
package pidfile // import "github.com/docker/docker/pkg/pidfile"
|
2016-08-01 08:03:50 -04:00
|
|
|
|
|
|
|
import (
|
2017-05-23 10:22:32 -04:00
|
|
|
"golang.org/x/sys/unix"
|
2016-08-01 08:03:50 -04: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 10:22:32 -04:00
|
|
|
err := unix.Kill(pid, 0)
|
2016-12-13 15:10:11 -05:00
|
|
|
return err == nil
|
2016-08-01 08:03:50 -04:00
|
|
|
}
|