MCPcopy Index your code
hub / github.com/RustPython/RustPython / openpty

Function openpty

crates/vm/src/stdlib/posix.rs:1538–1544  ·  view source on GitHub ↗
(vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1536 #[cfg(not(target_os = "redox"))]
1537 #[pyfunction]
1538 fn openpty(vm: &VirtualMachine) -> PyResult<(OwnedFd, OwnedFd)> {
1539 let r = nix::pty::openpty(None, None).map_err(|err| err.into_pyexception(vm))?;
1540 for fd in [&r.master, &r.slave] {
1541 super::set_inheritable(fd.as_fd(), false).map_err(|e| e.into_pyexception(vm))?;
1542 }
1543 Ok((r.master, r.slave))
1544 }
1545
1546 #[pyfunction]
1547 fn ttyname(fd: BorrowedFd<'_>, vm: &VirtualMachine) -> PyResult {

Callers

nothing calls this directly

Calls 3

set_inheritableFunction · 0.70
into_pyexceptionMethod · 0.45
as_fdMethod · 0.45

Tested by

no test coverage detected