Skip to main content

wait_current

Function wait_current 

Source
pub fn wait_current(tf: &mut TrapFrame, exit_code_ptr: usize) -> isize
Expand description

Wait for any child to exit. If a zombie exists, returns its PID. If children exist but none are zombies, blocks the current process and jumps directly to trap_return (does NOT return). If no ready task can run while the parent is blocked, returns EBUSY instead of parking the parent without a runnable handoff. Returns -1 if no children exist.