summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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>
2018-04-18Support preadv/pwritev on BSDsAndrew Morrow
2018-04-11Merge #882bors[bot]
882: Update CHANGELOG for #833 r=Susurrus a=Susurrus Forgot to mention the big changes in #833 before it was merged. Co-authored-by: Bryant Mairs <bryantmairs@google.com>
2018-04-11[skip ci] Update CHANGELOG for #833Bryant Mairs
2018-04-11Merge #833bors[bot]
833: Refactor the ioctl API and documentation r=posborne a=Susurrus I still need to flesh out the docs for the different `ioctl_*!` variants that now exist. I separated them into different macros so they can have their own docs, which should help discoverability. And when macro namespacing comes around this will be a pretty neatly documented API I think (though we'll likely want to rename these macros again at that point). * Split `ioctl!` into separate macros. This makes documentation easier to read. * Expose `request_code_*!` in the documentation to make the `ioctl_*_bad` macros easier to use. * Reorganize the file hierarchy to be simpler cc @gabrielesvelto @posborne @jethrogb Co-authored-by: Bryant Mairs <bryantmairs@google.com>
2018-04-10Correct the third argument to ioctl on appropriate platforms.Bryant Mairs
While usually `ioctl()` passes a pointer, the function call has been overloaded to allow integers to be passed. For some platforms this is an `int` and on others it's a `ulong`. Fixes #824.
2018-04-10Implement equivalent for _IOWINT for FreeBSD-like targetsBryant Mairs
ioctls on FreeBSD and DragonflyBSD have a separate request code generation macro `_IOWINT` which is now exposed as `request_code_write_int`. `ioctl_write_int` is also fixed on these platforms to use this new request
2018-04-10Refactor the ioctl API and documentationBryant Mairs
* Split `ioctl!` into separate macros. This makes documentation easier to read. * For every `ioctl_*!` macro include a description of the macro arguments as, the function prototype for the generated wrapper function, and an example if we have one. * Expose `request_code_*!` in the documentation to make the `ioctl_*_bad` macros easier to use. * Reorganize the file hierarchy to be simpler
2018-04-07Merge #872bors[bot]
872: Change sys::aio::lio_listio to sys::aio::LioCb::listio r=asomers a=asomers The new LioCb structure allows us to control the exact arguments passed to lio_listio, guaranteeing that each call gets a unique storage location for the list argument. This prevents clients from misusing lio_listio in a way that causes events to get dropped from a kqueue Fixes #870
2018-04-06Add LioCb::listio_resubmitAlan Somers
It helps deal with errors like EAGAIN, which can result in a subset of an LioCb's operations being queued. The test is only enabled on FreeBSD, because it requires intimate knowledge of AIO system limits.
2018-03-29Merge #876bors[bot]
876: add mlockall and munlockall r=asomers a=afck Closes #875
2018-03-28Merge #877bors[bot]
877: Replace the gcc crate by cc r=asomers a=Eijebong
2018-03-28Replace the gcc crate by ccBastien Orivel
2018-03-27add docs for memory locking functionsAndreas Fackler
2018-03-27add mlockall and munlockallAndreas Fackler
2018-03-24Merge #857bors[bot]
857: Add chmod, fchmod, fchmodat functions r=asomers a=antage
2018-03-23Add fchmod, fchmodat functions.Anton Ageev
2018-03-22Replace AioCb::from_bytes with more generic from_boxed_sliceAlan Somers
Supporting the bytes crate was unnecessarily specific. This change replaces from_bytes and from_bytes_mut with from_boxed_slice and from_boxed_mut_slice, which can work with anything that implements Borrow<[u8]> and BorrowMut<[u8]>, respectively.
2018-03-22Fix an annoying double panicAlan Somers
A double panic can screw up the first panic's stack trace. Better not to assert! anything when the thread is already panicing.
2018-03-22Change sys::aio::lio_listio to sys::aio::LioCb::listioAlan Somers
The new LioCb structure allows us to control the exact arguments passed to lio_listio, guaranteeing that each call gets a unique storage location for the list argument. This prevents clients from misusing lio_listio in a way that causes events to get dropped from a kqueue Fixes #870
2018-03-22Merge #873bors[bot]
873: add SO_MARK SetSockOpt for Linux r=asomers a=mcginty SO_MARK allows traffic to be filtered by a "tag" using fwmark (see: https://www.linux.org/docs/man8/tc-fw.html). Tested on Linux as root - the test will skip over when not being run as root, as I noticed a few other tests do this in the suite already.
2018-03-21add SO_MARK SetSockOpt for LinuxJake McGinty
2018-03-21Merge #860bors[bot]
860: Update the release procedure r=asomers a=Susurrus Be more explicit about the development version to specify after doing a release. cc @nox Closes #468
2018-03-02Merge #869bors[bot]
869: Change SigAction::flags to use from_bits_truncated r=asomers a=Detegr On Linux, if the signal trampoline code is in the C library, sigaction sets the SA_RESTORER flag (0x04000000) in the sa_flags field of old sigaction (see sigreturn(2)). This is not intended for application use and is missing from SaFlags, therefore from_bits fails and unwrapping panics the user program. This fix just drops the bits that are not defined in SaFlags.
2018-03-02Change SigAction::flags to use from_bits_truncatedAntti Keränen
On Linux, if the signal trampoline code is in the C library, sigaction sets the SA_RESTORER flag (0x04000000) in the sa_flags field of old sigaction (see sigreturn(2)). This is not intended for application use and is missing from SaFlags, therefore from_bits fails and unwrapping panics the user program. This fix just drops the bits that are not defined in SaFlags.
2018-02-21Merge #825bors[bot]
825: FreeBSD: cfmakesane, EVFILT_* r=Susurrus a=myfreeweb Depends on: https://github.com/rust-lang/libc/pull/887
2018-02-19[skip ci] Update the release procedureBryant Mairs
Don't change the version in `Cargo.toml` after publishing to crates.io as it's unnecessary extra manual work.
2018-02-17Merge #846bors[bot]
846: Export socket options related macros r=Susurrus a=mexus In this PR I've added docs to that macros and exported them. I've also made related structs/traits to be public as well. Hope I didn't forget anything :) Reference issue: #577.
2018-02-15socket get-/setsockopt: document internal macros, types and traitsmexus
2018-02-12Expose MSG_CMSG_CLOEXEC on *BSDGreg V
2018-02-12Add cfmakesane() on FreeBSDGreg V