Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface {
// Direction returns what the kernel does to the arg parameter for Do():
// Nothing, read, write or read and write.
Direction() Direction
// Type identifies a specific subsystem or driver.
Type() uintptr
// Number identifies the specific command and is unique for a
// given type.
Number() uintptr
// Size of the underlying type of the command arg parameter.
Size() uintptr
// Do executes the command on the given fd passing the given arg to the
// underlying ioctl call. The arg parameter must be a pointer type.
Do(fd uintptr, arg interface{}) error
}
Command is a higher level abstraction of a command definition that is also able to execute it.
func NewNoneCommand ¶
NewNoneCommand returns a Command that does not have any arguments.
func NewReadCommand ¶
NewReadCommand returns a Command that reads data from the kernel.
func NewReadWriteCommand ¶
NewReadWriteCommand returns a Command that both reads and writes (sends) data to the kernel.
func NewWriteCommand ¶
NewWriteCommand returns a Command that writes (sends) data to the kernel.
type Direction ¶
type Direction uintptr
const ( // DirectionNone means that the kernel does not read or write anything. DirectionNone Direction = 0 // DirectionRead means that the kernel reads data from the command arg // parameter. DirectionRead Direction = 1 // DirectionWrite means that the kernel writes data to the command arg // parameter. DirectionWrite Direction = 2 // DirectionReadWrite means that the kernel reads and writes data to the // command arg parameter. DirectionReadWrite Direction = 3 )
Click to show internal directories.
Click to hide internal directories.