Age | Commit message (Collapse) | Author |
|
The file documenting ioctl number assignment in the Linux kernel has been converted to ReStructuredText (see https://lwn.net/Articles/705224/ for some background), the file extension has naturally changed.
|
|
This will allow users of the 2018 edition to import the macros without
needing to also import their helpers.
|
|
|
|
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.
|
|
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
|
|
* 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
|
|
|
|
cc #664 (unsure if this is everything needed)
|
|
|
|
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.
|
|
|
|
This also means that we need to properly mask off bits to the valid range
of ioctl numbers.
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This PR fixes the issue upstream https://github.com/rust-lang/rust/pull/26809
but no version 0.2.0 of the crate has been published as of yet.
Signed-off-by: Paul Osborne <osbpau@gmail.com>
|
|
|
|
|
|
This is more type-safe. Also, the old code wasn't cross-platform at all even
though it claimed to be. It wasn't even portable across architectures on
Linux.
|