Registry / http-networking / ioctl-opt

ioctl-opt

JSON →
library1.3.1pypypi✓ verified 84d ago

A library providing functions to compute the opt argument for fcntl.ioctl. It helps encode ioctl request codes, supporting type, number, direction, and size. Current version: 1.3.1. Release cadence: infrequent, as needed.

pip install ioctl-opt
INSTALL
IMPORT
SIG · IOCTL-OPT
I
ioctl-opt
http-networkingpythonv1.3.1
Install
1.8s avg
Import
15ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.3.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.006s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.8s · import 0.018s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

IOC
from ioctl_opt import IOC
Correct import path uses underscore.
IOR
from ioctl_opt import IOR
Correct import for reading ioctl.
IOW
from ioctl_opt import IOW
Correct import for writing ioctl.
IOWR
from ioctl_opt import IOWR
Correct import for read-write ioctl.

Basic usage: compute ioctl request codes for fcntl.ioctl.

from ioctl_opt import IOC, IOR, IOW, IOWR # Define ioctl numbers type_num = ord('t') # example 't' number = 1 size = 256 # Create ioctl request codes read_ioctl = IOR(type_num, number, size) write_ioctl = IOW(type_num, number, size) rdwr_ioctl = IOWR(type_num, number, size) custom = IOC(0, type_num, number, size) # direction 0 (none) print(f"IOR: {read_ioctl:#x}") print(f"IOW: {write_ioctl:#x}") print(f"IOWR: {rdwr_ioctl:#x}")
Debug
Known issues
gotchaThe library name on PyPI is 'ioctl-opt', but the Python import path uses an underscore: 'ioctl_opt'. Many users mistakenly try 'import ioctl_opt' as 'import ioctl-opt', which fails.
fix
Use 'from ioctl_opt import ...' not 'import ioctl-opt'.
affects: all
deprecatedThe function 'IOC' with direction argument may be deprecated in future versions; prefer using IOR, IOW, IOWR for clear direction.
fix
Use IOR, IOW, IOWR for read, write, read-write respectively.
affects: <=1.3.1
Errors
Common errors & fixes
ImportError: No module named 'ioctl-opt'
Using hyphen in import statement instead of underscore.
fix
Change import to 'from ioctl_opt import ...'.
TypeError: IOC() missing 2 required positional arguments: 'size' and 'number'
Incorrect number of arguments passed to IOC or incorrect function signature understanding.
fix
Check documentation: IOC(direction, type, number, size). Use IOR/IOW/IOWR for simpler signatures.
Upgrade
Version history
1.3.1latest on PyPI · released Mar 2, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
ioctl-opt — pip install ioctl-opt · libregistry