summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-07-19Unify argument names to generated ioctl functionsBryant Mairs
2017-07-19Remove unnecessary constantsBryant Mairs
2017-07-19Remove c_int and c_void from rootBryant Mairs
These were exported for some weird reason and then left in for documentation. Also some parts of certain modules used them and others used the libc:: prefix. This was removed to improve the docs and also code consistency
2017-07-19Use the proper ioctl number type depending on targetBryant Mairs
This also means that we need to properly mask off bits to the valid range of ioctl numbers.
2017-07-19Remove ioc_* functionsBryant Mairs
These are low-level functions that shouldn't be exposed
2017-07-19Revise ioctl module documentationBryant Mairs
This refactors the examples to more directly address the exact use cases for the `ioctl!` macro that `nix` provides. Additionally other macros that should not be used by end users are no longer discussed.
2017-07-19Remove unnecessary path aliasingBryant Mairs
2017-07-19Hide internal macros/types within ioctlBryant Mairs
2017-07-19Add a "bad none" variant to the ioctl macroBryant Mairs
2017-07-19Re-add bad variant of ioctl!Bryant Mairs
2017-07-19Remove old workaroundBryant Mairs
2017-07-19Merge #681bors[bot]
681: Remove feature flags r=Susurrus These are vestiges of the initial push to get this working on Rust 1.0. These feature flags are undocumented and so hard to discover (only learned about them today!), prevent functions being included that should be and this also affects documentation on docs.rs, and none of the features are tested in CI and the `execvpe` has been broken for forever. The solution is to conditionally compile everything supported for a given platform and do away completely with the feature flags. The `execvpe` function is completely removed as it's not available for *nix platforms in libc and is already broken, so no loss removing it. We'll add it back once it's back in libc (rust-lang/libc#670). Closes #98. Closes #206. Closes #306. Closes #308.
2017-07-19Merge #686bors[bot]
686: Fix special ptraces r=Susurrus In #614 we added specializations of `ptrace()` that added more type safety. As part of this, the `UnsupportedOperation` error was introduced for the requests that are covered by specialized versions so they couldn't be used with the general `ptrace()`. Unfortunately, no tests were added with this PR and so it slipped through that you could not do those operations at all anymore: `ptrace()` reported `UnsupportedOperation` for them and `ptrace_*` called `ptrace`, not `ffi::ptrace` and so also reported `UnsupportedOperation`! Whoops! This minimally-invasive surgery corrects this by adding tests that call all the specialized `ptrace_*` ignoring the return value save checking for `UnsupportedOperation`. It also changes the functions calls to use `ffi::ptrace()` directly to fix the bug. As this was never a bug in a released version of `nix`, there's no need for a changelog entry here.
2017-07-19Merge #689bors[bot]
689: Fix testing r=asomers Move `powerpc-unknown-linux-gnu` to Tier 2. And attempt a fix for the epoll tests that seem to fail reliably now. cc @asomers
2017-07-18Allow failures when testing Rust betaBryant Mairs
2017-07-18Downgrade powerpc/Linux/Gnu to Tier 2Bryant Mairs
2017-07-18Remove unused importsBryant Mairs
2017-07-18Update changelogBryant Mairs
2017-07-18Remove broken execvpe implementationBryant Mairs
It was broken when enabled, and currently the libc definition is only available for windows. This will be re-added when a new libc is released that supports it across all available platforms
2017-07-18Remove signalfd feature in favor of conditional compilationBryant Mairs
Note that this is now only available for Linux as support is missing in libc for Android (see rust-lang/libc#671). As part of this work the SIGUSR2 signal mutex was altered to be a general signal mutex. This is because all signal handling is shared across all threads in the Rust test harness, so if you alter one signal, depending on whether it's additive or may overwrite the mask for other signals, it could break the other ones. Instead of putting this on the user, just broaden the scope of the mutex so that any altering of signal handling needs to use it.
2017-07-17Remove preadv_pwritev feature in favor of conditional includeBryant Mairs
2017-07-17Remove eventfd feature in favor of conditional includeBryant Mairs
2017-07-18Merge #638bors[bot]
638: Make aio, chdir, and wait tests thread safe r=Susurrus Fix thread safety issues in aio, chdir, and wait tests They have four problems: * The chdir tests change the process's cwd, which is global. Protect them all with a mutex. * The wait tests will reap any subprocess, and several tests create subprocesses. Protect them all with a mutex so only one subprocess-creating test will run at a time. * When a multithreaded test forks, the child process can sometimes block in the stack unwinding code. It blocks on a mutex that was held by a different thread in the parent, but that thread doesn't exist in the child, so a deadlock results. Fix this by immediately calling `std::process:;exit` in the child processes. * My previous attempt at thread safety in the aio tests didn't work, because anonymous MutexGuards drop immediately. Fix this by naming the SIGUSR2_MTX MutexGuards. Fixes #251
2017-07-18Merge #680bors[bot]
680: Fix some bugs in the termios tests r=asomers * Make test_tcgetattr deterministic. The old version behaved differently depending on what file descriptors were opened by the harness or by other tests, and could race against other tests. * Close some file descriptor leaks Fixes #154
2017-07-17Fix some bugs in the termios testsAlan Somers
* Make test_tcgetattr deterministic. The old version behaved differently depending on what file descriptors were opened by the harness or by other tests, and could race against other tests. * Close some file descriptor leaks Fixes #154
2017-07-17Improve OpenptyResult documentationAlan Somers
2017-07-17Refactor ptrace_get_dataBryant Mairs
The boxing and unboxing was unnecessary and instead the references to the type on the stack can just be cast.
2017-07-17Fix UnsupportedOperation when using ptrace_* functionsBryant Mairs
2017-07-16Don't fork in test_mq_send_receiveAlan Somers
It isn't necessary, and can cause deadlocks in Rust's test harness
2017-07-16Fix thread safety issues in aio, chdir, and wait testsAlan Somers
They have four problems: * The chdir tests change the process's cwd, which is global. Protect them all with a mutex. * The wait tests will reap any subprocess, and several tests create subprocesses. Protect them all with a mutex so only one subprocess-creating test will run at a time. * When a multithreaded test forks, the child process can sometimes block in the stack unwinding code. It blocks on a mutex that was held by a different thread in the parent, but that thread doesn't exist in the child, so a deadlock results. Fix this by immediately calling std::process:exit in the child processes. * My previous attempt at thread safety in the aio tests didn't work, because anonymous MutexGuards drop immediately. Fix this by naming the SIGUSR2_MTX MutexGuards. Fixes #251
2017-07-16Merge #677bors[bot]
677: PtyMaster::drop should panic on EBADF r=asomers Fixes #659
2017-07-15PtyMaster::drop should panic on EBADFAlan Somers
Also, document the double-close risk with unistd::close Fixes #659
2017-07-15Merge #630bors[bot]
630: Add wrappers for sysconf(3), pathconf(2), and fpathconf(2) r=asomers
2017-07-15Add sysconf(3), pathconf(2), and fpathconf(2)Alan Somers
2017-07-14Merge #674bors[bot]
674: Make Travis faster r=Susurrus * Remove sudo: required * Remove rust=beta build on OSX * Remove rust=nightly builds
2017-07-13Make Travis fasterAlan Somers
* Remove sudo: required * Remove rust=beta build on OSX * Remove rust=nightly builds
2017-07-11Merge #527bors[bot]
527: Add cfmakeraw/cfsetspeed r=asomers We'll see how this tests on other platforms, but it's supported on BSDs and Linux supposedly.
2017-07-10Update changelog for termios PRBryant Mairs
2017-07-10Cleanup the changelogBryant Mairs
2017-07-10Alphabetize Tier 1 supported platformsBryant Mairs
2017-07-10Enable termios on iOS and move it to Tier 2Bryant Mairs
2017-07-10Add tcgetsid()Bryant Mairs
2017-07-10Add cfmakeraw and cfsetspeedBryant Mairs
2017-07-10Use libc types for termiosBryant Mairs
This also removes the incorrect TCSASOFT definition as an enum type because it's actually a bitfield.
2017-07-10Add a libc_enum! macroBryant Mairs
This reduces the boilerplate necessary when wrapping libc constants into groups via enums
2017-07-11Merge #623bors[bot]
623: Fix sendmsg on macOS when passing a zero entry cmsgs array. r=Susurrus On macOS, trying to call `sendmsg` with a zero entry cmsgs buffer, e.g.: sendmsg(fd, [IoVec::from_slice(buf)], &[], MsgFlags::empty(), None) ...fails with `EINVAL`. This occurs due to the pointer value for zero capacity `Vec`s being 0x1 rather than 0x0, to distinguish allocated-but-zero-size from nullptr. The [kernel validates](https://github.com/opensource-apple/xnu/blob/dc0628e187c3148723505cf1f1d35bb948d3195b/bsd/kern/uipc_syscalls.c#L1304) both the `msghdr.msg_control` and `msghdr.msg_controllen` fields and rejects `msghdr.msg_control == 0x1` as invalid. This doesn't show up on Linux because the [kernel validates](https://github.com/torvalds/linux/blob/9705596d08ac87c18aee32cc97f2783b7d14624e/net/core/scm.c#L139) `msghdr.msg_controllen` first and ignores the value of `msghdr.msg_control` if the length was 0.
2017-07-10Fix sendmsg on macOS when passing a zero entry cmsgs array.Matthew Gregan
2017-07-10Simplify Vec allocation in sendmsg after 077d979a removed alignment hacks.Matthew Gregan
2017-07-09Merge #660bors[bot]
660: Fix double close bugs in test_lseek and test_lseek64 r=asomers std::fs::File closes the underlying file descriptor on Drop, without checking for errors. test_lseek and test_lseek64 also manually close the file descriptor. That works for single threaded test runs. But for multithreaded runs, it causes EBADF errors in other tests. Fix the tests by consuming the File with into_raw_fd(), so its drop method will never be called.
2017-07-09Fix double close bugs in test_lseek and test_lseek64Alan Somers
std::fs::File closes the underlying file descriptor on Drop, without checking for errors. test_lseek and test_lseek64 also manually close the file descriptor. That works for single threaded test runs. But for multithreaded runs, it causes EBADF errors in other tests. Fix the tests by consuming the File with into_raw_fd(), so its drop method will never be called. Also, fix a potential short read bug in the same tests.