ioctl_console(2)
π
ioctl_console β the manual page for ioctl_console(2)
okay bestie, welcome to the Linux System Calls Manual, section 2, where we talk about ioctl_console β the ioctls for console terminals and virtual consoles. yes it's real, yes it's niche, yes we're doing this together. grab a snack π
πΈ NAME πΈ
ioctl_console β bestie, it's the ioctls for the console terminal and virtual consoles β¨
π¦ SYNOPSIS π¦
#include <sys/ioctl.h>
int ioctl(int fd, unsigned long op, ...);
π DESCRIPTION π
So the vibes here are: these are the Linux-specific ioctl(2) operations that are supported for console terminals and virtual consoles. That's the whole plot. π«
The icons in this group all live over in ioctl_kd(2), and they are, in order:
KDGETLED(2const)KDSETLED(2const)KDGKBLED(2const)KDSKBLED(2const)KDGKBTYPE(2const)KDADDIO(2const)KDDELIO(2const)KDENABIO(2const)KDDISABIO(2const)KDSETMODE(2const)KDGETMODE(2const)KDMKTONE(2const)KIOCSOUND(2const)GIO_CMAP(2const)PIO_CMAP(2const)GIO_FONT(2const)GIO_FONTX(2const)PIO_FONT(2const)PIO_FONTX(2const)PIO_FONTRESET(2const)GIO_SCRNMAP(2const)GIO_UNISCRNMAP(2const)PIO_SCRNMAP(2const)PIO_UNISCRNMAP(2const)GIO_UNIMAP(2const)PIO_UNIMAP(2const)PIO_UNIMAPCLR(2const)KDGKBMODE(2const)KDSKBMODE(2const)KDGKBMETA(2const)KDSKBMETA(2const)KDGKBENT(2const)KDSKBENT(2const)KDGKBSENT(2const)KDSKBSENT(2const)KDGKBDIACR(2const)KDGETKEYCODE(2const)KDSETKEYCODE(2const)KDSIGACCEPT(2const)
β¦and the whole lil squad above? yeah, see ioctl_kd(2). π
Then, standing on its own with main character energy:
And then the VT crew, also in order, no cap:
VT_OPENQRY(2const)VT_GETMODE(2const)VT_SETMODE(2const)VT_GETSTATE(2const)VT_RELDISP(2const)VT_ACTIVATE(2const)VT_WAITACTIVE(2const)VT_DISALLOCATE(2const)VT_RESIZE(2const)VT_RESIZEX(2const)
β¦and for all of those, see ioctl_vt(2). π§
π RETURN VALUE π
- Slay: returns
0on success β except where indicated, so like, read the fine print bestie. - Not slay: returns
-1on failure, anderrnogets set to tell you what the error was. π
β STANDARDS β
Linux. that's it, that's the standard. π
π₯ CAVEATS π₯
Not me being the messenger here, but do not treat this man page as actual documentation of the Linux console ioctls. π
It's provided for the curious only β like, as an alternative to reading the source. Ioctls are undocumented Linux internals, and they are liable to be changed without warning. Fr fr. And honestly? This page more or less describes the situation as of kernel version 1.1.94 β there are many minor and not-so-minor differences with earlier versions. π
Also, super often, ioctls get introduced just for communication between the kernel and one particular well-known program β think fdisk, hdparm, setserial, tunelp, loadkeys, selection, setfont, etc. β and their behavior will be changed when that particular program requires it. So yeah. It's giving "custom-built for one guy". π«Ά
π SEE ALSO π
ioctl(2), TIOCLINUX(2const), ioctl_kd(2), ioctl_vt(2), dumpkeys(1), kbd_mode(1), loadkeys(1), mknod(1), setleds(1), setmetamode(1), execve(2), fcntl(2), ioctl_tty(2), ioperm(2), console_codes(4), mt(4), sd(4), tty(4), ttyS(4), vcs(4), vcsa(4), charsets(7), termios(7), mapscrn(8), resizecons(8), setfont(8)
and that's the whole page bestie, love that for us π this cutie came from Linux man-pages 6.20, dated 2026-07-02. periodt. π
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: GPL-2.0-or-later
- Copyright 1995, James R. Van Zandt <jrv@vanzandt.mv.com>
- Copyright 1995, Andries E. Brouwer <aeb@cwi.nl>
- Copyright 1995, Rickard E. Faith <faith@cs.unc.edu>
- Copyright 1995, H. Peter Anvin <hpa@storm.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms