| 1 |
.\" Copyright 1995, Jim Van Zandt <[email protected]> and aeb |
| 2 |
.\" Copyright 1995, <[email protected]> |
| 3 |
.\" Copyright 1995, <[email protected]> |
| 4 |
.\" Copyright 1995, "H. Peter Anvin" <[email protected]> |
| 5 |
.\" Copyright 2024, Alejandro Colomar <[email protected]> |
| 6 |
.\" |
| 7 |
.\" SPDX-License-Identifier: GPL-2.0-or-later |
| 8 |
.\" |
| 9 |
.TH TIOCLINUX 2const 2024-06-13 "Linux man-pages 6.9.1" |
| 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 |
is 0 for character-by-character selection, |
| 69 |
1 for word-by-word selection, |
| 70 |
or 2 for line-by-line selection. |
| 71 |
The indicated screen characters are highlighted and saved |
| 72 |
in a kernel buffer. |
| 73 |
.IP |
| 74 |
Since Linux 6.7, using this subcode requires the |
| 75 |
.B CAP_SYS_ADMIN |
| 76 |
capability. |
| 77 |
.TP |
| 78 |
.BR subcode = TIOCL_PASTESEL |
| 79 |
Paste selection. |
| 80 |
The characters in the selection buffer are |
| 81 |
written to |
| 82 |
.IR fd . |
| 83 |
.IP |
| 84 |
Since Linux 6.7, using this subcode requires the |
| 85 |
.B CAP_SYS_ADMIN |
| 86 |
capability. |
| 87 |
.TP |
| 88 |
.BR subcode = TIOCL_UNBLANKSCREEN |
| 89 |
Unblank the screen. |
| 90 |
.TP |
| 91 |
.BR subcode = TIOCL_SELLOADLUT |
| 92 |
Sets contents of a 256-bit look up table defining characters in a "word", |
| 93 |
for word-by-word selection. |
| 94 |
(Since Linux 1.1.32.) |
| 95 |
.IP |
| 96 |
Since Linux 6.7, using this subcode requires the |
| 97 |
.B CAP_SYS_ADMIN |
| 98 |
capability. |
| 99 |
.TP |
| 100 |
.BR subcode = TIOCL_GETSHIFTSTATE |
| 101 |
.I argp |
| 102 |
points to a char which is set to the value of the kernel |
| 103 |
variable |
| 104 |
.IR shift_state . |
| 105 |
(Since Linux 1.1.32.) |
| 106 |
.TP |
| 107 |
.BR subcode = TIOCL_GETMOUSEREPORTING |
| 108 |
.I argp |
| 109 |
points to a char which is set to the value of the kernel |
| 110 |
variable |
| 111 |
.IR report_mouse . |
| 112 |
(Since Linux 1.1.33.) |
| 113 |
.TP |
| 114 |
.BR subcode = 8 |
| 115 |
Dump screen width and height, cursor position, and all the |
| 116 |
character-attribute pairs. |
| 117 |
(Linux 1.1.67 through Linux 1.1.91 only. |
| 118 |
With Linux 1.1.92 or later, read from |
| 119 |
.I /dev/vcsa* |
| 120 |
instead.) |
| 121 |
.TP |
| 122 |
.BR subcode = 9 |
| 123 |
Restore screen width and height, cursor position, and all the |
| 124 |
character-attribute pairs. |
| 125 |
(Linux 1.1.67 through Linux 1.1.91 only. |
| 126 |
With Linux 1.1.92 or later, write to |
| 127 |
.I /dev/vcsa* |
| 128 |
instead.) |
| 129 |
.TP |
| 130 |
.BR subcode = TIOCL_SETVESABLANK |
| 131 |
Handles the Power Saving |
| 132 |
feature of the new generation of monitors. |
| 133 |
VESA screen blanking mode is set to |
| 134 |
.IR argp[1] , |
| 135 |
which governs what |
| 136 |
screen blanking does: |
| 137 |
.RS |
| 138 |
.TP |
| 139 |
.B 0 |
| 140 |
Screen blanking is disabled. |
| 141 |
.TP |
| 142 |
.B 1 |
| 143 |
The current video adapter |
| 144 |
register settings are saved, then the controller is programmed to turn off |
| 145 |
the vertical synchronization pulses. |
| 146 |
This puts the monitor into "standby" mode. |
| 147 |
If your monitor has an Off_Mode timer, then |
| 148 |
it will eventually power down by itself. |
| 149 |
.TP |
| 150 |
.B 2 |
| 151 |
The current settings are saved, then both the vertical and horizontal |
| 152 |
synchronization pulses are turned off. |
| 153 |
This puts the monitor into "off" mode. |
| 154 |
If your monitor has no Off_Mode timer, |
| 155 |
or if you want your monitor to power down immediately when the |
| 156 |
blank_timer times out, then you choose this option. |
| 157 |
.RI ( Caution: |
| 158 |
Powering down frequently will damage the monitor.) |
| 159 |
(Since Linux 1.1.76.) |
| 160 |
.RE |
| 161 |
.TP |
| 162 |
.BR subcode = TIOCL_SETKMSGREDIRECT |
| 163 |
Change target of kernel messages ("console"): |
| 164 |
by default, and if this is set to |
| 165 |
.BR 0 , |
| 166 |
messages are written to the currently active VT. |
| 167 |
The VT to write to is a single byte following |
| 168 |
.BR subcode . |
| 169 |
(Since Linux 2.5.36.) |
| 170 |
.TP |
| 171 |
.BR subcode = TIOCL_GETFGCONSOLE |
| 172 |
Returns the number of VT currently in foreground. |
| 173 |
(Since Linux 2.5.36.) |
| 174 |
.TP |
| 175 |
.BR subcode = TIOCL_SCROLLCONSOLE |
| 176 |
Scroll the foreground VT by the specified amount of |
| 177 |
.I lines |
| 178 |
down, |
| 179 |
or half the screen if |
| 180 |
.BR 0 . |
| 181 |
.I lines |
| 182 |
is *(((int32_t *)&subcode) + 1). |
| 183 |
(Since Linux 2.5.67.) |
| 184 |
.TP |
| 185 |
.BR subcode = TIOCL_BLANKSCREEN |
| 186 |
Blank the foreground VT, ignoring "pokes" (typing): |
| 187 |
can only be unblanked explicitly (by switching VTs, to text mode, etc.). |
| 188 |
(Since Linux 2.5.71.) |
| 189 |
.TP |
| 190 |
.BR subcode = TIOCL_BLANKEDSCREEN |
| 191 |
Returns the number of VT currently blanked, |
| 192 |
.B 0 |
| 193 |
if none. |
| 194 |
(Since Linux 2.5.71.) |
| 195 |
.TP |
| 196 |
.BR subcode = 16 |
| 197 |
Never used. |
| 198 |
.TP |
| 199 |
.BR subcode = TIOCL_GETKMSGREDIRECT |
| 200 |
Returns target of kernel messages. |
| 201 |
(Since Linux 2.6.17.) |
| 202 |
.SH RETURN VALUE |
| 203 |
On success, 0 is returned (except where indicated). |
| 204 |
On failure, \-1 is returned, and |
| 205 |
.I errno |
| 206 |
is set to indicate the error. |
| 207 |
.SH ERRORS |
| 208 |
.TP |
| 209 |
.B EINVAL |
| 210 |
.I argp |
| 211 |
is invalid. |
| 212 |
.TP |
| 213 |
.B EPERM |
| 214 |
Insufficient permission. |
| 215 |
.SH STANDARDS |
| 216 |
Linux. |
| 217 |
.SH SEE ALSO |
| 218 |
.BR ioctl (2), |
| 219 |
.BR ioctl_console (2) |