Skip to content

Commit 397840a

Browse files
committed
Add documentation for openpty
1 parent 663ff03 commit 397840a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/pty.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ pub struct OpenptyResult {
1313
pub slave: RawFd,
1414
}
1515

16+
/// Create a new pseudoterminal, returning the slave and master file descriptors
17+
/// in `OpenptyResult`
18+
/// (see [openpty](http://man7.org/linux/man-pages/man3/openpty.3.html)).
19+
///
20+
/// If `winsize` is not `None`, the window size of the slave will be set to
21+
/// the values in `winsize`. If `termios` is not `None`, the pseudoterminal's
22+
/// terminal settings of the slave will be set to the values in `termios`.
1623
#[inline]
1724
pub fn openpty(winsize: Option<Winsize>, termios: Option<Termios>) -> Result<OpenptyResult> {
1825
let mut slave: libc::c_int = -1;

0 commit comments

Comments
 (0)