pidalive

package
v0.17.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package pidalive provides a single canonical answer to "is this PID alive?" for all of sprout. Replaces the per-package duplicate helpers that used os.FindProcess (which returns a non-nil handle even for dead PIDs on Windows, so a recycled PID would falsely appear alive).

Build tags in pidalive_windows.go and pidalive_unix.go route to the platform-specific implementation. The Unix version uses syscall.Kill(pid, 0) which is the correct cross-platform check on POSIX. The Windows version uses OpenProcess + GetExitCodeProcess via golang.org/x/sys/windows so it correctly distinguishes running PIDs from recycled/reused PIDs.

Tier 1 of SP-112 (platform parity).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAlive

func IsAlive(pid int) bool

IsAlive uses syscall.Kill(pid, 0), the canonical POSIX liveness check. Sends no signal but performs the permission/existence check — ESRCH means no such process, EPERM means it exists but we can't signal it (still alive).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL