summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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
2018-06-02Merge #907bors[bot]
907: Remove emulation of FD_CLOEXEC/O_NONBLOCK r=asomers a=Susurrus Rather than using the native implementation of these constants on supported platforms, the native implementation was instead emulated. This was also hidden from the user even though this could result in data races and the functionality being broken. Native functionality is, however, not support on macos/ios. Rather than enable this emulation solely for this platform, it should be removed as this is a dangerous abstraction. This is a replacement for #863. There is much previous discussion there which I recommend you read to familiarize yourself with this decision. I'm looking to push this through rather quickly as it's the last thing blocking our next 0.11.0 release. cc @aomser @kristate Co-authored-by: Bryant Mairs <bryantmairs@google.com>
2018-06-01Remove emulation of FD_CLOEXEC/O_NONBLOCKBryant Mairs
Rather than using the native implementation of these constants on supported platforms, the native implementation was instead emulated. This was also hidden from the user even though this could result in data races and the functionality being broken. Native functionality is, however, not support on macos/ios. Rather than enable this emulation solely for this platform, it should be removed as this is a dangerous abstraction.
2018-05-29Merge #901bors[bot]
901: Implement sendfile on FreeBSD and Darwin r=Susurrus a=morrowa This PR exposes the `sendfile` system call on libc's supported BSD-likes: * FreeBSD * Darwin (macOS/iOS) DragonFly could be supported in the future, but I was unable to build rustc to test. Note that NetBSD has no equivalent system call. Co-authored-by: Andrew Morrow <andrew.d.morrow@gmail.com>
2018-05-28Implement sendfile on FreeBSD and DarwinAndrew Morrow
2018-05-29Merge #906bors[bot]
906: Fix bind() on Android 64-bit r=Susurrus a=Susurrus libc fixed `bind()` for Android 64-bit targets, so change our code to match. PRs are failing (like #901) so let's get this merged. CC @asomers @morrowa Co-authored-by: Bryant Mairs <bryantmairs@google.com>
2018-05-28Fix bind() on Android 64-bitBryant Mairs
libc fixed `bind()` for Android 64-bit targets, so change our code to match.
2018-05-22Merge #904bors[bot]
904: Typo r=asomers a=bestouff Co-authored-by: Xavier Bestel <xavier.bestel@free.fr>
2018-05-22TypoXavier Bestel
2018-05-06Merge #893bors[bot]
893: Remove IFF_NOTRAILERS for openbsd r=asomers a=kpcyrd nix currently doesn't compile on openbsd because `IFF_NOTRAILERS` isn't found. This PR fixes the openbsd build again (tested on 6.3). It seems it was changed in this commit: https://github.com/openbsd/src/commit/beb8b0dd5985e55a615b52e593da6e75bab33f3f Co-authored-by: kpcyrd <git@rxv.cc>
2018-05-06Merge #897bors[bot]
897: Add documentation to signal-handling functions r=Susurrus a=zombiezen Co-authored-by: Ross Light <light@google.com>
2018-05-05Add documentation to signal-handling functionsRoss Light
2018-05-02OpenBSD: remove IFF_NOTRAILERSkpcyrd
IFF_NOTRAILERS has been removed in OpenBSD 6.3 https://github.com/openbsd/src/commit/beb8b0dd5985e55a615b52e593da6e75bab33f3f
2018-05-02Merge #880bors[bot]
880: Update changelog for #869 r=Susurrus a=Detegr Updated changelog to contain #869 Co-authored-by: Antti Keränen <detegr@gmail.com>
2018-05-01[skip ci] Update changelog for #869Antti Keränen
2018-04-29Merge #892bors[bot]
892: Fixed ptrace::Request cfg conditions r=asomers a=dalance The cfg condition of ptrace::Request seems to be different from libc. For example, PTRACE_GETREGS is defined by libc to i686-unknown-linux-gnu target, but it is not defined in ptrace::Request. I tried to change the cfg condition to the same as libc's condition. I thinks this change covers the definitions under src/unix/notbsd directory in libc repository. Co-authored-by: dalance <dalance@gmail.com>
2018-04-29Enabled more ptrace::Request definitions for uncommon Linux platformsdalance
2018-04-28Merge #894bors[bot]
894: Add pselect syscall r=asomers a=antifuchs I saw that #276 was closed, and now I need `pselect`, so here it is! I copied the function body from @abbradar's work, updated the type signatures, added two tests and added a doc comment. Hope this works! Co-authored-by: Andreas Fuchs <asf@boinkor.net>
2018-04-28select: add pselect syscallAndreas Fuchs
This is a straight port of @abbradar's work in #276, with two (somewhat weak) tests and a bit of documentation.
2018-04-20Merge #887bors[bot]
887: Implement Debug trait for PollFd (Fixes #885) r=asomers a=kccqzy This is useful when using printf-style debugging to observe the variables and of the program. This is discussed in issue #885. Co-authored-by: Zhouyu Qian <qzy@qzy.io>
2018-04-19Implement Debug trait for PollFdZhouyu Qian
This is useful when using printf-style debugging to observe the variables of the program. Also includes a test. Fixes #885.
2018-04-19Merge #883bors[bot]
883: Expose `preadv` and `pwritev` on BSDs r=asomers a=morrowa This addresses issue #690. It exposes the `preadv` and `pwritev` functions on supported BSDs (not including Apple platforms). Co-authored-by: Andrew Morrow <andrew.d.morrow@gmail.com>