gopkg.in/docker/docker.v20@v20.10.27/pkg/pidfile/pidfile_unix.go (about)

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