Returns the cgroup (v1 or v2) limits, if tjey exists.
()
| 226 | |
| 227 | /// Returns the cgroup (v1 or v2) limits, if tjey exists. |
| 228 | pub fn detect_limits() -> Option<Limits> { |
| 229 | let (v2_mounts, v1_mounts) = parse_proc_self_mountinfo()?; |
| 230 | let cgroups = parse_proc_self_cgroup()?; |
| 231 | if !v2_mounts.is_empty() { |
| 232 | return read_v2_memory_limit(&cgroups, &v2_mounts); |
| 233 | } |
| 234 | read_v1_memory_limit(&cgroups, &v1_mounts) |
| 235 | } |
| 236 | |
| 237 | #[cfg(test)] |
| 238 | mod tests { |
nothing calls this directly
no test coverage detected