Expand description

Linux cgroup detection utilities.

Structs

An entry in /proc/self/cgroup
Represents a cgroup memory limit, with both ram and swap maximums if they exist. Fields should be None if a limit does not exist or when running on a platform without cgroup support (ie: non-Linux platforms).
An entry in /proc/self/mountinfo

Functions

Returns the cgroup (v1 or v2) memory limit if it exists.
Parses /proc/self/cgroup into a Vec, if the file exists.
Parses /proc/self/mountinfo into vectors of Mountinfo objects, returning (v2_mounts, v1_mounts).
Finds the cgroup v1 and mountpoint combination containing the memory controller, and reads the memory limits within.
Finds the mountpoint corresponding to the provided cgroup v2, and reads the memory limits within.