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

Function wait

user/src/task.rs:21–31  ·  view source on GitHub ↗
(exit_code: &mut i32)

Source from the content-addressed store, hash-verified

19 sys_exec(path, args)
20}
21pub fn wait(exit_code: &mut i32) -> isize {
22 loop {
23 match sys_waitpid(-1, exit_code as *mut _) {
24 -2 => {
25 yield_();
26 }
27 // -1 or a real pid
28 exit_pid => return exit_pid,
29 }
30 }
31}
32
33pub fn waitpid(pid: usize, exit_code: &mut i32) -> isize {
34 loop {

Callers 8

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
fork_treeFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 2

yield_Function · 0.85
sys_waitpidFunction · 0.70

Tested by 4

mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68