procchain

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package procchain reads the chain of parent processes of a process: the process, its parent, the parent of the parent, and so on to the first process of the OS.

The chain is information only. A program can start a process with the same chain as an app, thus the chain is not a proof of the caller.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proc

type Proc struct {
	PID  int
	PPID int
	Exe  string
}

Proc is one process of a chain.

func Of

func Of(pid int) ([]Proc, error)

Of returns the chain of pid, from pid to the first process. The first item is pid.

func Self

func Self() ([]Proc, error)

Self returns the chain of this process.

func Top

func Top(chain []Proc) (Proc, bool)

Top returns the app at the top of the chain: the last process that is not a root process of the OS (PID 0, PID 1, launchd, init, or the System process of Windows).

func (Proc) Name

func (p Proc) Name() string

Name is the base name of the executable, with no ".exe" suffix.

Jump to

Keyboard shortcuts

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