{"id":59613,"library":"ioctl-sys","title":"ioctl-sys","description":"Provides the core ioctl function and macros for POSIX systems, with many ioctl definitions available in the `ioctls` crate.","status":"active","version":"0.8.0","language":"rust","source_language":null,"source_url":"https://github.com/jmesmon/ioctl","tags":["ioctl","posix","system","unsafe"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\nioctl-sys = \"0.8.0\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add ioctl-sys","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"ioctl","correct":"use ioctl_sys::ioctl;"}],"quickstart":{"code":"use ioctl_sys::ioctl;\n\nfn main() {\n    // Example: get terminal window size (TIOCGWINSZ)\n    let fd = 0; // stdin\n    let request = 0x5413; // TIOCGWINSZ\n    let mut winsize: [u16; 4] = [0; 4];\n    unsafe {\n        ioctl(fd, request, &mut winsize as *mut _ as *mut std::ffi::c_void);\n    }\n    println!(\"Rows: {}, Cols: {}\", winsize[0], winsize[1]);\n}","lang":"rust","description":"Calls ioctl to get terminal window size."},"warnings":[{"fix":"Ensure correct request constants and valid pointers; consider using higher-level wrappers.","message":"The ioctl function is unsafe and requires careful handling of raw pointers and file descriptors.","severity":"gotcha","affected_versions":">=0.8.0"}],"env_vars":null,"search_vec":"'avail':18 'core':6 'crate':22 'definit':17 'function':8 'ioctl':2,7,16,21,23 'ioctl-si':1 'macro':10 'mani':15 'posix':12,24 'provid':4 'sys':3 'system':13,25 'unsaf':26","created_at":"2026-06-16T17:10:39.182649+00:00","updated_at":"2026-06-16T17:10:39.182649+00:00","problems":[],"ecosystem":"crates","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/jmesmon/ioctl","github":"https://github.com/jmesmon/ioctl","docs":"https://docs.rs/ioctl-sys/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["networking","other"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-16","next_check":"2026-12-13","install_tag":null}}