pub trait CgroupOps:
Send
+ Sync
+ 'static {
// Required methods
fn id(&self) -> u64;
fn add_process(
&self,
locked: &mut Locked<FileOpsCore>,
thread_group: &ThreadGroup,
) -> Result<(), Errno>;
fn new_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>;
fn get_children(&self) -> Result<Vec<CgroupHandle>, Errno>;
fn get_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>;
fn remove_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>;
fn get_pids(&self, kernel: &Kernel) -> Vec<pid_t> ⓘ;
fn kill(&self);
fn is_populated(&self) -> bool;
fn get_freezer_state(&self) -> CgroupFreezerState;
fn freeze(&self, locked: &mut Locked<FileOpsCore>);
fn thaw(&self);
}Expand description
Common operations of all cgroups.
Required Methods§
Sourcefn add_process(
&self,
locked: &mut Locked<FileOpsCore>,
thread_group: &ThreadGroup,
) -> Result<(), Errno>
fn add_process( &self, locked: &mut Locked<FileOpsCore>, thread_group: &ThreadGroup, ) -> Result<(), Errno>
Add a process to a cgroup. Errors if the cgroup has been deleted.
Sourcefn new_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
fn new_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
Create a new sub-cgroup as a child of this cgroup. Errors if the cgroup is deleted, or a
child with name already exists.
Sourcefn get_children(&self) -> Result<Vec<CgroupHandle>, Errno>
fn get_children(&self) -> Result<Vec<CgroupHandle>, Errno>
Gets all children of this cgroup.
Sourcefn get_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
fn get_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
Gets the child with name, errors if not found.
Sourcefn remove_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
fn remove_child(&self, name: &FsStr) -> Result<CgroupHandle, Errno>
Remove a child from this cgroup and return it, if found. Errors if cgroup is deleted, or a
child with name is not found.
Sourcefn get_pids(&self, kernel: &Kernel) -> Vec<pid_t> ⓘ
fn get_pids(&self, kernel: &Kernel) -> Vec<pid_t> ⓘ
Return all pids that belong to this cgroup.
Sourcefn is_populated(&self) -> bool
fn is_populated(&self) -> bool
Whether the cgroup or any of its descendants have any processes.
Sourcefn get_freezer_state(&self) -> CgroupFreezerState
fn get_freezer_state(&self) -> CgroupFreezerState
Get the freezer self state and effective state.
Sourcefn freeze(&self, locked: &mut Locked<FileOpsCore>)
fn freeze(&self, locked: &mut Locked<FileOpsCore>)
Freeze all tasks in the cgroup.