Skip to content

Commit 6c4e055

Browse files
committed
Add cfmakesane() on FreeBSD
1 parent 096d6e8 commit 6c4e055

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/sys/termios.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,18 @@ pub fn cfmakeraw(termios: &mut Termios) {
793793
termios.update_wrapper();
794794
}
795795

796+
/// Configures the port to "sane" mode (like the configuration of a newly created terminal).
797+
///
798+
/// Note that this is a non-standard function, available on FreeBSD.
799+
#[cfg(target_os = "freebsd")]
800+
pub fn cfmakesane(termios: &mut Termios) {
801+
let inner_termios = unsafe { termios.get_libc_termios_mut() };
802+
unsafe {
803+
libc::cfmakesane(inner_termios);
804+
}
805+
termios.update_wrapper();
806+
}
807+
796808
/// Set input baud rate (see
797809
/// [cfsetispeed(3p)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/cfsetispeed.html)).
798810
///

0 commit comments

Comments
 (0)