Skip to main content

parse_status

Function parse_status 

Source
pub fn parse_status(status: &str) -> Option<StatusFields>
Expand description

Parse /proc/<pid>/status.

  • Uid: line is Uid:\t<real>\t<effective>\t<saved>\t<fs>; we take the first (real) field.
  • Name: is the comm, truncated to 15 chars by the kernel; that is fine: it matches the protect-list which also compares against comm.
  • VmSwap: may be absent (e.g. kernel thread / no swap) and then counts as 0.

Returns None only if the required Uid: or Name: lines are missing.