fn waitpid(pid: i32, flags: u32) u32 { const Status = if (builtin.link_libc) c_uint else u32; var status: Status = undefined; while (true) { var ret: c_int = system.waitpid(pid, &status, flags); if (ret == -1) { if (std.os.errno(ret) == 4) continue; //EINTR unreachable; } return @intCast(u32, ret); } }