Skip to content

Commit

Permalink
Add cfmakesane() on FreeBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
valpackett committed Jan 3, 2018
1 parent 096d6e8 commit 6c4e055
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/sys/termios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,18 @@ pub fn cfmakeraw(termios: &mut Termios) {
termios.update_wrapper();
}

/// Configures the port to "sane" mode (like the configuration of a newly created terminal).
///
/// Note that this is a non-standard function, available on FreeBSD.
#[cfg(target_os = "freebsd")]
pub fn cfmakesane(termios: &mut Termios) {
let inner_termios = unsafe { termios.get_libc_termios_mut() };
unsafe {
libc::cfmakesane(inner_termios);
}
termios.update_wrapper();
}

/// Set input baud rate (see
/// [cfsetispeed(3p)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/cfsetispeed.html)).
///
Expand Down

0 comments on commit 6c4e055

Please sign in to comment.