(args: Dup2Args<'_>, vm: &VirtualMachine)
| 2050 | |
| 2051 | #[pyfunction] |
| 2052 | fn dup2(args: Dup2Args<'_>, vm: &VirtualMachine) -> PyResult<OwnedFd> { |
| 2053 | let mut fd2 = core::mem::ManuallyDrop::new(args.fd2); |
| 2054 | nix::unistd::dup2(args.fd, &mut fd2).map_err(|e| e.into_pyexception(vm))?; |
| 2055 | let fd2 = core::mem::ManuallyDrop::into_inner(fd2); |
| 2056 | if !args.inheritable { |
| 2057 | super::set_inheritable(fd2.as_fd(), false).map_err(|e| e.into_pyexception(vm))? |
| 2058 | } |
| 2059 | Ok(fd2) |
| 2060 | } |
| 2061 | |
| 2062 | pub(crate) fn support_funcs() -> Vec<SupportFunc> { |
| 2063 | vec![ |
nothing calls this directly
no test coverage detected