bcb837b8c7
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>