linux

package
v0.12.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package linux contains definitions required for making a linux ioctl.

Index

Constants

View Source
const (
	IocWrite    = 1
	IocRead     = 2
	IocNRBits   = 8
	IocTypeBits = 8
	IocSizeBits = 14
	IocDirBits  = 2

	IocNRMask    = (1 << IocNRBits) - 1
	IocTypeMask  = (1 << IocTypeBits) - 1
	IocSizeMask  = (1 << IocSizeBits) - 1
	IocDirMask   = (1 << IocDirBits) - 1
	IocTypeShift = IocNRBits
	IocSizeShift = IocTypeShift + IocTypeBits
	IocDirShift  = IocSizeShift + IocSizeBits
	IocWRBase    = (IocRead | IocWrite) << IocDirShift
)

32 bits to describe an ioctl: 0-7: NR (command for a given ioctl type) 8-15: TYPE (ioctl type) 16-29: SIZE (payload size) 30-31: DIR (direction of ioctl, can be: none/write/read/write-read)

Variables

This section is empty.

Functions

func Ioctl

func Ioctl(f *os.File, command int, dataPtr unsafe.Pointer) error

Ioctl makes a syscall described by `command` with data `dataPtr` to device driver file `f`.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL