GENERAL IOCTL FORMAT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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.h struct
  • liveupdate_ioctl_create_session(9), struct
  • liveupdate_ioctl_retrieve_session(9), struct
  • liveupdate_session_preserve_fd(9), struct
  • liveupdate_session_retrieve_fd(9), struct
  • liveupdate_session_finish(9), struct
  • liveupdate_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