summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2017-12-20Remove unnecessary .into()Bryant Mairs
2017-12-20Use unwrap_or_else instead of unwrap_or without a closureBryant Mairs
2017-12-20Remove unnecessary parenthesisBryant Mairs
2017-12-20Make numeric literals easier to readBryant Mairs
2017-12-20Merge redundant match armsBryant Mairs
2017-12-20Remove unnecessary referencesBryant Mairs
2017-12-20Make numeric literals easier to readBryant Mairs
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-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-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-03Add support for getifaddrs. Closes: #650.Markus Wanner
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-12-01Fix UB in epoll_ctlBryant Mairs
When passing None as an argument to `epoll_ctl`, UB is elicited within the `Into<&EpollEvent>` impl because it passes a null pointer as a `&mut EpollEvent`. Instead we remove that implementation completely and handle this case directly within the `epoll_ctl` function. Thanks to Arnavion for helping to debug this.
2017-11-19unistd: add execveat() on Linux and AndroidLuca Bruno
This adds execveat() to `nix::unistd`. It uses the execveat(2) Linux kernel syscall, which is available since 3.19. This is a Linux-specific extension which is not covered by POSIX and does not have any userland libc wrapper. Ref: http://man7.org/linux/man-pages/man2/execveat.2.html
2017-11-19sys/socket: add UnixAddr abstract name getterLuca Bruno
This introduces an `as_abstract()` getter to `UnixAddr` in order to retrieve the name of an abstract unix socket. This also adds tests around abstract addresses and clarify docs, adding explicit semantics.
2017-11-16Use libc function declarations for errno gettersBryant Mairs
2017-11-16Remove bitrig #[cfgsBryant Mairs
Bitrig is in the process of re-merging with OpenBSD as is no longer actively developed. Additionally it was never tested, and probably was quite broken, for nix. So let's remove all references and not even pretend to support it.
2017-11-12unistd: Rework import of std::ptrJamie Hewland
2017-11-12unistd: groups: Disable functions on Apple platformsJamie Hewland
2017-11-12unistd: groups: Respond to minor PR feedback itemsJamie Hewland
2017-11-12unistd: Make getgrouplist and initgroups take &CStrJamie Hewland
Don't need to call as_c_str()
2017-11-12unistd: Add getgrouplist()Jamie Hewland
2017-11-12unistd: Add initgroups()Jamie Hewland
2017-11-12unistd: Add getgroups()Jamie Hewland
2017-11-12unistd: Add setgroups()Jamie Hewland
2017-11-12unistd: Remove trailing whitespaceJamie Hewland
2017-11-11Merge #568bors[bot]
568: Add process_vm_readv and process_vm_writev r=asomers a=geofft
2017-11-11Merge #787bors[bot]
787: Omit invalid waitpid flags on OpenBSD r=Susurrus a=worr OpenBSD doesn't have `WEXITED`, `WSTOPPED`, or `WNOWAIT`, so omit those from that platform.
2017-11-11Formatting with rustfmtWilliam Orr