(pid: intptr_t, opt: i32, vm: &VirtualMachine)
| 943 | #[cfg(target_env = "msvc")] |
| 944 | #[pyfunction] |
| 945 | fn waitpid(pid: intptr_t, opt: i32, vm: &VirtualMachine) -> PyResult<(intptr_t, u64)> { |
| 946 | let mut status: i32 = 0; |
| 947 | let pid = unsafe { suppress_iph!(_cwait(&mut status, pid, opt)) }; |
| 948 | if pid == -1 { |
| 949 | Err(vm.new_last_errno_error()) |
| 950 | } else { |
| 951 | // Cast to unsigned to handle large exit codes (like 0xC000013A) |
| 952 | // then shift left by 8 to match POSIX waitpid format |
| 953 | let ustatus = (status as u32) as u64; |
| 954 | Ok((pid, ustatus << 8)) |
| 955 | } |
| 956 | } |
| 957 | |
| 958 | #[cfg(target_env = "msvc")] |
| 959 | #[pyfunction] |
no test coverage detected