(fd: BorrowedFd<'_>, vm: &VirtualMachine)
| 2032 | |
| 2033 | #[pyfunction] |
| 2034 | fn dup(fd: BorrowedFd<'_>, vm: &VirtualMachine) -> PyResult<OwnedFd> { |
| 2035 | let fd = nix::unistd::dup(fd).map_err(|e| e.into_pyexception(vm))?; |
| 2036 | super::set_inheritable(fd.as_fd(), false) |
| 2037 | .map(|()| fd) |
| 2038 | .map_err(|e| e.into_pyexception(vm)) |
| 2039 | } |
| 2040 | |
| 2041 | #[derive(FromArgs)] |
| 2042 | struct Dup2Args<'fd> { |
nothing calls this directly
no test coverage detected