diff options
author | Greg V <greg@unrelenting.technology> | 2018-01-04 02:54:31 +0300 |
---|---|---|
committer | Greg V <greg@unrelenting.technology> | 2018-02-12 12:52:10 +0300 |
commit | d1f49bf38f3aad0171db306a1e23884b3102a539 (patch) | |
tree | d543b342c65d9157fa947dbf7d647249b425ad2a | |
parent | 5600cc40d5e558a6cd722b43fb708d9bd36e29a9 (diff) | |
download | nix-d1f49bf38f3aad0171db306a1e23884b3102a539.zip |
Add cfmakesane() on FreeBSD
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | src/sys/termios.rs | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index f3b03799..b819b9fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ([#832](https://github.com/nix-rust/nix/pull/832)) - Added `EVFILT_EMPTY`, `EVFILT_PROCDESC` and `EVFILT_SENDFILE` on FreeBSD. ([#825](https://github.com/nix-rust/nix/pull/825)) +- Exposed `termios::cfmakesane` on FreeBSD. + ([#825](https://github.com/nix-rust/nix/pull/825)) ### Changed - Display and Debug for SysControlAddr now includes all fields. 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)). /// |