Skip to main content

forkpty

Function forkpty 

Source
pub fn forkpty() -> Result<(pid_t, i32)>
Expand description

forkpty(3). The child is a session leader with the slave as its controlling terminal. The parent receives the master fd. The child may see master_fd == -1 (Apple’s forkpty); that is returned as -1.

rustix has no forkpty. nix::pty::forkpty wraps the master in OwnedFd, which panics on Apple’s child -1, and its Child arm drops the master fd the caller returns as the second item.