pidfile_unix.go 238 B

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