]> granicus.if.org Git - procps-ng/commit
First cut at subset=pid proc mount handling
authorCraig Small <csmall@dropbear.xyz>
Thu, 16 Dec 2021 09:36:00 +0000 (20:36 +1100)
committerCraig Small <csmall@dropbear.xyz>
Thu, 16 Dec 2021 09:36:00 +0000 (20:36 +1100)
commitbcb837b8c73f23536a2403b61deeb2b7b3c6be20
treee096ba5b74d5b5e4459a8ba322e6d0197ef6928a
parentdae897b54db777b48ebe833542bc006f6f73a467
First cut at subset=pid proc mount handling

The procfs mount option subset=pid only shows the processes, not things
such as /proc/stat etc.

For certain programs, this should mean they still work, but have reduced
functionality. This is the first cut at some of them.

pgrep - Removed always loading uptime which we never used anyway. The
program now works fine unless we use --older. Add note in man page
stating it will silently fail.

ps - Load boot time and memory total only when required instead of
always. Changed the error messages to something the user actually
cares about "can't get system boot time" vs "create a structure".
Works for most fields except starts and percent memory.

uptime - Give more useful error messages if uptime not available.

vmstat - move header generation after testing for required proc
files, makes the default output more consistent with the rest
of the options.

References:
 procps-ng/procps#227
 https://www.kernel.org/doc/html/latest/filesystems/proc.html#chapter-4-configuring-procfs
 https://github.com/torvalds/linux/commit/6814ef2d992af09451bbeda4770daa204461329e

Signed-off-by: Craig Small <csmall@dropbear.xyz>
pgrep.1
pgrep.c
ps/output.c
uptime.c
vmstat.c