| 1 |
.\" Copyright 1995, James R. Van Zandt <[email protected]> |
| 2 |
.\" Copyright 1995, Andries E. Brouwer <[email protected]> |
| 3 |
.\" Copyright 1995, Rickard E. Faith <[email protected]> |
| 4 |
.\" Copyright 1995, H. Peter Anvin <[email protected]> |
| 5 |
.\" Copyright, the authors of the Linux man-pages project |
| 6 |
.\" |
| 7 |
.\" SPDX-License-Identifier: GPL-2.0-or-later |
| 8 |
.\" |
| 9 |
.TH ioctl_console 2 2026-02-08 "Linux man-pages 6.18" |
| 10 |
.SH NAME |
| 11 |
ioctl_console \- ioctls for console terminal and virtual consoles |
| 12 |
.SH SYNOPSIS |
| 13 |
.nf |
| 14 |
.B #include <sys/ioctl.h> |
| 15 |
.P |
| 16 |
.BI "int ioctl(int " fd ", unsigned long " op ", ...);" |
| 17 |
.fi |
| 18 |
.SH DESCRIPTION |
| 19 |
The following Linux-specific |
| 20 |
.BR ioctl (2) |
| 21 |
operations are supported for console terminals and virtual consoles. |
| 22 |
.TP |
| 23 |
.BR KDGETLED (2const) |
| 24 |
.TQ |
| 25 |
.BR KDSETLED (2const) |
| 26 |
.TQ |
| 27 |
.BR KDGKBLED (2const) |
| 28 |
.TQ |
| 29 |
.BR KDSKBLED (2const) |
| 30 |
.TQ |
| 31 |
.BR KDGKBTYPE (2const) |
| 32 |
.TQ |
| 33 |
.BR KDADDIO (2const) |
| 34 |
.TQ |
| 35 |
.BR KDDELIO (2const) |
| 36 |
.TQ |
| 37 |
.BR KDENABIO (2const) |
| 38 |
.TQ |
| 39 |
.BR KDDISABIO (2const) |
| 40 |
.TQ |
| 41 |
.BR KDSETMODE (2const) |
| 42 |
.TQ |
| 43 |
.BR KDGETMODE (2const) |
| 44 |
.TQ |
| 45 |
.BR KDMKTONE (2const) |
| 46 |
.TQ |
| 47 |
.BR KIOCSOUND (2const) |
| 48 |
.TQ |
| 49 |
.BR GIO_CMAP (2const) |
| 50 |
.TQ |
| 51 |
.BR PIO_CMAP (2const) |
| 52 |
.TQ |
| 53 |
.BR GIO_FONT (2const) |
| 54 |
.TQ |
| 55 |
.BR GIO_FONTX (2const) |
| 56 |
.TQ |
| 57 |
.BR PIO_FONT (2const) |
| 58 |
.TQ |
| 59 |
.BR PIO_FONTX (2const) |
| 60 |
.TQ |
| 61 |
.BR PIO_FONTRESET (2const) |
| 62 |
.TQ |
| 63 |
.BR GIO_SCRNMAP (2const) |
| 64 |
.TQ |
| 65 |
.BR GIO_UNISCRNMAP (2const) |
| 66 |
.TQ |
| 67 |
.BR PIO_SCRNMAP (2const) |
| 68 |
.TQ |
| 69 |
.BR PIO_UNISCRNMAP (2const) |
| 70 |
.TQ |
| 71 |
.BR GIO_UNIMAP (2const) |
| 72 |
.TQ |
| 73 |
.BR PIO_UNIMAP (2const) |
| 74 |
.TQ |
| 75 |
.BR PIO_UNIMAPCLR (2const) |
| 76 |
.TQ |
| 77 |
.BR KDGKBMODE (2const) |
| 78 |
.TQ |
| 79 |
.BR KDSKBMODE (2const) |
| 80 |
.TQ |
| 81 |
.BR KDGKBMETA (2const) |
| 82 |
.TQ |
| 83 |
.BR KDSKBMETA (2const) |
| 84 |
.TQ |
| 85 |
.BR KDGKBENT (2const) |
| 86 |
.TQ |
| 87 |
.BR KDSKBENT (2const) |
| 88 |
.TQ |
| 89 |
.BR KDGKBSENT (2const) |
| 90 |
.TQ |
| 91 |
.BR KDSKBSENT (2const) |
| 92 |
.TQ |
| 93 |
.BR KDGKBDIACR (2const) |
| 94 |
.TQ |
| 95 |
.BR KDGETKEYCODE (2const) |
| 96 |
.TQ |
| 97 |
.BR KDSETKEYCODE (2const) |
| 98 |
.TQ |
| 99 |
.BR KDSIGACCEPT (2const) |
| 100 |
See |
| 101 |
.BR ioctl_kd (2). |
| 102 |
.TP |
| 103 |
.BR TIOCLINUX (2const) |
| 104 |
.TP |
| 105 |
.BR VT_OPENQRY (2const) |
| 106 |
.TQ |
| 107 |
.BR VT_GETMODE (2const) |
| 108 |
.TQ |
| 109 |
.BR VT_SETMODE (2const) |
| 110 |
.TQ |
| 111 |
.BR VT_GETSTATE (2const) |
| 112 |
.TQ |
| 113 |
.BR VT_RELDISP (2const) |
| 114 |
.TQ |
| 115 |
.BR VT_ACTIVATE (2const) |
| 116 |
.TQ |
| 117 |
.BR VT_WAITACTIVE (2const) |
| 118 |
.TQ |
| 119 |
.BR VT_DISALLOCATE (2const) |
| 120 |
.TQ |
| 121 |
.BR VT_RESIZE (2const) |
| 122 |
.TQ |
| 123 |
.BR VT_RESIZEX (2const) |
| 124 |
See |
| 125 |
.BR ioctl_vt (2). |
| 126 |
.SH RETURN VALUE |
| 127 |
On success, 0 is returned (except where indicated). |
| 128 |
On failure, \-1 is returned, and |
| 129 |
.I errno |
| 130 |
is set to indicate the error. |
| 131 |
.SH STANDARDS |
| 132 |
Linux. |
| 133 |
.SH CAVEATS |
| 134 |
Do not regard this man page as documentation of the Linux console ioctls. |
| 135 |
This is provided for the curious only, as an alternative to reading the |
| 136 |
source. |
| 137 |
Ioctl's are undocumented Linux internals, liable to be changed |
| 138 |
without warning. |
| 139 |
(And indeed, this page more or less describes the |
| 140 |
situation as of kernel version 1.1.94; |
| 141 |
there are many minor and not-so-minor |
| 142 |
differences with earlier versions.) |
| 143 |
.P |
| 144 |
Very often, ioctls are introduced for communication between the |
| 145 |
kernel and one particular well-known program (fdisk, hdparm, setserial, |
| 146 |
tunelp, loadkeys, selection, setfont, etc.), and their behavior will be |
| 147 |
changed when required by this particular program. |
| 148 |
.SH SEE ALSO |
| 149 |
.BR ioctl (2), |
| 150 |
.BR TIOCLINUX (2const), |
| 151 |
.BR ioctl_kd (2), |
| 152 |
.BR ioctl_vt (2), |
| 153 |
.BR dumpkeys (1), |
| 154 |
.BR kbd_mode (1), |
| 155 |
.BR loadkeys (1), |
| 156 |
.BR mknod (1), |
| 157 |
.BR setleds (1), |
| 158 |
.BR setmetamode (1), |
| 159 |
.BR execve (2), |
| 160 |
.BR fcntl (2), |
| 161 |
.BR ioctl_tty (2), |
| 162 |
.BR ioperm (2), |
| 163 |
.BR termios (3), |
| 164 |
.BR console_codes (4), |
| 165 |
.BR mt (4), |
| 166 |
.BR sd (4), |
| 167 |
.BR tty (4), |
| 168 |
.BR ttyS (4), |
| 169 |
.BR vcs (4), |
| 170 |
.BR vcsa (4), |
| 171 |
.BR charsets (7), |
| 172 |
.BR mapscrn (8), |
| 173 |
.BR resizecons (8), |
| 174 |
.BR setfont (8) |