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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.006s · 17.8MB
glibcpy 3.10–3.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}")
Errors
Common errors & fixes
ImportError: No module named 'ioctl-opt'
Using hyphen in import statement instead of underscore.
fixChange 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.
fixCheck 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.