Age | Commit message (Collapse) | Author |
|
Instead of relying on the macro user to calculate the length in bytes
do that within the macro itself
|
|
|
|
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.
|
|
|
|
|
|
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
|
|
This also means that we need to properly mask off bits to the valid range
of ioctl numbers.
|
|
These are low-level functions that shouldn't be exposed
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
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()`
|
|
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.
|
|
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.
|
|
|
|
|
|
The boxing and unboxing was unnecessary and instead the references to the type on
the stack can just be cast.
|
|
|
|
|
|
|
|
|
|
This also removes the incorrect TCSASOFT definition as an enum type because it's
actually a bitfield.
|
|
|
|
|
|
624: Enable ptrace on all Linux platforms r=Susurrus
Nothing that nix currently binds is architecture-specific, and Android
supports ptrace just as much as non-Android Linux.
|
|
|
|
|
|
|
|
|
|
Nothing that nix currently binds is architecture-specific, and Android
supports ptrace just as much as non-Android Linux.
|
|
the previous definition were linux specific.
|
|
|
|
|
|
|
|
Newtypes for uid_t, gid_t and pid_t.
|
|
|
|
|
|
599: Support powerpc64 r=Susurrus
The test_ioctl values are computed using ioctl-test.c
|
|
The test_ioctl values are computed using ioctl-test.c
|
|
|
|
|
|
Some ptrace functions return structures through the data argument. This commit adds utilities to return data through this mechanism and function specialisations for a few of these functions (getting event messages or the siginfo_t struct). Once the next version of libc is released these utilities will be expanded to include the fpregs and user_regs structs.
Ptrace requests that are now satisfied by a more specific public function will return an unsupported operation error. This has involved adding an UnsupportedOperation to the nix::Error enum and removed the mapping from Error to Errno and from Error to std::io::Error.
|
|
|
|
* SigAction::flags()
* SigAction::mask()
* SigAction::handler()
|
|
|
|
|
|
The existing AioCb constructors work for simple programs where
everything is stored on the stack. But in more complicated programs the
borrow checker can't prove that a buffer will outlive the AioCb that
references it. Fix this problem by introducting
AioCb::from_boxed_slice, which takes a reference-counted buffer.
Fixes #575
|