mirror of
https://github.com/mii443/izoli.git
synced 2025-08-22 16:05:40 +00:00
add get_max_depth
This commit is contained in:
@ -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<CGroupLimitValue<u64>, std::io::Error> {
|
||||
let max = self.read("cgroup.max.depth")?;
|
||||
|
||||
Ok(CGroupLimitValue::from_str(&max).unwrap())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user