From d1f49bf38f3aad0171db306a1e23884b3102a539 Mon Sep 17 00:00:00 2001 From: Greg V Date: Thu, 4 Jan 2018 02:54:31 +0300 Subject: Add cfmakesane() on FreeBSD --- src/sys/termios.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/sys') diff --git a/src/sys/termios.rs b/src/sys/termios.rs index 356c7769..11cacd7c 100644 --- a/src/sys/termios.rs +++ b/src/sys/termios.rs @@ -1023,6 +1023,19 @@ pub fn cfmakeraw(termios: &mut Termios) { termios.update_wrapper(); } +/// Configures the port to "sane" mode (like the configuration of a newly created terminal) (see +/// [tcsetattr(3)](https://www.freebsd.org/cgi/man.cgi?query=tcsetattr)). +/// +/// 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(); +} + /// Return the configuration of a port /// [tcgetattr(3p)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/tcgetattr.html)). /// -- cgit v1.2.3