(fd: crt_fd::Borrowed<'_>, data: ArgBytesLike, vm: &VirtualMachine)
| 322 | |
| 323 | #[pyfunction] |
| 324 | fn write(fd: crt_fd::Borrowed<'_>, data: ArgBytesLike, vm: &VirtualMachine) -> PyResult<usize> { |
| 325 | data.with_ref(|b| { |
| 326 | loop { |
| 327 | match vm.allow_threads(|| crt_fd::write(fd, b)) { |
| 328 | Ok(n) => return Ok(n), |
| 329 | Err(e) if e.raw_os_error() == Some(libc::EINTR) => { |
| 330 | vm.check_signals()?; |
| 331 | continue; |
| 332 | } |
| 333 | Err(e) => return Err(e.into_pyexception(vm)), |
| 334 | } |
| 335 | } |
| 336 | }) |
| 337 | } |
| 338 | |
| 339 | #[cfg(not(windows))] |
| 340 | #[pyfunction] |
no test coverage detected