summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-10-18Document ioctl_param_typeRukai
2018-10-17Merge #954bors[bot]
954: Make sys::stat::mode_t public r=asomers a=jmmv This allows using e.g. sys::stat::Mode::from_bits() without having to pull the mode_t type from libc (which is ugly if a project is trying to use nix exclusively to avoid libc's unsafety). This change mimics dev_t which was already exposed as public. Co-authored-by: Julio Merino <julio@meroh.net>
2018-10-16Make sys::stat::mode_t publicJulio Merino
This allows using e.g. sys::stat::Mode::from_bits() without having to pull the mode_t type from libc (which is ugly if a project is trying to use nix exclusively to avoid libc's unsafety). This change mimics dev_t which was already exposed as public.
2018-10-15Merge #953bors[bot]
953: Eliminate compiler warnings, especially on non-Linux platforms r=asomers a=asomers Co-authored-by: Alan Somers <asomers@gmail.com>
2018-10-15Eliminate compiler warnings, especially on non-Linux platformsAlan Somers
2018-10-15Merge #948bors[bot]
948: socket: add AF_UNSPEC to AddressFamily r=asomers a=levex Hi! I work on a [crate](https://github.com/levex/network-bridge-rs) where it would make sense to use `AF_UNSPEC` in place of `AF_INET`, since that's the API most bridge libraries use. Unfortunately, it seems that `nix` is missing a representation for `AF_UNSPEC`. This PR adds `Unspec` to `AddressFamily`, so we can now represent `AF_UNSPEC`. Co-authored-by: Levente Kurusa <lkurusa@acm.org>
2018-10-15socket: add AF_UNSPEC to AddressFamilyLevente Kurusa
Signed-off-by: Levente Kurusa <lkurusa@acm.org>
2018-10-11Merge #950bors[bot]
950: Fix #945 - documentation fix r=Susurrus a=jabedude Correct references to user ids to group ids. Fixes #945 Co-authored-by: Josh Abraham <sinisterpatrician@gmail.com>
2018-10-09Fix #945 - documentation fixJosh Abraham
Correct references to user ids to group ids.
2018-10-04Merge #946bors[bot]
946: Add a wrapper for utimes(2) r=asomers a=jmmv PR #944 added wrappers for the more-modern futimens(2) and utimesat(2), but unfortunately these APIs are not available on old-ish systems. In particular, macOS Sierra and below don't implement them, making the new APIs unusable. Whether we should care about such "old" systems is debatable, but the problem is that, at the moment, this is the only macOS version usable on Travis to test kexts and, thus, to test FUSE file systems. Co-authored-by: Julio Merino <julio@meroh.net>
2018-10-02Add a wrapper for utimes(2)Julio Merino
PR #944 added wrappers for the more-modern futimens(2) and utimesat(2), but unfortunately these APIs are not available on old-ish systems. In particular, macOS Sierra and below don't implement them, making the new APIs unusable. Whether we should care about such "old" systems is debatable, but the problem is that, at the moment, this is the only macOS version usable on Travis to test kexts and, thus, to test FUSE file systems.
2018-09-30Merge #944bors[bot]
944: Add wrappers for futimens(2) and utimesat(2) r=asomers a=jmmv Hello again! Let's see how this looks like. I don't think there is any other way of doing this via the standard library, though I see there is a `filetime` crate in the Rust nursery to add this missing functionality. Not sure what your policy for adding features into `nix` is. Co-authored-by: Julio Merino <jmmv@google.com>
2018-09-29Add wrappers for futimens(2) and utimesat(2)Julio Merino
2018-09-23Merge #930bors[bot]
930: Add wrapper for linux kernel module loading r=Susurrus a=bachp - init_module and finit_module to load kernel modules - delete_module to unload kernel modules Co-authored-by: Pascal Bach <pascal.bach@nextrem.ch>
2018-09-05Add wrapper for linux kernel module loadingPascal Bach
- init_module and finit_module to load kernel modules - delete_module to unload kernel modules Signed-off-by: Pascal Bach <pascal.bach@nextrem.ch>
2018-09-05Refactor skip_if_not_root into macroPascal Bach
This macro can be used in tests to skip the test if it requires root to sucssfully run.
2018-09-05Replace allow unused directive with _ prefixPascal Bach
2018-09-05Update to rand 0.5 cratePascal Bach
This avoids having both 0.4 and 0.5 (required by tempfile)
2018-09-05Merge #884bors[bot]
884: impl FromStr for sys::Signal r=Susurrus a=quodlibetor This implements both ALLCAPS and lowercase full name (including SIG) and short name. This matches what `kill` accepts in many shells, and it also allows the `Debug` representation of `Signal`, which means it can be round-tripped, if desired. Co-authored-by: Brandon W Maister <quodlibetor@gmail.com>
2018-09-04impl FromStr and Display for sys::SignalBrandon W Maister
This is a subset of what `kill` accepts in many shells. The Display implementation matches the `Debug` representation of `Signal`. The `FromStr` matches both Debug/Display which means it can be round-tripped, if desired.
2018-09-04Merge #916bors[bot]
916: new dir module r=Susurrus a=scottlamb Fixes #915 This is a lower-level interface than `std::fs::ReadDir`. Notable differences: * can be opened from a file descriptor (as returned by `openat`, perhaps before knowing if the path represents a file or directory). Uses `fdopendir` for this, available on all Unix platforms as of rust-lang/libc#1018. * implements `AsRawFd`, so it can be passed to `fstat`, `openat`, etc. * can be iterated through multiple times without closing and reopening the file descriptor. Each iteration rewinds when finished. * returns entries for `.` (current directory) and `..` (parent directory). * returns entries' names as a `CStr` (no allocation or conversion beyond whatever libc does). Co-authored-by: Scott Lamb <slamb@slamb.org>
2018-09-03new dir moduleScott Lamb
This is a lower-level interface than `std::fs::ReadDir`. Notable differences: * can be opened from a file descriptor (as returned by `openat`, perhaps before knowing if the path represents a file or directory). Uses `fdopendir` for this, available on all Unix platforms as of rust-lang/libc#1018. * implements `AsRawFd`, so it can be passed to `fstat`, `openat`, etc. * can be iterated through multiple times without closing and reopening the file descriptor. Each iteration rewinds when finished. * returns entries for `.` (current directory) and `..` (parent directory). * returns entries' names as a `CStr` (no allocation or conversion beyond whatever libc does).
2018-09-02Merge #900bors[bot]
900: deps: update tempfile to 3 r=Susurrus a=ignatenkobrain Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com> Co-authored-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2018-09-01deps: update tempfile to 3Igor Gnatenko
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2018-08-15sendmsg: remove unneeded mutIgor Gnatenko
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2018-08-15travis: bump rustc to 1.22.1Igor Gnatenko
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2018-08-06Merge #923bors[bot]
923: Fix control message *decoding* and add support for `ScmCredentials` r=asomers a=jonas-schievink While https://github.com/nix-rust/nix/pull/918 fixed the *encoding*, the *decoding* done by the `CmsgIterator` still remained broken when multiple messages are received. However, since nix didn't support any control message that could reliably be sent twice in one `sendmsg` call, this couldn't be tested properly. This PR addresses this by adding `SCM_CREDENTIALS` support and testing all of this by passing both an `SCM_CREDENTIALS` and a `SCM_RIGHTS` message at the same time. I've also verified that the resulting encoding is the same as for roughly equivalent C code. Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2018-07-27Fix *decoding* of cmsgs and add `ScmCredentials`.Jonas Schievink
2018-07-12Merge #927bors[bot]
927: Enable the select tests on powerpc and mips r=asomers a=jonas-schievink They pass at least on my machine with QEMU, so the underlying bugs might have been fixed. Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2018-07-11Enable the select tests on powerpc and mipsJonas Schievink
They pass at least on my machine with QEMU, so the underlying bugs might have been fixed.
2018-07-05Merge #921bors[bot]
921: Get `SO_PEERCRED` working on all Linux targets r=asomers a=jonas-schievink These were disabled for ARM way back in 0db6ed1a28b4fb4d408cd9b7c4dba0a79bccf1f7 and 09c00ed7d9d92db2a79baa3ed212e7e239edceb9. Try to enable them for all arches and Android as well, since the removal wasn't really explained and I see no reason why this shouldn't work. Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2018-07-05Merge #918bors[bot]
918: Fix passing multiple file descriptors / control messages via sendmsg r=asomers a=jonas-schievink Fixes #464 Closes #874 because it's incorporated here Closes #756 because it adds the test from that issue (with fixes) Co-authored-by: alecmocatta <alec@mocatta.net>
2018-07-05Get `SO_PEERCRED` working on all Linux targetsJonas Schievink
2018-07-05Merge #922bors[bot]
922: Add a sysinfo wrapper r=asomers a=jonas-schievink Closes #505 Returned values were also inspected manually to be correct. Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2018-07-04Add a sysinfo wrapperJonas Schievink
2018-07-04Clean up cmsg code and fix passing multiple cmsgsalecmocatta
2018-07-03Merge #914bors[bot]
914: Make preadv take immutable slice of IoVecs r=asomers a=farnoy fixes #913 I filled in the CHANGELOG, but I see that it usually links to PRs and not issues, do you want me to change it or remove and leave for you to describe? This change seems to be strictly backwards-compatible, I didn't have to change the test for it to work. Co-authored-by: Jakub Okoński <jakub@okonski.org>
2018-07-03Make preadv take immutable slice of IoVecs, fixes #913Jakub Okoński
2018-06-09Merge #912bors[bot]
912: Fix compilation on aarch64-unknown-linux-musl r=Susurrus a=Susurrus trust/cross don't support this architecture, so it's non-trivial to add CI testing for this to nix, but this fixed it locally for me. Since it's not a supported platform, I haven't added anything to the CHANGELOG, since this could break before the next release. Co-authored-by: Bryant Mairs <bryantmairs@google.com>
2018-06-03Fix compilation on aarch64-unknown-linux-muslBryant Mairs
2018-06-02Merge #911bors[bot]
911: Start the next dev cycle r=Susurrus a=Susurrus bors r+ Co-authored-by: Bryant Mairs <bryantmairs@google.com>
2018-06-02Start the next dev cycleBryant Mairs
2018-06-02Merge #910bors[bot]
910: Specify bytes version r=Susurrus a=Susurrus Needed to do this for the v0.11.0 release, but I missed it on my first pass through. Also updated the release notes to hopefully prevent this error in the future. Co-authored-by: Bryant Mairs <bryantmairs@google.com>
2018-06-02Update release procedureBryant Mairs
It can be easy to miss something that's required for a release, so run cargo publish as a dry run to make sure everything's set.
2018-06-02Specify bytes versionBryant Mairs
2018-06-02Merge #908bors[bot]
908: Prep for 0.11 release r=Susurrus a=Susurrus Co-authored-by: Bryant Mairs <bryantmairs@google.com>
2018-06-02Merge #909bors[bot]
909: Remove tests that weren't mine r=Susurrus a=Susurrus cc @kristate Co-authored-by: Bryant Mairs <bryantmairs@google.com>
2018-06-01Remove tests that weren't mineBryant Mairs
2018-06-01Set the 0.11 releaseBryant Mairs
2018-06-01[skip ci] Cleanup the CHANGELOGBryant Mairs