Finds the process with the given PID.
(pid: Pid)
| 406 | |
| 407 | /// Finds the process with the given PID. |
| 408 | pub fn get_process_data(pid: Pid) -> AxResult<Arc<ProcessData>> { |
| 409 | if pid == 0 { |
| 410 | return Ok(current().as_thread().proc_data.clone()); |
| 411 | } |
| 412 | PROCESS_TABLE.read().get(&pid).ok_or(AxError::NoSuchProcess) |
| 413 | } |
| 414 | |
| 415 | /// Finds the process group with the given PGID. |
| 416 | pub fn get_process_group(pgid: Pid) -> AxResult<Arc<ProcessGroup>> { |
no test coverage detected