summaryrefslogtreecommitdiff
path: root/src/sys/termios.rs
AgeCommit message (Collapse)Author
2019-12-01Remove some obsolete comments.Alan Somers
ignore really is the correct things to do for these doc tests. compile_fail should only be used for examples that demonstrate a compile failure by design, not for stuff that only works on one platform.
2019-12-01impl TryFrom<libc::speed_t> for BaudRateAlan Somers
The old From implementation was actually falliable, and would panic on failure.
2019-12-01Remove the last use of mem::uninitializedAlan Somers
Replace it with mem::zeroed. It isn't perfect, but it's better than it was. Issue #1115
2019-11-02sys: termios: Use associated constants for VMIN and VTIME on sparc64John Paul Adrian Glaubitz
2019-11-01sys: termios: Fix inverted logic for [cfg()] conditional for sparc64John Paul Adrian Glaubitz
The fix for #1149 has the logic for the [cfg()] conditional inverted so that the aliases for VMIN and VTIME are defined on targets that are not linux-sparc64.
2019-11-01sys: termios: Define VMIN and VTIME as VEOF and VEOL on sparc64John Paul Adrian Glaubitz
On sparc64, glibc defines VMIN as VEOF and VTIME as VEOL for termios, so we need to inherit these alias definitions for nix-rust as well. Fixes #1149
2019-09-19Where relevant, replace equality checks in assert! with assert_eq!Xavier L'Heureux
`assert_eq!` gives more debug info when the test fails by default than `assert!`. This should help make debugging easier.
2019-09-03Replace most instances of mem::uninitialized with mem::MaybeUninitAlan Somers
Only two instances remain: * For the deprecated sys::socket::CmsgSpace::new. We should probably just remove that method. * For sys::termios::Termios::default_uninit. This will require some more thought. Fixes #1096
2019-06-09Add extra traits for all typesBryant Mairs
Derive Clone, Copy, Eq, Hash, and PartialEq for all types. Not all traits are supported by all types, which is why many are missing some.
2018-12-08Replace try! with ?Alan Somers
try! is not available in Rust 2018
2018-12-01Remove duplicate termios constantsBryant Mairs
These constants have the same value on sparc64, so need to be removed as enums in Rust can't have multiple names for the same value.
2018-12-01Fix baud rate constants on sparc64-linuxBryant Mairs
2018-11-28Prefer `map(drop)` to `map(|_| ())`Alan Somers
I previously advocated for the latter syntax on stylistic grounds. But it generates less efficient code, because it creates a new lambda function for each usage. The optimizer does not combine them. This change saves about 6KB of code.
2018-02-12Add cfmakesane() on FreeBSDGreg V
2018-01-28Fix B460800 and B921600 baud rates for netbsdBryant Mairs
2018-01-28Require Debug impls for all typesBryant Mairs
2018-01-28Deny unused qualificationsBryant Mairs
2018-01-25Consistently use `Termios` in commentsBryant Mairs
2018-01-25Don't use map(drop) as it's hard to understandBryant Mairs
.map(drop) makes it seem like there is a need to drop the type at that point when really all you're doing is trying to erase the type information and return an empty tuple. So do that explicitly instead of throwing drop in there.
2018-01-25Support arbitrary baud rates on BSDsBryant Mairs
2017-12-20Remove unnecessary '@ _'Bryant Mairs
2017-12-04Stop reexporting `Errno` and its variantsJonas Schievink
cc #664 (unsure if this is everything needed)
2017-12-02Upgrade to Bitflags 1.0Bryant Mairs
The libc_bitflags! macro was replaced with a non-recursive one supporting only public structs. I could not figure out how to make the old macro work with the upgrade, so I reworked part of the bitflags! macro directly to suit our needs, much as the original recursive macro was made. There are no uses of this macro for non-public structs, so this is not a problem for internal code.
2017-08-16Match libc_bitflags! syntax to upstream bitflags!Bryant Mairs
2017-07-10Add tcgetsid()Bryant Mairs
2017-07-10Add cfmakeraw and cfsetspeedBryant Mairs
2017-07-10Use libc types for termiosBryant Mairs
This also removes the incorrect TCSASOFT definition as an enum type because it's actually a bitfield.
2017-07-04Allow nix to compile on android targetsroblabla
2017-06-18Update bitflags to 0.9equal-l2
2017-04-09Removed unused libc imports in termios.Zac Berkowitz
2017-04-09Fixes nix-rust/nix#532Zac Berkowitz
2017-04-09Switched bsd speed_t def. to libc::speed_tZac Berkowitz
2017-02-25Using baud constants from libcZac Berkowitz
New baud constants landed in rust-lang/libc#530, we'll use them.
2017-02-25Corrected linux baud constants to octalsZac Berkowitz
2017-02-25Added BaudRate enum for termiosZac Berkowitz
Issue #514
2017-02-16Update bitflags to 0.7Simon Sapin
2016-03-12android: Fix reference to libc::ioctlKamal Marhubi
This fixes an import that was missed in the upgrade from libc 0.1 series to 0.2 series. Refs https://github.com/nix-rust/nix/issues/298
2016-01-28Move errno::Result back to crate rootarcnmx
2016-01-28Errno::result()arcnmx
2015-11-20netbsd supportJeremy Fitzhardinge
2015-09-09Add/Fix support for DragonFly BSDMichael Neumann
2015-07-27Make it compatible for Android.Tim JIANG
* Fixed an unused_import error in `termios.rs` for Android. * Fixed undefined references to `preadv` and `pwritev` for Android - At least they don't exist from API level 3 to 21. * Fixed the uid > 0 and gid > 0 checks in `stat`'s tests - Running the tests by root is possible, especially when running on a rooted Android device. Those changes made rust-nix buildable (again) on Android. All the tests passed as well.
2015-05-29Basic OpenBSD support.Laurence Tratt
Some of the tests are currently unrunnable, but the basic library is at least buildable.
2015-05-28Remove std::os::unix::io::RawFd re-exportCarl Lerche
2015-05-11Get the library to build on freebsdAndrew J. Stone
`cargo build` works.
2015-04-03'derive(Copy)' needs Clone nowFlorian Hartwig
2015-03-24NixResult -> nix::Result; NixError -> nix::ErrorCarl Lerche
2015-03-13Amend some files to make it compile on arm-linux-androideabi.kennytm
2015-02-10Add `NixPath`, `NixError`, and `NixResult`.Utkarsh Kukreti
2015-01-20Make `tcgetattr` API more ergonomic.Utkarsh Kukreti