man-pages/man2/ioctl_console.2.html
2021-03-31 01:06:50 +01:00

1120 lines
26 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of IOCTL_CONSOLE</TITLE>
</HEAD><BODY>
<H1>IOCTL_CONSOLE</H1>
Section: Linux Programmer's Manual (2)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
ioctl_console - ioctls for console terminal and virtual consoles
<A NAME="lbAC">&nbsp;</A>
<H2>DESCRIPTION</H2>
The following Linux-specific
<B><A HREF="/cgi-bin/man/man2html?2+ioctl">ioctl</A></B>(2)
requests are supported for console terminals and virtual consoles.
Each requires a third argument, assumed here to be
<I>argp</I>.
<DL COMPACT>
<DT id="1"><B>KDGETLED</B>
<DD>
Get state of LEDs.
<I>argp</I>
points to a
<I>char</I>.
The lower three bits
of
<I>*argp</I>
are set to the state of the LEDs, as follows:
<TABLE>
<TR VALIGN=top><TD>LED_CAP </TD><TD>0x04</TD><TD>caps lock led<BR></TD></TR>
<TR VALIGN=top><TD>LED_NUM </TD><TD>0x02</TD><TD>num lock led<BR></TD></TR>
<TR VALIGN=top><TD>LED_SCR </TD><TD>0x01</TD><TD>scroll lock led<BR></TD></TR>
</TABLE>
<DT id="2"><B>KDSETLED</B>
<DD>
Set the LEDs.
The LEDs are set to correspond to the lower three bits of the
unsigned long integer in
<I>argp</I>.
However, if a higher order bit is set,
the LEDs revert to normal: displaying the state of the
keyboard functions of caps lock, num lock, and scroll lock.
</DL>
<P>
Before Linux 1.1.54, the LEDs just reflected the state of the corresponding
keyboard flags, and KDGETLED/KDSETLED would also change the keyboard
flags.
Since Linux 1.1.54 the LEDs can be made to display arbitrary
information, but by default they display the keyboard flags.
The following two ioctls are used to access the keyboard flags.
<DL COMPACT>
<DT id="3"><B>KDGKBLED</B>
<DD>
Get keyboard flags CapsLock, NumLock, ScrollLock (not lights).
<I>argp</I>
points to a char which is set to the flag state.
The low order three bits (mask 0x7) get the current flag state,
and the low order bits of the next nibble (mask 0x70) get
the default flag state.
(Since Linux 1.1.54.)
<DT id="4"><B>KDSKBLED</B>
<DD>
Set keyboard flags CapsLock, NumLock, ScrollLock (not lights).
<I>argp</I>
is an unsigned long integer that has the desired flag state.
The low order three bits (mask 0x7) have the flag state,
and the low order bits of the next nibble (mask 0x70) have
the default flag state.
(Since Linux 1.1.54.)
<DT id="5"><B>KDGKBTYPE</B>
<DD>
Get keyboard type.
This returns the value KB_101, defined as 0x02.
<DT id="6"><B>KDADDIO</B>
<DD>
Add I/O port as valid.
Equivalent to
<I>ioperm(arg,1,1)</I>.
<DT id="7"><B>KDDELIO</B>
<DD>
Delete I/O port as valid.
Equivalent to
<I>ioperm(arg,1,0)</I>.
<DT id="8"><B>KDENABIO</B>
<DD>
Enable I/O to video board.
Equivalent to
<I>ioperm(0x3b4, 0x3df-0x3b4+1, 1)</I>.
<DT id="9"><B>KDDISABIO</B>
<DD>
Disable I/O to video board.
Equivalent to
<I>ioperm(0x3b4, 0x3df-0x3b4+1, 0)</I>.
<DT id="10"><B>KDSETMODE</B>
<DD>
Set text/graphics mode.
<I>argp</I>
is an unsigned integer containing one of:
<TABLE>
<TR VALIGN=top><TD>KD_TEXT</TD><TD>0x00<BR></TD></TR>
<TR VALIGN=top><TD>KD_GRAPHICS</TD><TD>0x01<BR></TD></TR>
</TABLE>
<DT id="11"><B>KDGETMODE</B>
<DD>
Get text/graphics mode.
<I>argp</I>
points to an
<I>int</I>
which is set to one
of the values shown above for
<B>KDSETMODE</B>.
<DT id="12"><B>KDMKTONE</B>
<DD>
Generate tone of specified length.
The lower 16 bits of the unsigned long integer in
<I>argp</I>
specify the period in clock cycles,
and the upper 16 bits give the duration in msec.
If the duration is zero, the sound is turned off.
Control returns immediately.
For example,
<I>argp</I>
= (125&lt;&lt;16) + 0x637 would specify
the beep normally associated with a ctrl-G.
(Thus since Linux 0.99pl1; broken in Linux 2.1.49-50.)
<DT id="13"><B>KIOCSOUND</B>
<DD>
Start or stop sound generation.
The lower 16 bits of
<I>argp</I>
specify the period in clock cycles
(that is,
<I>argp</I>
= 1193180/frequency).
<I>argp</I>
= 0 turns sound off.
In either case, control returns immediately.
<DT id="14"><B>GIO_CMAP</B>
<DD>
Get the current default color map from kernel.
<I>argp</I>
points to
a 48-byte array.
(Since Linux 1.3.3.)
<DT id="15"><B>PIO_CMAP</B>
<DD>
Change the default text-mode color map.
<I>argp</I>
points to a
48-byte array which contains, in order, the Red, Green, and Blue
values for the 16 available screen colors: 0 is off, and 255 is full
intensity.
The default colors are, in order: black, dark red, dark
green, brown, dark blue, dark purple, dark cyan, light grey, dark
grey, bright red, bright green, yellow, bright blue, bright purple,
bright cyan and white.
(Since Linux 1.3.3.)
<DT id="16"><B>GIO_FONT</B>
<DD>
Gets 256-character screen font in expanded form.
<I>argp</I>
points to an 8192-byte array.
Fails with error code
<B>EINVAL</B>
if the
currently loaded font is a 512-character font, or if the console is
not in text mode.
<DT id="17"><B>GIO_FONTX</B>
<DD>
Gets screen font and associated information.
<I>argp</I>
points to a
<I>struct consolefontdesc</I>
(see
<B>PIO_FONTX</B>).
On call, the
<I>charcount</I>
field should be set to the maximum number of
characters that would fit in the buffer pointed to by
<I>chardata</I>.
On return, the
<I>charcount</I>
and
<I>charheight</I>
are filled with
the respective data for the currently loaded font, and the
<I>chardata</I>
array contains the font data if the initial value of
<I>charcount</I>
indicated enough space was available; otherwise the
buffer is untouched and
<I>errno</I>
is set to
<B>ENOMEM</B>.
(Since Linux 1.3.1.)
<DT id="18"><B>PIO_FONT</B>
<DD>
Sets 256-character screen font.
Load font into the EGA/VGA character
generator.
<I>argp</I>
points to an 8192-byte map, with 32 bytes per
character.
Only the first
<I>N</I>
of them are used for an 8x<I>N</I> font
(0 &lt;
<I>N</I>
&lt;= 32).
This call also invalidates the Unicode mapping.
<DT id="19"><B>PIO_FONTX</B>
<DD>
Sets screen font and associated rendering information.
<I>argp</I>
points to a
<DT id="20"><DD>
struct consolefontdesc {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;charcount;&nbsp;&nbsp;/*&nbsp;characters&nbsp;in&nbsp;font
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(256&nbsp;or&nbsp;512)&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;charheight;&nbsp;/*&nbsp;scan&nbsp;lines&nbsp;per
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;character&nbsp;(1-32)&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*chardata;&nbsp;&nbsp;&nbsp;/*&nbsp;font&nbsp;data&nbsp;in
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;expanded&nbsp;form&nbsp;*/
};
<DT id="21"><DD>
If necessary, the screen will be appropriately resized, and
<B>SIGWINCH</B>
sent to the appropriate processes.
This call also invalidates the Unicode mapping.
(Since Linux 1.3.1.)
<DT id="22"><B>PIO_FONTRESET</B>
<DD>
Resets the screen font, size and Unicode mapping to the bootup
defaults.
<I>argp</I>
is unused, but should be set to NULL to
ensure compatibility with future versions of Linux.
(Since Linux 1.3.28.)
<DT id="23"><B>GIO_SCRNMAP</B>
<DD>
Get screen mapping from kernel.
<I>argp</I>
points to an area of size
E_TABSZ, which is loaded with the font positions used to display each
character.
This call is likely to return useless information if the
currently loaded font is more than 256 characters.
<DT id="24"><B>GIO_UNISCRNMAP</B>
<DD>
Get full Unicode screen mapping from kernel.
<I>argp</I>
points to an
area of size
<I>E_TABSZ*sizeof(unsigned short)</I>,
which is loaded with the
Unicodes each character represent.
A special set of Unicodes,
starting at U+F000, are used to represent &quot;direct to font&quot; mappings.
(Since Linux 1.3.1.)
<DT id="25"><B>PIO_SCRNMAP</B>
<DD>
Loads the &quot;user definable&quot; (fourth) table in the kernel which maps
bytes into console screen symbols.
<I>argp</I>
points to an area of
size E_TABSZ.
<DT id="26"><B>PIO_UNISCRNMAP</B>
<DD>
Loads the &quot;user definable&quot; (fourth) table in the kernel which maps
bytes into Unicodes, which are then translated into screen symbols
according to the currently loaded Unicode-to-font map.
Special Unicodes starting at U+F000 can be used to map directly to the font
symbols.
(Since Linux 1.3.1.)
<DT id="27"><B>GIO_UNIMAP</B>
<DD>
Get Unicode-to-font mapping from kernel.
<I>argp</I>
points to a
<DT id="28"><DD>
struct unimapdesc {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;&nbsp;entry_ct;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;struct&nbsp;unipair&nbsp;*entries;
};
<DT id="29"><DD>
where
<I>entries</I>
points to an array of
<DT id="30"><DD>
struct unipair {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;unicode;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;fontpos;
};
<DT id="31"><DD>
(Since Linux 1.1.92.)
<DT id="32"><B>PIO_UNIMAP</B>
<DD>
Put unicode-to-font mapping in kernel.
<I>argp</I>
points to a
<I>struct unimapdesc</I>.
(Since Linux 1.1.92)
<DT id="33"><B>PIO_UNIMAPCLR</B>
<DD>
Clear table, possibly advise hash algorithm.
<I>argp</I>
points to a
<DT id="34"><DD>
struct unimapinit {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;advised_hashsize;&nbsp;&nbsp;/*&nbsp;0&nbsp;if&nbsp;no&nbsp;opinion&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;advised_hashstep;&nbsp;&nbsp;/*&nbsp;0&nbsp;if&nbsp;no&nbsp;opinion&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;advised_hashlevel;&nbsp;/*&nbsp;0&nbsp;if&nbsp;no&nbsp;opinion&nbsp;*/
};
<DT id="35"><DD>
(Since Linux 1.1.92.)
<DT id="36"><B>KDGKBMODE</B>
<DD>
Gets current keyboard mode.
<I>argp</I>
points to a
<I>long</I>
which is set to one
of these:
<TABLE>
<TR VALIGN=top><TD>K_RAW</TD><TD>0x00 /* Raw (scancode) mode */<BR></TD></TR>
<TR VALIGN=top><TD>K_XLATE</TD><TD>0x01 /* Translate keycodes using keymap */<BR></TD></TR>
<TR VALIGN=top><TD>K_MEDIUMRAW</TD><TD>0x02 /* Medium raw (scancode) mode */<BR></TD></TR>
<TR VALIGN=top><TD>K_UNICODE</TD><TD>0x03 /* Unicode mode */<BR></TD></TR>
<TR VALIGN=top><TD>K_OFF</TD><TD>0x04 /* Disabled mode; since Linux 2.6.39 */<BR></TD></TR>
</TABLE>
<DT id="37"><B>KDSKBMODE</B>
<DD>
Sets current keyboard mode.
<I>argp</I>
is a
<I>long</I>
equal to one of the values shown for
<B>KDGKBMODE</B>.
<DT id="38"><B>KDGKBMETA</B>
<DD>
Gets meta key handling mode.
<I>argp</I>
points to a
<I>long</I>
which is
set to one of these:
<TABLE>
<TR VALIGN=top><TD>K_METABIT</TD><TD>0x03</TD><TD>set high order bit<BR></TD></TR>
<TR VALIGN=top><TD>K_ESCPREFIX</TD><TD>0x04</TD><TD>escape prefix<BR></TD></TR>
</TABLE>
<DT id="39"><B>KDSKBMETA</B>
<DD>
Sets meta key handling mode.
<I>argp</I>
is a
<I>long</I>
equal to one of the values shown above for
<B>KDGKBMETA</B>.
<DT id="40"><B>KDGKBENT</B>
<DD>
Gets one entry in key translation table (keycode to action code).
<I>argp</I>
points to a
<DT id="41"><DD>
struct kbentry {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;char&nbsp;&nbsp;kb_table;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;char&nbsp;&nbsp;kb_index;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;kb_value;
};
<DT id="42"><DD>
with the first two members filled in:
<I>kb_table</I>
selects the key table (0 &lt;=
<I>kb_table</I>
&lt; MAX_NR_KEYMAPS),
and
<I>kb_index</I>
is the keycode (0 &lt;=
<I>kb_index</I>
&lt; NR_KEYS).
<I>kb_value</I>
is set to the corresponding action code,
or K_HOLE if there is no such key,
or K_NOSUCHMAP if
<I>kb_table</I>
is invalid.
<DT id="43"><B>KDSKBENT</B>
<DD>
Sets one entry in translation table.
<I>argp</I>
points to a
<I>struct kbentry</I>.
<DT id="44"><B>KDGKBSENT</B>
<DD>
Gets one function key string.
<I>argp</I>
points to a
<DT id="45"><DD>
struct kbsentry {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;char&nbsp;kb_func;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;char&nbsp;kb_string[512];
};
<DT id="46"><DD>
<I>kb_string</I>
is set to the (null-terminated) string corresponding to
the
<I>kb_func</I>th
function key action code.
<DT id="47"><B>KDSKBSENT</B>
<DD>
Sets one function key string entry.
<I>argp</I>
points to a
<I>struct kbsentry</I>.
<DT id="48"><B>KDGKBDIACR</B>
<DD>
Read kernel accent table.
<I>argp</I>
points to a
<DT id="49"><DD>
struct kbdiacrs {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;int&nbsp;&nbsp;&nbsp;kb_cnt;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;struct&nbsp;kbdiacr&nbsp;kbdiacr[256];
};
<DT id="50"><DD>
where
<I>kb_cnt</I>
is the number of entries in the array, each of which
is a
<DT id="51"><DD>
struct kbdiacr {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;char&nbsp;diacr;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;char&nbsp;base;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;char&nbsp;result;
};
<DT id="52"><B>KDGETKEYCODE</B>
<DD>
Read kernel keycode table entry (scan code to keycode).
<I>argp</I>
points to a
<DT id="53"><DD>
struct kbkeycode {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;int&nbsp;scancode;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;int&nbsp;keycode;
};
<DT id="54"><DD>
<I>keycode</I>
is set to correspond to the given
<I>scancode</I>.
(89 &lt;=
<I>scancode</I>
&lt;= 255 only.
For 1 &lt;=
<I>scancode</I>
&lt;= 88,
<I>keycode</I>==<I>scancode</I>.)
(Since Linux 1.1.63.)
<DT id="55"><B>KDSETKEYCODE</B>
<DD>
Write kernel keycode table entry.
<I>argp</I>
points to a
<I>struct kbkeycode</I>.
(Since Linux 1.1.63.)
<DT id="56"><B>KDSIGACCEPT</B>
<DD>
The calling process indicates its willingness to accept the signal
<I>argp</I>
when it is generated by pressing an appropriate key combination.
(1 &lt;=
<I>argp</I>
&lt;= NSIG).
(See
<I>spawn_console</I>()
in
<I>linux/drivers/char/keyboard.c</I>.)
<DT id="57"><B>VT_OPENQRY</B>
<DD>
Returns the first available (non-opened) console.
<I>argp</I>
points to an
<I>int</I>
which is set to the
number of the vt (1 &lt;=
<I>*argp</I>
&lt;= MAX_NR_CONSOLES).
<DT id="58"><B>VT_GETMODE</B>
<DD>
Get mode of active vt.
<I>argp</I>
points to a
<DT id="59"><DD>
struct vt_mode {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;char&nbsp;&nbsp;mode;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;vt&nbsp;mode&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;char&nbsp;&nbsp;waitv;&nbsp;&nbsp;&nbsp;/*&nbsp;if&nbsp;set,&nbsp;hang&nbsp;on&nbsp;writes&nbsp;if&nbsp;not&nbsp;active&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;short&nbsp;relsig;&nbsp;&nbsp;/*&nbsp;signal&nbsp;to&nbsp;raise&nbsp;on&nbsp;release&nbsp;req&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;short&nbsp;acqsig;&nbsp;&nbsp;/*&nbsp;signal&nbsp;to&nbsp;raise&nbsp;on&nbsp;acquisition&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;short&nbsp;frsig;&nbsp;&nbsp;&nbsp;/*&nbsp;unused&nbsp;(set&nbsp;to&nbsp;0)&nbsp;*/
};
<DT id="60"><DD>
which is set to the mode of the active vt.
<I>mode</I>
is set to one of these values:
<TABLE>
<TR VALIGN=top><TD>VT_AUTO</TD><TD>auto vt switching<BR></TD></TR>
<TR VALIGN=top><TD>VT_PROCESS</TD><TD>process controls switching<BR></TD></TR>
<TR VALIGN=top><TD>VT_ACKACQ</TD><TD>acknowledge switch<BR></TD></TR>
</TABLE>
<DT id="61"><B>VT_SETMODE</B>
<DD>
Set mode of active vt.
<I>argp</I>
points to a
<I>struct vt_mode</I>.
<DT id="62"><B>VT_GETSTATE</B>
<DD>
Get global vt state info.
<I>argp</I>
points to a
<DT id="63"><DD>
struct vt_stat {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;v_active;&nbsp;&nbsp;/*&nbsp;active&nbsp;vt&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;v_signal;&nbsp;&nbsp;/*&nbsp;signal&nbsp;to&nbsp;send&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;v_state;&nbsp;&nbsp;&nbsp;/*&nbsp;vt&nbsp;bit&nbsp;mask&nbsp;*/
};
<DT id="64"><DD>
For each vt in use, the corresponding bit in the
<I>v_state</I>
member is set.
(Kernels 1.0 through 1.1.92.)
<DT id="65"><B>VT_RELDISP</B>
<DD>
Release a display.
<DT id="66"><B>VT_ACTIVATE</B>
<DD>
Switch to vt
<I>argp</I>
(1 &lt;=
<I>argp</I>
&lt;= MAX_NR_CONSOLES).
<DT id="67"><B>VT_WAITACTIVE</B>
<DD>
Wait until vt
<I>argp</I>
has been activated.
<DT id="68"><B>VT_DISALLOCATE</B>
<DD>
Deallocate the memory associated with vt
<I>argp</I>.
(Since Linux 1.1.54.)
<DT id="69"><B>VT_RESIZE</B>
<DD>
Set the kernel's idea of screensize.
<I>argp</I>
points to a
<DT id="70"><DD>
struct vt_sizes {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;v_rows;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;#&nbsp;rows&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;v_cols;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;#&nbsp;columns&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;v_scrollsize;&nbsp;/*&nbsp;no&nbsp;longer&nbsp;used&nbsp;*/
};
<DT id="71"><DD>
Note that this does not change the videomode.
See
<B><A HREF="/cgi-bin/man/man2html?8+resizecons">resizecons</A></B>(8).
(Since Linux 1.1.54.)
<DT id="72"><B>VT_RESIZEX</B>
<DD>
Set the kernel's idea of various screen parameters.
<I>argp</I>
points to a
<DT id="73"><DD>
struct vt_consize {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;v_rows;&nbsp;&nbsp;/*&nbsp;number&nbsp;of&nbsp;rows&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;v_cols;&nbsp;&nbsp;/*&nbsp;number&nbsp;of&nbsp;columns&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;v_vlin;&nbsp;&nbsp;/*&nbsp;number&nbsp;of&nbsp;pixel&nbsp;rows
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;on&nbsp;screen&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;v_clin;&nbsp;&nbsp;/*&nbsp;number&nbsp;of&nbsp;pixel&nbsp;rows
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;per&nbsp;character&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;v_vcol;&nbsp;&nbsp;/*&nbsp;number&nbsp;of&nbsp;pixel&nbsp;columns
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;on&nbsp;screen&nbsp;*/
<BR>&nbsp;&nbsp;&nbsp;&nbsp;unsigned&nbsp;short&nbsp;v_ccol;&nbsp;&nbsp;/*&nbsp;number&nbsp;of&nbsp;pixel&nbsp;columns
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;per&nbsp;character&nbsp;*/
};
<DT id="74"><DD>
Any parameter may be set to zero, indicating &quot;no change&quot;, but if
multiple parameters are set, they must be self-consistent.
Note that this does not change the videomode.
See
<B><A HREF="/cgi-bin/man/man2html?8+resizecons">resizecons</A></B>(8).
(Since Linux 1.3.3.)
</DL>
<P>
The action of the following ioctls depends on the first byte in the struct
pointed to by
<I>argp</I>,
referred to here as the
<I>subcode</I>.
These are legal only for the superuser or the owner of the current terminal.
<DL COMPACT>
<DT id="75"><B>TIOCLINUX, subcode=0</B>
<DD>
Dump the screen.
Disappeared in Linux 1.1.92. (With kernel 1.1.92 or later, read from
<I>/dev/vcsN</I>
or
<I>/dev/vcsaN</I>
instead.)
<DT id="76"><B>TIOCLINUX, subcode=1</B>
<DD>
Get task information.
Disappeared in Linux 1.1.92.
<DT id="77"><B>TIOCLINUX, subcode=2</B>
<DD>
Set selection.
<I>argp</I>
points to a
<DT id="78"><DD>
struct {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;char&nbsp;&nbsp;subcode;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;short&nbsp;xs,&nbsp;ys,&nbsp;xe,&nbsp;ye;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;short&nbsp;sel_mode;
};
<DT id="79"><DD>
<I>xs</I>
and
<I>ys</I>
are the starting column and row.
<I>xe</I>
and
<I>ye</I>
are the ending
column and row.
(Upper left corner is row=column=1.)
<I>sel_mode</I>
is 0 for character-by-character selection,
1 for word-by-word selection,
or 2 for line-by-line selection.
The indicated screen characters are highlighted and saved
in the static array sel_buffer in
<I>devices/char/console.c</I>.
<DT id="80"><B>TIOCLINUX, subcode=3</B>
<DD>
Paste selection.
The characters in the selection buffer are
written to
<I>fd</I>.
<DT id="81"><B>TIOCLINUX, subcode=4</B>
<DD>
Unblank the screen.
<DT id="82"><B>TIOCLINUX, subcode=5</B>
<DD>
Sets contents of a 256-bit look up table defining characters in a &quot;word&quot;,
for word-by-word selection.
(Since Linux 1.1.32.)
<DT id="83"><B>TIOCLINUX, subcode=6</B>
<DD>
<I>argp</I>
points to a char which is set to the value of the kernel
variable
<I>shift_state</I>.
(Since Linux 1.1.32.)
<DT id="84"><B>TIOCLINUX, subcode=7</B>
<DD>
<I>argp</I>
points to a char which is set to the value of the kernel
variable
<I>report_mouse</I>.
(Since Linux 1.1.33.)
<DT id="85"><B>TIOCLINUX, subcode=8</B>
<DD>
Dump screen width and height, cursor position, and all the
character-attribute pairs.
(Kernels 1.1.67 through 1.1.91 only.
With kernel 1.1.92 or later, read from
<I>/dev/vcsa*</I>
instead.)
<DT id="86"><B>TIOCLINUX, subcode=9</B>
<DD>
Restore screen width and height, cursor position, and all the
character-attribute pairs.
(Kernels 1.1.67 through 1.1.91 only.
With kernel 1.1.92 or later, write to
<I>/dev/vcsa*</I>
instead.)
<DT id="87"><B>TIOCLINUX, subcode=10</B>
<DD>
Handles the Power Saving
feature of the new generation of monitors.
VESA screen blanking mode is set to
<I>argp[1]</I>,
which governs what
screen blanking does:
<DL COMPACT><DT id="88"><DD>
<DL COMPACT>
<DT id="89">0:<DD>
Screen blanking is disabled.
<DT id="90">1:<DD>
The current video adapter
register settings are saved, then the controller is programmed to turn off
the vertical synchronization pulses.
This puts the monitor into &quot;standby&quot; mode.
If your monitor has an Off_Mode timer, then
it will eventually power down by itself.
<DT id="91">2:<DD>
The current settings are saved, then both the vertical and horizontal
synchronization pulses are turned off.
This puts the monitor into &quot;off&quot; mode.
If your monitor has no Off_Mode timer,
or if you want your monitor to power down immediately when the
blank_timer times out, then you choose this option.
(<I>Caution:</I>
Powering down frequently will damage the monitor.)
(Since Linux 1.1.76.)
</DL>
</DL>
</DL>
<A NAME="lbAD">&nbsp;</A>
<H2>RETURN VALUE</H2>
On success, 0 is returned.
On error, -1 is returned, and
<I>errno</I>
is set.
<A NAME="lbAE">&nbsp;</A>
<H2>ERRORS</H2>
<I>errno</I>
may take on these values:
<DL COMPACT>
<DT id="92"><B>EBADF</B>
<DD>
The file descriptor is invalid.
<DT id="93"><B>EINVAL</B>
<DD>
The file descriptor or
<I>argp</I>
is invalid.
<DT id="94"><B>ENOTTY</B>
<DD>
The file descriptor is not associated with a character special device,
or the specified request does not apply to it.
<DT id="95"><B>EPERM</B>
<DD>
Insufficient permission.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>NOTES</H2>
<B>Warning</B>:
Do not regard this man page as documentation of the Linux console ioctls.
This is provided for the curious only, as an alternative to reading the
source.
Ioctl's are undocumented Linux internals, liable to be changed
without warning.
(And indeed, 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.)
<P>
Very often, ioctls are 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 when required by this particular program.
<P>
Programs using these ioctls will not be portable to other versions
of UNIX, will not work on older versions of Linux, and will not work
on future versions of Linux.
<P>
Use POSIX functions.
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+dumpkeys">dumpkeys</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+kbd_mode">kbd_mode</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+loadkeys">loadkeys</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+mknod">mknod</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+setleds">setleds</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+setmetamode">setmetamode</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?2+execve">execve</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+fcntl">fcntl</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+ioctl_tty">ioctl_tty</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+ioperm">ioperm</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?3+termios">termios</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?4+console_codes">console_codes</A></B>(4),
<B><A HREF="/cgi-bin/man/man2html?4+mt">mt</A></B>(4),
<B><A HREF="/cgi-bin/man/man2html?4+sd">sd</A></B>(4),
<B><A HREF="/cgi-bin/man/man2html?4+tty">tty</A></B>(4),
<B><A HREF="/cgi-bin/man/man2html?4+ttyS">ttyS</A></B>(4),
<B><A HREF="/cgi-bin/man/man2html?4+vcs">vcs</A></B>(4),
<B><A HREF="/cgi-bin/man/man2html?4+vcsa">vcsa</A></B>(4),
<B><A HREF="/cgi-bin/man/man2html?7+charsets">charsets</A></B>(7),
<B><A HREF="/cgi-bin/man/man2html?8+mapscrn">mapscrn</A></B>(8),
<B><A HREF="/cgi-bin/man/man2html?8+resizecons">resizecons</A></B>(8),
<B><A HREF="/cgi-bin/man/man2html?8+setfont">setfont</A></B>(8)
<P>
<I>/usr/include/linux/kd.h</I>,
<I>/usr/include/linux/vt.h</I>
<A NAME="lbAH">&nbsp;</A>
<H2>COLOPHON</H2>
This page is part of release 5.05 of the Linux
<I>man-pages</I>
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="96"><A HREF="#lbAB">NAME</A><DD>
<DT id="97"><A HREF="#lbAC">DESCRIPTION</A><DD>
<DT id="98"><A HREF="#lbAD">RETURN VALUE</A><DD>
<DT id="99"><A HREF="#lbAE">ERRORS</A><DD>
<DT id="100"><A HREF="#lbAF">NOTES</A><DD>
<DT id="101"><A HREF="#lbAG">SEE ALSO</A><DD>
<DT id="102"><A HREF="#lbAH">COLOPHON</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:33 GMT, March 31, 2021
</BODY>
</HTML>