Registry / networking / ioctl-sys

ioctl-sys

JSON →
library0.8.0rscratesunverified

Provides the core ioctl function and macros for POSIX systems, with many ioctl definitions available in the `ioctls` crate.

# Cargo.toml [dependencies] ioctl-sys = "0.8.0"
INSTALL
IMPORT
SIG · IOCTL-SYS
I
ioctl-sys
networkingrustv0.8.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

ioctl
use ioctl_sys::ioctl;

Calls ioctl to get terminal window size.

use ioctl_sys::ioctl; fn main() { // Example: get terminal window size (TIOCGWINSZ) let fd = 0; // stdin let request = 0x5413; // TIOCGWINSZ let mut winsize: [u16; 4] = [0; 4]; unsafe { ioctl(fd, request, &mut winsize as *mut _ as *mut std::ffi::c_void); } println!("Rows: {}, Cols: {}", winsize[0], winsize[1]); }
Debug
Known issues
gotchaThe ioctl function is unsafe and requires careful handling of raw pointers and file descriptors.
fix
Ensure correct request constants and valid pointers; consider using higher-level wrappers.
affects: >=0.8.0
Upgrade
Version history
0.8.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
ioctl-sys — cargo add ioctl-sys · libregistry