-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Instead of defining `Termios` as a plain alias for the libc `termios` type, define our own `Termios` struct with a libc-compatible layout, so that we can use `bitflags` flags types, and have better overall ergonomics. This encapsulates the `termios` vs. `termios2` difference on Linux, and supports arbitrary I/O speeds on both Linux and BSDs with a consistent interface. This is a little higher-level than rustix typically aims for, but it doesn't incur extra syscalls or even extra `Termios` struct copies, and the things it hides are both awkward and uninteresting, such as the whole termios vs. termios2 split which only happens on Linux, where you have to use termios2 to support arbitrary speeds but you can't use termios2 with `cfmakeraw` etc., and also `c_ispeed`/`c_ospeed` work differently in termios2. And PowerPC lacks termios2 but has a termios that acts like termios2. And MIPS adds `TCSETS` to its `TCSANOW` etc. values.
- Loading branch information
1 parent
e601dcf
commit 74d07c9
Showing
20 changed files
with
1,864 additions
and
1,799 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.