diff --git a/src/cgroup/cgroup.rs b/src/cgroup/cgroup.rs index 8afbba8..f0af93a 100644 --- a/src/cgroup/cgroup.rs +++ b/src/cgroup/cgroup.rs @@ -5,7 +5,7 @@ use std::{ str::FromStr, }; -use super::{cgroup_stat::CGroupStat, controller::Controller}; +use super::{cgroup_stat::CGroupStat, controller::Controller, limit_value::CGroupLimitValue}; pub struct CGroup { pub path: PathBuf, @@ -98,4 +98,10 @@ impl CGroup { Ok(CGroupStat::from_str(&stat).unwrap()) } + + pub fn get_max_depth(&self) -> Result, std::io::Error> { + let max = self.read("cgroup.max.depth")?; + + Ok(CGroupLimitValue::from_str(&max).unwrap()) + } }