wait for all child

This commit is contained in:
guochao 2023-11-03 10:18:12 +08:00
parent e1ba2f7141
commit d422f30774

View File

@ -1,7 +1,7 @@
use nix::{
libc::{c_long, EPERM, ORIG_RAX},
sys::stat::Mode,
unistd::{getpid, getppid},
unistd::{getpid, getppid, Pid},
};
use std::io::Write;
use std::{
@ -74,7 +74,7 @@ fn main() -> anyhow::Result<()> {
loop {
log::debug!("parent: waitpid...");
let waitstatus = waitpid(child, None)?;
let waitstatus = waitpid(Pid::from_raw(-1), None)?;
match waitstatus {
WaitStatus::Exited(pid, ret) => {