proc

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Process group control and process table queries shared by the shell and the MCP child processes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Group

func Group(cmd *exec.Cmd)

Puts the command in its own process group so Kill can reach every descendant

func Kill

func Kill(cmd *exec.Cmd) error

Kills the command together with every process in its group

func KillNewDescendants

func KillNewDescendants(pid int, keep map[int]bool)

Kills every descendant of pid that is not in keep, sweeping twice to catch late forks

func KillPID

func KillPID(pid int) error

Kills one process by id without touching its group

func KillTree

func KillTree(pid int)

Kills pid and every descendant, sweeping twice so children forked during the first pass die too

Types

type Process

type Process struct {
	PID  int
	PPID int
	// Exited but not yet reaped by its parent
	Zombie bool
}

One row of the process table

type Table

type Table []Process

Processes running at one instant

func Snapshot

func Snapshot() (Table, error)

Reads the process table

func (Table) Alive

func (t Table) Alive(pid int) bool

Reports whether pid is in the table and still running

func (Table) Descendants

func (t Table) Descendants(pid int) []int

Every descendant of pid, parents before their children

Jump to

Keyboard shortcuts

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