Sys.Linux.Cgroup (Hyper v0.1.0)

Copy Markdown View Source

cgroup introspection.

Summary

Functions

Detect which cgroup versions are mounted on this system, from /proc/mounts.

Reduce a list of mounts to the set of cgroup versions present, keyed by filesystem type. Pure; versions/0 is this applied to /proc/mounts.

Functions

versions()

@spec versions() :: {:ok, MapSet.t(:cgroup | :cgroup2)} | {:error, atom()}

Detect which cgroup versions are mounted on this system, from /proc/mounts.

Returns a set of the mounted versions - :cgroup (v1) and/or :cgroup2 (v2). An empty set means none are mounted; a set with both means a hybrid hierarchy.

versions_from_mounts(mounts)

@spec versions_from_mounts([Sys.Linux.Fstab.Spec.t()]) :: MapSet.t(:cgroup | :cgroup2)

Reduce a list of mounts to the set of cgroup versions present, keyed by filesystem type. Pure; versions/0 is this applied to /proc/mounts.