# `Sys.Linux.Cgroup`
[🔗](https://github.com/harmont-dev/hyper/blob/main/lib/sys/linux/cgroup.ex#L1)

cgroup introspection.

# `versions`

```elixir
@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`

```elixir
@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`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
