//go:build !windows

package daemon

import (
	"errors"
	"os"
	"syscall"
)

// checkPID reports liveness only. Discovery and identity verification use the
// runtime receipt plus x/proc and never inspect command lines or scan /proc.
func checkPID(pid int) bool {
	if pid <= 0 || pid > MaxPID {
		return false
	}
	process, err := os.FindProcess(pid)
	if err != nil {
		return false
	}
	err = process.Signal(syscall.Signal(0))
	return err == nil || errors.Is(err, syscall.EPERM)
}
