mirror of
https://github.com/mii443/izoli.git
synced 2025-08-22 16:05:40 +00:00
add add_procs
This commit is contained in:
@ -145,6 +145,18 @@ impl CGroup {
|
|||||||
self.write_value("cgroup.max.descendants", max)
|
self.write_value("cgroup.max.descendants", max)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn add_procs(&self, procs: Vec<u32>) -> Result<(), std::io::Error> {
|
||||||
|
let to_write = procs
|
||||||
|
.iter()
|
||||||
|
.map(|proc| proc.to_string())
|
||||||
|
.collect::<Vec<String>>()
|
||||||
|
.join("\n");
|
||||||
|
|
||||||
|
self.write("cgroup.procs", &to_write)?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
fn write_value<T>(&self, name: &str, value: T) -> Result<(), std::io::Error>
|
fn write_value<T>(&self, name: &str, value: T) -> Result<(), std::io::Error>
|
||||||
where
|
where
|
||||||
T: fmt::Display,
|
T: fmt::Display,
|
||||||
|
Reference in New Issue
Block a user