Trait kernel::file::IoctlHandler
source · [−]pub trait IoctlHandler: Sync {
type Target<'a>;
fn pure(
_this: Self::Target<'_>,
_file: &File,
_cmd: u32,
_arg: usize
) -> Result<i32> { ... }
fn read(
_this: Self::Target<'_>,
_file: &File,
_cmd: u32,
_writer: &mut UserSlicePtrWriter
) -> Result<i32> { ... }
fn write(
_this: Self::Target<'_>,
_file: &File,
_cmd: u32,
_reader: &mut UserSlicePtrReader
) -> Result<i32> { ... }
fn read_write(
_this: Self::Target<'_>,
_file: &File,
_cmd: u32,
_data: UserSlicePtr
) -> Result<i32> { ... }
}Expand description
Allows the handling of ioctls defined with the _IO, _IOR, _IOW, and _IOWR macros.
For each macro, there is a handler function that takes the appropriate types as arguments.
Required Associated Types
Provided Methods
Handles ioctls defined with the _IO macro, that is, with no buffer as argument.
Handles ioctls defined with the _IOR macro, that is, with an output buffer provided as
argument.
Handles ioctls defined with the _IOW macro, that is, with an input buffer provided as
argument.
fn read_write(
_this: Self::Target<'_>,
_file: &File,
_cmd: u32,
_data: UserSlicePtr
) -> Result<i32>
fn read_write(
_this: Self::Target<'_>,
_file: &File,
_cmd: u32,
_data: UserSlicePtr
) -> Result<i32>
Handles ioctls defined with the _IOWR macro, that is, with a buffer for both input and
output provided as argument.