GENERAL IOCTL FORMAT(9)
π General ioctl format β¨
ok so this is the Kernel API Manual page for General ioctl format(9) and bestie, it's literally the blueprint for how every ioctl rolls. buckle up π
π¦ The whole vibe (aka DESCRIPTION)
The ioctl interface follows a general format to allow for extensibility β like, it's built so it can grow later without everything falling apart. slay.
Every single ioctl gets a structure pointer passed in as the argument, and the first u32 in that structure is the size of the structure. yes, always. the kernel then checks that any structure space beyond what it actually understands is 0. why? so userspace can chill in the backward compatible portion while still consistently using the newer, bigger, larger structures. it's giving "wear the new fit but keep the old shoes comfy" π«Ά
π Error codes, decoded (the standard meaning for common errnos)
ioctls use a standard meaning for these common errnos, so like, know them:
ENOTTYβ the IOCTL number itself is not supported at all. it literally doesn't exist to the kernel. πE2BIGβ ok so the IOCTL number is supported, but the structure you handed over has non-zero in a part the kernel does not understand. rude, but okay.EOPNOTSUPPβ the IOCTL number is supported and the structure is understood, however a known field has a value the kernel does not understand or support. it's not you, it's the field πEINVALβ everything about the IOCTL was understood, but a field is not correct. so close bestie πENOENTβ a provided token does not exist.ENOMEMβ out of memory. tragic.EOVERFLOWβ mathematics overflowed. the math ate too much π₯
ngl, there are also additional errnos within specific ioctls β so always read the individual ioctl's page too, iykyk π
πΈ SEE ALSO β¨
- Kernel file
./include/uapi/linux/liveupdate.hstruct liveupdate_ioctl_create_session(9), structliveupdate_ioctl_retrieve_session(9), structliveupdate_session_preserve_fd(9), structliveupdate_session_retrieve_fd(9), structliveupdate_session_finish(9), structliveupdate_session_get_name(9), struct
ok that's the whole page bestie, go forth and ioctl responsibly π
and like, a little sign-off because we're classy: this iconic piece of lore lives in ./include/uapi/linux, dated October 2026, and its full government name is General ioctl format(9). periodt π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms