Skip to content

Commit 3d93034

Browse files
committed
Add cfmakesane() on FreeBSD
1 parent aeb1651 commit 3d93034

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
7070
([#835](https://github.com/nix-rust/nix/pull/835))
7171
- Added `EVFILT_EMPTY`, `EVFILT_PROCDESC` and `EVFILT_SENDFILE` on FreeBSD.
7272
([#825](https://github.com/nix-rust/nix/pull/825))
73+
- Exposed `termios::cfmakesane` on FreeBSD.
74+
([#825](https://github.com/nix-rust/nix/pull/825))
7375

7476
### Changed
7577
- Exposed the `mqueue` module for all supported operating systems.

src/sys/termios.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,19 @@ pub fn cfmakeraw(termios: &mut Termios) {
10221022
termios.update_wrapper();
10231023
}
10241024

1025+
/// Configures the port to "sane" mode (like the configuration of a newly created terminal) (see
1026+
/// [tcsetattr(3)](https://www.freebsd.org/cgi/man.cgi?query=tcsetattr)).
1027+
///
1028+
/// Note that this is a non-standard function, available on FreeBSD.
1029+
#[cfg(target_os = "freebsd")]
1030+
pub fn cfmakesane(termios: &mut Termios) {
1031+
let inner_termios = unsafe { termios.get_libc_termios_mut() };
1032+
unsafe {
1033+
libc::cfmakesane(inner_termios);
1034+
}
1035+
termios.update_wrapper();
1036+
}
1037+
10251038
/// Return the configuration of a port
10261039
/// [tcgetattr(3p)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/tcgetattr.html)).
10271040
///

0 commit comments

Comments
 (0)