ioctl_console(2)
π ioctl_console(2) β the console ioctl situation, bestie
okay so this lives in the System Calls Manual section (section 2, the syscall girlies) and it's about ioctl stuff for console terminals and virtual consoles. Linux-specific. No cap. Let's get into it π«Ά
πΈ NAME πΈ
ioctl_console β the ioctls for console terminals and virtual consoles π
β¨ SYNOPSIS β¨
#include <sys/ioctl.h>
int ioctl(int fd, unsigned long op, ...);
π DESCRIPTION π
So the following Linux-specific ioctl(2) operations are supported for console terminals and virtual consoles. That's the whole vibe. Here's the roster π
the kd crew (aka the ones you go read ioctl_kd(2) for)
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)
See ioctl_kd(2). like, all of them. go there. π
π¦ the solo one
π the VT squad
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)
See ioctl_vt(2). same energy, different file. β¨
π RETURN VALUE π
On success, 0 comes back at you (except where indicated β sometimes it's different, pay attention bestie). On failure, -1 returns and errno gets set to tell you what went wrong. as it should. π
π STANDARDS π
Linux. that's it, that's the standard. periodt. πΈ
π CAVEATS π
okay this is the part where I hold your hand because it MATTERS.
Do not treat this man page as documentation of the Linux console ioctls. This is here for the curious only β it's an alternative to just going and reading the source. Ioctls are undocumented Linux internals, and they are liable to be changed without warning. (And fr fr, 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. so like, yikes.)
Also β and this is the tea β very often ioctls get introduced for communication between the kernel and one particular well-known program (fdisk, hdparm, setserial, tunelp, loadkeys, selection, setfont, etc.), and their behavior will be changed whenever that particular program requires it. so the ioctl answers to its favorite child, not to you. π€‘
π₯ 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 thing, bestie β¨ this was Linux man-pages 6.20, dated 2026-07-02. go forth and ioctl responsibly, mwah π
ππ
π¦ 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