Function nix_ptsname_r_shim::ptsname_r [−][src]
pub fn ptsname_r(fd: &PtyMaster) -> Result<String>
(emulated on macOS) Get the name of the slave pseudoterminal (see ptsname(3))
returns the name of the slave pseudoterminal device corresponding to the master
referred to by fd
. This is the threadsafe version of ptsname()
, but it is not part of the
POSIX standard and is instead a Linux-specific extension.
This value is useful for opening the slave ptty once the master has already been opened with
posix_openpt()
.
As ptsname_r()
is Linux-specific, this implementation emulates ptsname_r()
through
the TIOCPTYGNAME
syscall on macOS.