platform

package
v0.12.36 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsWSL

func IsWSL() bool

IsWSL returns true when running under Windows Subsystem for Linux.

func KillPID

func KillPID(pid int, gracefulTimeout int) error

KillPID sends SIGTERM to the process group for pid, waits up to gracefulTimeout seconds, then escalates to SIGKILL. On Windows it uses TerminateProcess.

Types

type ProcInfo

type ProcInfo struct {
	PID     int
	PPID    int    // parent PID (0 if unavailable)
	Command string // basename of the executable
	Cmdline string // full command line
	Cwd     string // working directory (may be empty on some platforms)
}

ProcInfo describes a running process discovered via OS-level scanning.

func Scan

func Scan() ([]ProcInfo, error)

Scan returns all running processes by reading /proc on Linux.

func ScanWindows

func ScanWindows() ([]ProcInfo, error)

ScanWindows returns Windows-side processes when running under WSL. On non-WSL Unix this returns nil.

Jump to

Keyboard shortcuts

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