pidfile_unix.go 318 B

1234567891011121314151617
  1. //go:build !windows && !darwin
  2. // +build !windows,!darwin
  3. package pidfile // import "github.com/docker/docker/pkg/pidfile"
  4. import (
  5. "os"
  6. "path/filepath"
  7. "strconv"
  8. )
  9. func processExists(pid int) bool {
  10. if _, err := os.Stat(filepath.Join("/proc", strconv.Itoa(pid))); err == nil {
  11. return true
  12. }
  13. return false
  14. }