pub unsafe fn ptsname(fd: &PtyMaster) -> Result<String>
Expand description
Get the name of the slave pseudoterminal (see
ptsname(3)
)
ptsname()
returns the name of the slave pseudoterminal device corresponding to the master
referred to by fd
.
This value is useful for opening the slave pty once the master has already been opened with
posix_openpt()
.
§Safety
ptsname()
mutates global variables and is not threadsafe.
Mutating global variables is always considered unsafe
by Rust and this
function is marked as unsafe
to reflect that.
For a threadsafe and non-unsafe
alternative on Linux, see ptsname_r()
.