summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2017-08-01add SockProtocol type for third argument of socket and socketpairNicolas Dusart
2017-08-01Document `MsgFlags` constantsNicolas Dusart
2017-08-01add socket constants already present in libcNicolas Dusart
2017-08-01remove sys::sockets::consts module as it's libc goal to define themNicolas Dusart
2017-07-30Merge #672bors[bot]
672: add poll module in Android r=Susurrus `poll` functions are defined in Android as well. libc is missing some constant, but once rust-lang/libc#663 is merged, it'll be good to merge here. Closes #711
2017-07-30document poll moduleNicolas Dusart
2017-07-26add poll module for all platformsNicolas Dusart
2017-07-25Document invariants of fork and fix testsJonas Schievink
Some tests were invoking non-async-signal-safe functions from the child process after a `fork`. Since they might be invoked in parallel, this could lead to problems.
2017-07-25Allow doc attributes in ioctl macroroblabla
2017-07-25Document WaitStatus and its variantsGeoffrey Thomas
2017-07-25Add WaitStatus::PtraceSyscall for use with PTRACE_O_TRACESYSGOODGeoffrey Thomas
The recommended way to trace syscalls with ptrace is to set the PTRACE_O_TRACESYSGOOD option, to distinguish syscall stops from receiving an actual SIGTRAP. In C, this would cause WSTOPSIG to return SIGTRAP | 0x80, but nix wants to parse that as an actual signal. Add another wait status type for syscall stops (in the language of the ptrace(2) manpage, "PTRACE_EVENT stops" and "Syscall-stops" are different things), and mask out bit 0x80 from signals before trying to parse it. Closes #550
2017-07-25Remove workaround for `pub extern crate`Jonas Schievink
On semi-recent Rust versions (I think 1.8+) this now works properly.
2017-07-25Refactor ioctl! for buffersBryant Mairs
Instead of relying on the macro user to calculate the length in bytes do that within the macro itself
2017-07-25Add 'bad' prefixes for read, write_*, and readwrite ioctlsBryant Mairs
2017-07-25Split ioctl!(write ...) into write_ptr and write_intBryant Mairs
There two different write semantics used with ioctls: one involves passing a pointer the other involves passing an int. Previously the ioctl! macro did not distinguish between these cases and left it up to the user to set the proper datatype. This previous version was not type safe and prone to errors. The solution here is to split the "write" variant into a "write_ptr" and "write_int" variant that makes the semantics more explicit and improves type safety by specifying arguments better.
2017-07-25Unify argument names to generated ioctl functionsBryant Mairs
2017-07-25Remove unnecessary constantsBryant Mairs
2017-07-25Remove 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-25Use 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-25Remove ioc_* functionsBryant Mairs
These are low-level functions that shouldn't be exposed
2017-07-25Revise 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-25Remove unnecessary path aliasingBryant Mairs
2017-07-25Hide internal macros/types within ioctlBryant Mairs
2017-07-25Add a "bad none" variant to the ioctl macroBryant Mairs
2017-07-25Re-add bad variant of ioctl!Bryant Mairs
2017-07-25Remove old workaroundBryant Mairs
2017-07-25Merge #694bors[bot]
694: Remove workaround for `pub extern crate` r=asomers On semi-recent Rust versions (I think 1.8+) this now works properly. Closes #655
2017-07-23Merge #661bors[bot]
661: Allow doc attributes in ioctl r=asomers fixes #571 . Note that this is a breaking change because it also changes ``` ioctl!(some_name with 12); ``` to ``` ioctl!(bad some_name with 12); ``` This is to work around a bug in the rust compiler whereby rules around matching idents are overly strict. See https://github.com/rust-lang/rust/issues/24189 It doesn't break anything else though.
2017-07-22Document invariants of fork and fix testsJonas Schievink
Some tests were invoking non-async-signal-safe functions from the child process after a `fork`. Since they might be invoked in parallel, this could lead to problems.
2017-07-21Allow doc attributes in ioctl macroroblabla
2017-07-21Document WaitStatus and its variantsGeoffrey Thomas
2017-07-21Add WaitStatus::PtraceSyscall for use with PTRACE_O_TRACESYSGOODGeoffrey Thomas
The recommended way to trace syscalls with ptrace is to set the PTRACE_O_TRACESYSGOOD option, to distinguish syscall stops from receiving an actual SIGTRAP. In C, this would cause WSTOPSIG to return SIGTRAP | 0x80, but nix wants to parse that as an actual signal. Add another wait status type for syscall stops (in the language of the ptrace(2) manpage, "PTRACE_EVENT stops" and "Syscall-stops" are different things), and mask out bit 0x80 from signals before trying to parse it. Closes #550
2017-07-20Remove workaround for `pub extern crate`Jonas Schievink
On semi-recent Rust versions (I think 1.8+) this now works properly.
2017-07-20Rename the public ptrace_* functions.Marcin Mielniczuk
Unlike in C, we have namespacing in Rust. Renaming the functions allows us to avoid a `use nix::sys::ptrace::*` in favor of `use nix::sys::ptrace` and then calling, for example, `ptrace::traceme()`
2017-07-19Refactor ioctl! for buffersBryant Mairs
Instead of relying on the macro user to calculate the length in bytes do that within the macro itself
2017-07-19Add 'bad' prefixes for read, write_*, and readwrite ioctlsBryant Mairs
2017-07-19Split ioctl!(write ...) into write_ptr and write_intBryant Mairs
There two different write semantics used with ioctls: one involves passing a pointer the other involves passing an int. Previously the ioctl! macro did not distinguish between these cases and left it up to the user to set the proper datatype. This previous version was not type safe and prone to errors. The solution here is to split the "write" variant into a "write_ptr" and "write_int" variant that makes the semantics more explicit and improves type safety by specifying arguments better.
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.