Skip to main content

Crate procutils_common

Crate procutils_common 

Source
Expand description

Shared utilities used by the procutils workspace.

This crate is a support library, not an end-user tool — it exists to keep parsing, matching, and formatting logic in one place across the procutils binaries. Each module is small and self-contained:

  • fmt: human-readable size formatters (K/M/G/T).
  • man: per-tool man-page content shared with the man-page generator.
  • procmatch: process selection logic shared by pgrep, pkill, skill, snice — regex matching plus filters on PID, UID, parent, session, tty, run-state, environment, and more.
  • signal: canonical signal-number/name table and parse_signal used by kill, pkill, skill.
  • uid: UID-to-username lookups backed by /etc/passwd, with a small per-process cache.
  • utmp: reader for the utmp(5) binary file format used by /var/run/utmp. The on-disk stride is computed from libc::utmpx so the parser stays correct across glibc architectures.

The API is not stable and may change without notice between releases. This crate is intended for internal use by the procutils workspace only.

Modules§

fmt
Human-readable size formatters.
man
Per-tool man page content shared with the man-page generator.
procmatch
Process selection logic shared by pgrep, pkill, skill, snice.
signal
Canonical signal table and signal-name parsing shared by kill, pkill, skill and friends.
uid
UID/username resolution backed by /etc/passwd.
utmp
Reader for the utmp(5) binary file format used by /var/run/utmp.

Constants§

MAX_TERM_WIDTH
Default maximum width for help-text wrapping in clap-derived CLIs.