MCPcopy Create free account
hub / github.com/chyyuu/os_kernel_lab / waitpid

Function waitpid

user/src/task.rs:33–43  ·  view source on GitHub ↗
(pid: usize, exit_code: &mut i32)

Source from the content-addressed store, hash-verified

31}
32
33pub fn waitpid(pid: usize, exit_code: &mut i32) -> isize {
34 loop {
35 match sys_waitpid(pid as isize, exit_code as *mut _) {
36 -2 => {
37 yield_();
38 }
39 // -1 or a real pid
40 exit_pid => return exit_pid,
41 }
42 }
43}
44
45pub fn waitpid_nb(pid: usize, exit_code: &mut i32) -> isize {
46 sys_waitpid(pid as isize, exit_code as *mut _)

Callers 2

mainFunction · 0.85
run_testsFunction · 0.85

Calls 2

yield_Function · 0.85
sys_waitpidFunction · 0.70

Tested by 1

run_testsFunction · 0.68