| 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 TIOCLINUX 2const 2026-02-08 "Linux man-pages 6.18" |
| 10 |
.SH NAME |
| 11 |
TIOCLINUX |
| 12 |
\- |
| 13 |
ioctls for console terminal and virtual consoles |
| 14 |
.SH SYNOPSIS |
| 15 |
.nf |
| 16 |
.BR "#include <linux/tiocl.h>" " /* Definition of " TIOCL_* " constants */" |
| 17 |
.B #include <sys/ioctl.h> |
| 18 |
.P |
| 19 |
.BI "int ioctl(int " fd ", TIOCLINUX, void *" argp ); |
| 20 |
.fi |
| 21 |
.SH DESCRIPTION |
| 22 |
The action of the following ioctls depends on the first byte in the struct |
| 23 |
pointed to by |
| 24 |
.IR argp , |
| 25 |
referred to here as the |
| 26 |
.IR subcode . |
| 27 |
These are legal only for the superuser or the owner of the current terminal. |
| 28 |
.TP |
| 29 |
.BR subcode = 0 |
| 30 |
Dump the screen. |
| 31 |
Disappeared in Linux 1.1.92. |
| 32 |
(With Linux 1.1.92 or later, read from |
| 33 |
.IR /dev/vcs N |
| 34 |
or |
| 35 |
.IR /dev/vcsa N |
| 36 |
instead.) |
| 37 |
.TP |
| 38 |
.BR subcode = 1 |
| 39 |
Get task information. |
| 40 |
Disappeared in Linux 1.1.92. |
| 41 |
.TP |
| 42 |
.BR subcode = TIOCL_SETSEL |
| 43 |
Set selection. |
| 44 |
.I argp |
| 45 |
points to a |
| 46 |
.IP |
| 47 |
.in +4n |
| 48 |
.EX |
| 49 |
struct { |
| 50 |
char subcode; |
| 51 |
short xs, ys, xe, ye; |
| 52 |
short sel_mode; |
| 53 |
}; |
| 54 |
.EE |
| 55 |
.in |
| 56 |
.IP |
| 57 |
.I xs |
| 58 |
and |
| 59 |
.I ys |
| 60 |
are the starting column and row. |
| 61 |
.I xe |
| 62 |
and |
| 63 |
.I ye |
| 64 |
are the ending |
| 65 |
column and row. |
| 66 |
(Upper left corner is row=column=1.) |
| 67 |
.I sel_mode |
| 68 |
may be one of the following operations: |
| 69 |
.RS |
| 70 |
.TP |
| 71 |
.B TIOCL_SELCHAR |
| 72 |
Select character-by-character. |
| 73 |
The indicated screen characters are highlighted |
| 74 |
and saved in a kernel buffer. |
| 75 |
.IP |
| 76 |
Since Linux 6.7, using this selection mode requires the |
| 77 |
.B CAP_SYS_ADMIN |
| 78 |
capability. |
| 79 |
.TP |
| 80 |
.B TIOCL_SELWORD |
| 81 |
Select word-by-word, |
| 82 |
expanding the selection outwards to align with word boundaries. |
| 83 |
The indicated screen characters are highlighted |
| 84 |
and saved in a kernel buffer. |
| 85 |
.IP |
| 86 |
Since Linux 6.7, using this selection mode requires the |
| 87 |
.B CAP_SYS_ADMIN |
| 88 |
capability. |
| 89 |
.TP |
| 90 |
.B TIOCL_SELLINE |
| 91 |
Select line-by-line, |
| 92 |
expanding the selection outwards to select full lines. |
| 93 |
The indicated screen characters are highlighted |
| 94 |
and saved in a kernel buffer. |
| 95 |
.IP |
| 96 |
Since Linux 6.7, using this selection mode requires the |
| 97 |
.B CAP_SYS_ADMIN |
| 98 |
capability. |
| 99 |
.TP |
| 100 |
.B TIOCL_SELPOINTER |
| 101 |
Show the pointer at position |
| 102 |
.RI ( xs ,\~ ys ) |
| 103 |
or |
| 104 |
.RI ( xe ,\~ ye ), |
| 105 |
whichever is later in text flow order. |
| 106 |
.TP |
| 107 |
.B TIOCL_SELCLEAR |
| 108 |
Remove the current selection highlight, if any, |
| 109 |
from the console holding the selection. |
| 110 |
.IP |
| 111 |
This does not affect the stored selected text. |
| 112 |
.TP |
| 113 |
.B TIOCL_SELMOUSEREPORT |
| 114 |
Make the terminal report |
| 115 |
.RI ( xs ,\~ ys ) |
| 116 |
as the current mouse location |
| 117 |
using the |
| 118 |
.BR xterm (1) |
| 119 |
mouse tracking protocol |
| 120 |
(see |
| 121 |
.BR console_codes (4)). |
| 122 |
The lower 4 bits of |
| 123 |
.I sel_mode |
| 124 |
.RB ( TIOCL_SELBUTTONMASK ) |
| 125 |
indicate the desired button press and |
| 126 |
modifier key information for the mouse event. |
| 127 |
.\" <https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Normal-tracking-mode> |
| 128 |
.IP |
| 129 |
If mouse reporting is not enabled for the terminal, |
| 130 |
this operation yields an |
| 131 |
.B EINVAL |
| 132 |
error. |
| 133 |
.IP |
| 134 |
Since Linux 6.7, using this selection mode requires the |
| 135 |
.B CAP_SYS_ADMIN |
| 136 |
capability. |
| 137 |
.RE |
| 138 |
.TP |
| 139 |
.BR subcode = TIOCL_PASTESEL |
| 140 |
Paste selection. |
| 141 |
The characters in the selection buffer are |
| 142 |
written to |
| 143 |
.IR fd . |
| 144 |
.IP |
| 145 |
Since Linux 6.7, using this subcode requires the |
| 146 |
.B CAP_SYS_ADMIN |
| 147 |
capability. |
| 148 |
.TP |
| 149 |
.BR subcode = TIOCL_UNBLANKSCREEN |
| 150 |
Unblank the screen. |
| 151 |
.TP |
| 152 |
.BR subcode = TIOCL_SELLOADLUT |
| 153 |
Sets contents of a 256-bit look up table defining characters in a "word", |
| 154 |
for word-by-word selection. |
| 155 |
(Since Linux 1.1.32.) |
| 156 |
.IP |
| 157 |
Since Linux 6.7, using this subcode requires the |
| 158 |
.B CAP_SYS_ADMIN |
| 159 |
capability. |
| 160 |
.TP |
| 161 |
.BR subcode = TIOCL_GETSHIFTSTATE |
| 162 |
.I argp |
| 163 |
points to a char which is set to the value of the kernel |
| 164 |
variable |
| 165 |
.IR shift_state . |
| 166 |
(Since Linux 1.1.32.) |
| 167 |
.TP |
| 168 |
.BR subcode = TIOCL_GETMOUSEREPORTING |
| 169 |
.I argp |
| 170 |
points to a char which is set to the value of the kernel |
| 171 |
variable |
| 172 |
.IR report_mouse . |
| 173 |
(Since Linux 1.1.33.) |
| 174 |
.TP |
| 175 |
.BR subcode = 8 |
| 176 |
Dump screen width and height, cursor position, and all the |
| 177 |
character-attribute pairs. |
| 178 |
(Linux 1.1.67 through Linux 1.1.91 only. |
| 179 |
With Linux 1.1.92 or later, read from |
| 180 |
.I /dev/vcsa* |
| 181 |
instead.) |
| 182 |
.TP |
| 183 |
.BR subcode = 9 |
| 184 |
Restore screen width and height, cursor position, and all the |
| 185 |
character-attribute pairs. |
| 186 |
(Linux 1.1.67 through Linux 1.1.91 only. |
| 187 |
With Linux 1.1.92 or later, write to |
| 188 |
.I /dev/vcsa* |
| 189 |
instead.) |
| 190 |
.TP |
| 191 |
.BR subcode = TIOCL_SETVESABLANK |
| 192 |
Handles the Power Saving |
| 193 |
feature of the new generation of monitors. |
| 194 |
VESA screen blanking mode is set to |
| 195 |
.IR argp[1] , |
| 196 |
which governs what |
| 197 |
screen blanking does: |
| 198 |
.RS |
| 199 |
.TP |
| 200 |
.B 0 |
| 201 |
Screen blanking is disabled. |
| 202 |
.TP |
| 203 |
.B 1 |
| 204 |
The current video adapter |
| 205 |
register settings are saved, then the controller is programmed to turn off |
| 206 |
the vertical synchronization pulses. |
| 207 |
This puts the monitor into "standby" mode. |
| 208 |
If your monitor has an Off_Mode timer, then |
| 209 |
it will eventually power down by itself. |
| 210 |
.TP |
| 211 |
.B 2 |
| 212 |
The current settings are saved, then both the vertical and horizontal |
| 213 |
synchronization pulses are turned off. |
| 214 |
This puts the monitor into "off" mode. |
| 215 |
If your monitor has no Off_Mode timer, |
| 216 |
or if you want your monitor to power down immediately when the |
| 217 |
blank_timer times out, then you choose this option. |
| 218 |
.RI ( Caution: |
| 219 |
Powering down frequently will damage the monitor.) |
| 220 |
(Since Linux 1.1.76.) |
| 221 |
.RE |
| 222 |
.TP |
| 223 |
.BR subcode = TIOCL_SETKMSGREDIRECT |
| 224 |
Change target of kernel messages ("console"): |
| 225 |
by default, and if this is set to |
| 226 |
.BR 0 , |
| 227 |
messages are written to the currently active VT. |
| 228 |
The VT to write to is a single byte following |
| 229 |
.BR subcode . |
| 230 |
(Since Linux 2.5.36.) |
| 231 |
.TP |
| 232 |
.BR subcode = TIOCL_GETFGCONSOLE |
| 233 |
Returns the number of VT currently in foreground. |
| 234 |
(Since Linux 2.5.36.) |
| 235 |
.TP |
| 236 |
.BR subcode = TIOCL_SCROLLCONSOLE |
| 237 |
Scroll the foreground VT by the specified amount of |
| 238 |
.I lines |
| 239 |
down, |
| 240 |
or half the screen if |
| 241 |
.BR 0 . |
| 242 |
.I lines |
| 243 |
is *(((int32_t *)&subcode) + 1). |
| 244 |
(Since Linux 2.5.67.) |
| 245 |
.TP |
| 246 |
.BR subcode = TIOCL_BLANKSCREEN |
| 247 |
Blank the foreground VT, ignoring "pokes" (typing): |
| 248 |
can only be unblanked explicitly (by switching VTs, to text mode, etc.). |
| 249 |
(Since Linux 2.5.71.) |
| 250 |
.TP |
| 251 |
.BR subcode = TIOCL_BLANKEDSCREEN |
| 252 |
Returns the number of VT currently blanked, |
| 253 |
.B 0 |
| 254 |
if none. |
| 255 |
(Since Linux 2.5.71.) |
| 256 |
.TP |
| 257 |
.BR subcode = 16 |
| 258 |
Never used. |
| 259 |
.TP |
| 260 |
.BR subcode = TIOCL_GETKMSGREDIRECT |
| 261 |
Returns target of kernel messages. |
| 262 |
(Since Linux 2.6.17.) |
| 263 |
.TP |
| 264 |
.BR subcode = TIOCL_GETBRACKETEDPASTE |
| 265 |
Returns |
| 266 |
.B 1 |
| 267 |
if the application advertised bracketed paste compatibility to the terminal, |
| 268 |
.B 0 |
| 269 |
otherwise. |
| 270 |
(Since Linux 6.16.) |
| 271 |
.SH RETURN VALUE |
| 272 |
On success, 0 is returned (except where indicated). |
| 273 |
On failure, \-1 is returned, and |
| 274 |
.I errno |
| 275 |
is set to indicate the error. |
| 276 |
.SH ERRORS |
| 277 |
.TP |
| 278 |
.B EINVAL |
| 279 |
.I argp |
| 280 |
is invalid. |
| 281 |
.TP |
| 282 |
.B EPERM |
| 283 |
Insufficient permission. |
| 284 |
.SH STANDARDS |
| 285 |
Linux. |
| 286 |
.SH SEE ALSO |
| 287 |
.BR ioctl (2), |
| 288 |
.BR ioctl_console (2) |