File: ioctl_vt.2

package info (click to toggle)
manpages 6.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 19,808 kB
  • sloc: sh: 503; python: 222; perl: 165; makefile: 27; lisp: 22
file content (177 lines) | stat: -rw-r--r-- 3,901 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
'\" t
.\" Copyright 1995, Jim Van Zandt <jrv@vanzandt.mv.com> and aeb
.\" Copyright 1995, <faith@cs.unc.edu>
.\" Copyright 1995, <jrv@vanzandt.mv.com>
.\" Copyright 1995, "H. Peter Anvin" <hpa@storm.net>
.\" Copyright 2024, Alejandro Colomar <alx@kernel.org>
.\"
.\" SPDX-License-Identifier: GPL-2.0-or-later
.\"
.\" FIXME The following are not documented:
.\"     VT_LOCKSWITCH (since Linux 1.3.47, needs CAP_SYS_TTY_CONFIG)
.\"     VT_UNLOCKSWITCH (since Linux 1.3.47, needs CAP_SYS_TTY_CONFIG)
.\"     VT_GETHIFONTMASK (since Linux 2.6.18)
.\"
.TH ioctl_vt 2 2024-06-13 "Linux man-pages (unreleased)"
.SH NAME
ioctl_vt
\-
ioctls for console terminal and virtual consoles
.SH SYNOPSIS
.nf
.BR "#include <linux/vt.h>" "  /* Definition of " VT_* " constants */"
.B #include <sys/ioctl.h>
.P
.BI "int ioctl(int " fd ", unsigned long " op ", void *" argp );
.fi
.SH DESCRIPTION
The following Linux-specific
.BR ioctl (2)
operations are supported for console terminals and virtual consoles.
.TP
.B VT_OPENQRY
Returns the first available (non-opened) console.
.I argp
points to an
.I int
which is set to the
number of the vt (1 <=
.I *argp
<= MAX_NR_CONSOLES).
.TP
.B VT_GETMODE
Get mode of active vt.
.I argp
points to a
.IP
.in +4n
.EX
struct vt_mode {
    char  mode;    /* vt mode */
    char  waitv;   /* if set, hang on writes if not active */
    short relsig;  /* signal to raise on release op */
    short acqsig;  /* signal to raise on acquisition */
    short frsig;   /* unused (set to 0) */
};
.EE
.in
.IP
which is set to the mode of the active vt.
.I mode
is set to one of these values:
.TS
l l.
VT_AUTO	auto vt switching
VT_PROCESS	process controls switching
VT_ACKACQ	acknowledge switch
.TE
.TP
.B VT_SETMODE
Set mode of active vt.
.I argp
points to a
.IR "struct vt_mode" .
.TP
.B VT_GETSTATE
Get global vt state info.
.I argp
points to a
.IP
.in +4n
.EX
struct vt_stat {
    unsigned short v_active;  /* active vt */
    unsigned short v_signal;  /* signal to send */
    unsigned short v_state;   /* vt bit mask */
};
.EE
.in
.IP
For each vt in use, the corresponding bit in the
.I v_state
member is set.
(Linux 1.0 through Linux 1.1.92.)
.TP
.B VT_RELDISP
Release a display.
.TP
.B VT_ACTIVATE
Switch to vt
.I argp
(1 <=
.I argp
<= MAX_NR_CONSOLES).
.TP
.B VT_WAITACTIVE
Wait until vt
.I argp
has been activated.
.TP
.B VT_DISALLOCATE
Deallocate the memory associated with vt
.IR argp .
(Since Linux 1.1.54.)
.TP
.B VT_RESIZE
Set the kernel's idea of screensize.
.I argp
points to a
.IP
.in +4n
.EX
struct vt_sizes {
    unsigned short v_rows;       /* # rows */
    unsigned short v_cols;       /* # columns */
    unsigned short v_scrollsize; /* no longer used */
};
.EE
.in
.IP
Note that this does not change the videomode.
See
.BR resizecons (8).
(Since Linux 1.1.54.)
.TP
.B VT_RESIZEX
Set the kernel's idea of various screen parameters.
.I argp
points to a
.IP
.in +4n
.EX
struct vt_consize {
    unsigned short v_rows;  /* number of rows */
    unsigned short v_cols;  /* number of columns */
    unsigned short v_vlin;  /* number of pixel rows
                               on screen */
    unsigned short v_clin;  /* number of pixel rows
                               per character */
    unsigned short v_vcol;  /* number of pixel columns
                               on screen */
    unsigned short v_ccol;  /* number of pixel columns
                               per character */
};
.EE
.in
.IP
Any parameter may be set to zero, indicating "no change", but if
multiple parameters are set, they must be self-consistent.
Note that this does not change the videomode.
See
.BR resizecons (8).
(Since Linux 1.3.3.)
.SH RETURN VALUE
On success, 0 is returned (except where indicated).
On failure, \-1 is returned, and
.I errno
is set to indicate the error.
.SH ERRORS
.TP
.B EINVAL
.I argp
is invalid.
.SH STANDARDS
Linux.
.SH SEE ALSO
.BR ioctl (2),
.BR ioctl_console (2)