Function nix::pty::forkpty
pub unsafe fn forkpty<'a, 'b, T: Into<Option<&'a Winsize>>, U: Into<Option<&'b Termios>>>(winsize: T, termios: U) -> Result<ForkptyResult>Documentation
Create a new pseudoterminal, returning the master file descriptor and forked pid.
in ForkptyResult
(see forkpty).
If winsize is not None, the window size of the slave will be set to
the values in winsize. If termios is not None, the pseudoterminal’s
terminal settings of the slave will be set to the values in termios.
Safety
In a multithreaded program, only async-signal-safe functions like pause
and _exit may be called by the child (the parent isn’t restricted). Note
that memory allocation may not be async-signal-safe and thus must be
prevented.
Those functions are only a small subset of your operating system’s API, so special care must be taken to only invoke code you can control and audit.