pub struct ProcessTable {
pub process_count: AtomicUsize,
/* private fields */
}Expand description
Global process table
Fields§
§process_count: AtomicUsizeNumber of active processes
Implementations§
Source§impl ProcessTable
impl ProcessTable
Sourcepub fn add_process(&self, process: Process) -> Result<ProcessId, KernelError>
pub fn add_process(&self, process: Process) -> Result<ProcessId, KernelError>
Add a process to the table
Sourcepub fn remove_process(&self, pid: ProcessId) -> Option<Box<Process>>
pub fn remove_process(&self, pid: ProcessId) -> Option<Box<Process>>
Remove a process from the table
Sourcepub fn get_process(&self, pid: ProcessId) -> Option<&'static Process>
pub fn get_process(&self, pid: ProcessId) -> Option<&'static Process>
Get a process by PID
Sourcepub fn get_process_mut(&self, pid: ProcessId) -> Option<&'static mut Process>
pub fn get_process_mut(&self, pid: ProcessId) -> Option<&'static mut Process>
Get mutable access to a process
Sourcepub fn find_children(&self, parent_pid: ProcessId) -> Vec<ProcessId>
pub fn find_children(&self, parent_pid: ProcessId) -> Vec<ProcessId>
Find all child processes of a parent
Sourcepub fn find_by_state(&self, state: ProcessState) -> Vec<ProcessId>
pub fn find_by_state(&self, state: ProcessState) -> Vec<ProcessId>
Find processes by state
Sourcepub fn reap_zombies(&self) -> Vec<(ProcessId, i32)>
pub fn reap_zombies(&self) -> Vec<(ProcessId, i32)>
Clean up zombie processes