summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-12-20Use '!' instead of '== false'Bryant Mairs
Reads a little bit easier
2017-12-20Remove unnecessary mutBryant Mairs
2017-12-20Correct ioctl read and write_ptr testsBryant Mairs
Looks like a copy/paste error might have caused this
2017-12-20Remove useless Err(_) match armsBryant Mairs
2017-12-20Use Rc::clone() instead of .clone()Bryant Mairs
Makes it more clear what's being cloned
2017-12-20Remove unnecessary referencesBryant Mairs
2017-12-20Use println!() instead of print!(...n)Bryant Mairs
2017-12-20Make numeric literals easier to readBryant Mairs
2017-12-20Remove unnecessary .ok()Bryant Mairs
2017-12-20Use iter::Cloned() instead of closureBryant Mairs
2017-12-20Remove 'static from variablesBryant Mairs
It's unclear why these were static in the first place.
2017-12-20Remove elided 'static lifetimeBryant Mairs
As of Rust 1.17 'static lifetimes are implied when declaring consts.
2017-12-20Remove useless vec![]Bryant Mairs
2017-12-20Add backticks to types in doccommentsBryant Mairs
2017-12-20Use byte strings instead of String.as_bytes()Bryant Mairs
A little easier to read
2017-12-20Use write_all instead of writeBryant Mairs
Several tests make the assumption that all data is written, which is not guaranteed with write(), so use write_all() instead.
2017-12-20Merge #648bors[bot]
648: Fix `struct msghdr` types on non-Linux platforms. r=Susurrus a=kinetiknz Type `struct msghdr` and `struct cmsghdr` types defined in `sys/socket/ffi.rs` match the Linux headers, but differ from the standard header (and other OSes): http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html This PR fixes a memory corruption/unsafety issue on non-Linux machines when using `recvmsg` with certain parameters. While fixing this, I wondered what the reason was for nix not using libc's definition of these structures. Closes #748.
2017-12-20Migrate sys/socket to libc FFI types and fix `msghdr` definition mismatch.Matthew Gregan
2017-12-19Merge #799bors[bot]
799: Fix nix on Dragonfly r=Susurrus a=mneumann This commit replaces pull request https://github.com/nix-rust/nix/pull/684. It fixes building `nix` on DragonFly. All tests pass. This requires most recent libc to build: https://github.com/rust-lang/libc/pull/851.
2017-12-19Fix support for DragonFlyMichael Neumann
* DragonFly does not have a O_DSYNC flag * Fix type_of_cmsg_data on DragonFly * No fexecve() on DragonFly * Do not run aio test cases on DragonFly * Keep target lists in alphabetical order * Unscrable #[cfg] directives and use cfg_if! macro instead * Fix errno on DragonFly Below follows an explanation why we have to use a C extension to get errno working on DragonFly: DragonFly uses a thread-local errno variable, but #[thread_local] is feature-gated and not available in stable Rust as of this writing (Rust 1.21.0). We have to use a C extension (src/errno_dragonfly.c) to access it. Tracking issue for `thread_local` stabilization: https://github.com/rust-lang/rust/issues/29594 Once this becomes stable, we can remove build.rs, src/errno_dragonfly.c, remove the build-dependency from Cargo.toml, and use: extern { #[thread_local] static errno: c_int; } Now all targets will use the build.rs script, but only on DragonFly this will do something. Also, there are no additional dependencies for targets other than DragonFly (no gcc dep).
2017-12-11Merge #814bors[bot]
814: Misc cleanup r=Susurrus a=Susurrus Add more traits to the various datatypes in `nix`. Also try to utilize more `libc` types where appropriate. This is still WIP because: * Looking for feedback on ba2d85bc. Does it make sense for bitflags structs to have `Ord` & `PartialOrd` derived for them? * Need to implement a newtype wrapper around `libc::linger` with both a `new()` constructor and getters. Additionally this needs manual implementations of `Eq`, `PartialEq`, `Debug` (I've been skipping manually implementing `Hash` for now. * In 2b3fb11a46 I need to implement newtype wrappers around `ip_mreq` and `ipv6_mreq` that have `new()` constructors and field getters. Additionally they need manual implementations of `Eq`, `PartialEq`, `Debug` (I've been skipping manually implementing `Hash` for now. This commit also needs a CHANGELOG entry. * ed79cfbc needs a CHANGELOG entry because its variants names have changed with the switch to using `libc_bitflags!`.
2017-12-10Remove references to developer docsBryant Mairs
This hasn't been available for a while now. And was not updated for even longer before that. Let's not mislead our users any longer.
2017-12-10Replace ip(v6)_mreq structs with libc equivalentBryant Mairs
2017-12-10Replace custom ucred struct with newtype wrapper around libc::ucredBryant Mairs
2017-12-10Use libc::lingerBryant Mairs
2017-12-10Migrate more bitflags to use libc_bitflags!Bryant Mairs
2017-12-10Remove internal kernel flagsBryant Mairs
2017-12-10Add more derives for SignalFd and various enumsBryant Mairs
2017-12-10Expand derives for all libc_bitflags! useBryant Mairs
2017-12-11Merge #806bors[bot]
806: Cleanup all doc warnings r=asomers a=Susurrus With the impending switch to Pulldown as the default doc generator, warnings have been enabled for incompatible syntax. This fixes all of said warnings.
2017-12-10Cleanup doc warningsBryant Mairs
With the impending switch to Pulldown as the default doc generator, warnings have been enabled for incompatible syntax. This fixes all of said warnings.
2017-12-10Fix doctest that weren't run with the old doctest parserBryant Mairs
The switch to Pulldown for the Markdown parser for Rustdoc has revealed that there were a large number of doctests that weren't being run. These tests failed to compile before, but will also fail to run because they attach to arbitrary user and group IDs, which likely don't exist on the system. These are therefore marked as `no_run`.
2017-12-09Merge #741bors[bot]
741: Expose `decode` on `WaitStatus` and make it return a `Result` r=Susurrus a=rocallahan Closes #740.
2017-12-09Merge #815bors[bot]
815: Reduce ios builds r=Susurrus a=Susurrus Closes #669
2017-12-08Run all iOS builds on a single runBryant Mairs
2017-12-08Support building and testing multiple targets at onceBryant Mairs
Specifying multiple targets can be done by setting the environment variable to a semi-colon delimited list of targets.
2017-12-08Merge #807bors[bot]
807: Switch to libc definitons of errno constants r=Susurrus a=Susurrus Still need to do OpenBSD and NetBSD. Primary goal with this first pass is to see what doesn't exist properly in `libc`. Closes #487.
2017-12-08Merge #777bors[bot]
777: Use the real pipe2(2) on most targets r=asomers a=asomers FreeBSD added pipe2(2) in version 10.0.
2017-12-07Use the real pipe2(2) on all BSD targets.Alan Somers
All supported non-Apple platforms now use the native syscall. Only ios and macos lack it. Deprecate pipe2 on those platforms, because it's impossible to guarantee atomicity with a userland implementation. It was added in: * DragonflyBSD 4.2 * FreeBSD 10.0 * NetBSD 6.0 * OpenBSD 5.7
2017-12-05Derive Eq for ErrnoBryant Mairs
2017-12-05Remove redundant constant testsBryant Mairs
Now that these constants are verified within libc, these tests are no longer necessary.
2017-12-05Remove nix-test subcrateBryant Mairs
This was doing testing for errno constants and a few other types that is no longer necessary now that these types are all tested within the libc project itself.
2017-12-05Switch to libc definitons of errno constantsBryant Mairs
2017-12-05Merge #696bors[bot]
696: Stop reexporting `Errno` variants r=Susurrus a=jonas-schievink Closes #664 (unsure if this is everything needed)
2017-12-05Expose `from_raw` on `WaitStatus` and make it return a `Result`Robert O'Callahan
2017-12-04Stop reexporting `Errno` and its variantsJonas Schievink
cc #664 (unsure if this is everything needed)
2017-12-04Merge #667bors[bot]
667: Add support for getifaddrs. r=asomers a=mwanner Here's a first attempt at a rustian interface for `getifaddrs`, please review. Changes for the changelog: - Added `nix::ifaddrs::{getifaddrs, InterfaceAddressIterator, InterfaceAddress and InterfaceFlags}` Closes #650. Closes #764.
2017-12-03Add support for getifaddrs. Closes: #650.Markus Wanner
2017-12-03Merge #801bors[bot]
801: Upgrade to Bitflags 1.0 r=asomers a=Susurrus 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. Closes #766.
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.