add controller

This commit is contained in:
mii443
2024-10-17 02:04:23 +00:00
parent 167b51b6b1
commit c827b2f5c7
2 changed files with 12 additions and 0 deletions

View File

@ -5,4 +5,5 @@ fn main() {
let cgroup = CGroup::new("test").unwrap();
println!("{:?}", cgroup.get_root_path());
println!("{}", cgroup.check_status());
println!("{:?}", cgroup.read("cgroup.controllers"));
}

View File

@ -4,6 +4,17 @@ use std::{
path::{Path, PathBuf},
};
pub enum Controller {
Cpu,
Cpuset,
Memory,
Io,
Hugetlb,
Misc,
Pids,
Rdma,
}
pub struct CGroup {
pub path: PathBuf,
}