1 .\" Copyright (c) 1995 Jim Van Zandt <jrv@vanzandt.mv.com> and aeb
2 .\" Sun Feb 26 11:46:23 MET 1995
4 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 .\" GNU General Public License for more details.
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, see
22 .\" <http://www.gnu.org/licenses/>.
25 .\" Modified, Sun Feb 26 15:04:20 1995, faith@cs.unc.edu
26 .\" Modified, Thu Apr 20 22:08:17 1995, jrv@vanzandt.mv.com
27 .\" Modified, Mon Sep 18 22:32:47 1995, hpa@storm.net (H. Peter Anvin)
28 .\" FIXME The following are not documented:
29 .\" KDFONTOP (since 2.1.111)
30 .\" KDGKBDIACRUC (since 2.6.24)
32 .\" KDSKBDIACRUC (since 2.6.24)
33 .\" KDKBDREP (since 2.1.113)
34 .\" KDMAPDISP (not implemented as at 2.6.27)
35 .\" KDUNMAPDISP (not implemented as at 2.6.27)
36 .\" VT_LOCKSWITCH (since 1.3.47, needs CAP_SYS_TTY_CONFIG)
37 .\" VT_UNLOCKSWITCH (since 1.3.47, needs CAP_SYS_TTY_CONFIG)
38 .\" VT_GETHIFONTMASK (since 2.6.18)
40 .\"*******************************************************************
42 .\" This file was generated with po4a. Translate the source file.
44 .\"*******************************************************************
45 .TH CONSOLE_IOCTL 4 2009\-02\-28 Linux "Linux Programmer's Manual"
47 console_ioctl \- ioctls for console terminal and virtual consoles
49 次のような Linux 固有の \fBioctl\fP(2) がサポートされている。 それぞれ3番目の引数が必要である、ここでは \fIargp\fP とする。
52 LED の状態を取得する。 \fIargp\fP は \fIchar\fP のポインターである。 \fI*argp\fP の下位 3 ビットに以下のように LED
56 LED_CAP 0x04 caps lock led
57 LEC_NUM 0x02 num lock led
58 LED_SCR 0x01 scroll lock led
62 LEDを点灯させる。LEDは \fIargp\fP の下位 3 ビットに従い点灯される。 しかし、より高位のビットがセットされている時には、キャピタルロック、
63 ナンバーロック、スクロールロックのキーボード機能の状態を表示する LED は 通常状態に戻る。
65 Before 1.1.54, the LEDs just reflected the state of the corresponding
66 keyboard flags, and KDGETLED/KDSETLED would also change the keyboard flags.
67 Since 1.1.54 the LEDs can be made to display arbitrary information, but by
68 default they display the keyboard flags. The following two ioctls are used
69 to access the keyboard flags.
72 キャピタルロック、ナンバーロック、スクロールロックの(LED の表示では なく)キーボードフラグを得る。 \fIargp\fP
73 はフラグの状態がセットされる文字変数を指す。 (0x7)でマスクして得られる下位 3 ビットが現在のフラグの状態を示し、
74 (0x70)でマスクして得られる次の 3 ビットがデフォルトのフラグの状態を 示す。(カーネル 1.1.54以降)
77 キャピタルロック、ナンバーロック、スクロールロックの(LED の表示ではなく) キーボードフラグをセットする。 \fIargp\fP
78 がセットしたいフラグである。 (0x7)でマスクして得られる下位 3 ビットがフラグの状態で、(0x70)でマスクして 得られる次の 3
79 ビットがデフォルトのフラグの状態である。(カーネル 1.1.54以降)
82 キーボードの種類を得る。これは値 0x02 と定義されている KB_101を返す。
85 I/Oポートを有効な物として加える。これは \fIioperm(arg,1,1)\fP と等価である。
88 I/Oポートを有効な物から外す。これは \fIioperm(arg,1,0)\fP と等価である。
91 ビデオボードへの I/O を可能にする。 これは \fIioperm(0x3b4, 0x3df\-0x3b4+1, 1)\fP と等価である。
94 ビデオボードへの I/O を不可能にする。 これは \fIioperm(0x3b4, 0x3df\-0x3b4+1, 0)\fP と等価である。
97 テキスト/グラフィクスモードを設定する。 \fIargp\fP は次のうちのどれか:
106 テキスト/グラフィクスモードを取得する。 \fIargp\fP が指す \fIlong\fP 型変数に 上述の値のどちらかがセットされる。
109 指定された長さのトーンを発生する。 \fIargp\fP の下位 16 ビットはクロックサイクルを単位にして周期を指定し、 上位 16 ビットが msec
110 の単位で表した、(トーンを発生させる)時間を指定する。 トーンを発生させる時間がゼロのときは、サウンドはオフになる。 制御は直ちに戻る。
111 例えば、\fIargp\fP = (125<<16) + 0x637 とすれば、通常 ctrl\-G を押した時に 発生する音になる。
112 (カーネル 0.99pl1 以降;この機能は カーネル 2.1.49 から 2.1.50 ではバグのため動作しない)
115 音の発生の開始や停止を行う。 \fIargp\fP の下位 16 ビットはクロックサイクルを単位として周期を示す。 (つまり \fIargp\fP =
116 1193180/周波数)。 \fIargp\fP = 0 の場合、サウンドはオフになる。 どちらの場合でも、ただちに制御は戻る。
119 現在のデフォルトのカラーマップをカーネルより取得する。
122 デフォルトのテキストモードのカラーマップを変更する。 \fIargp\fP が指す 48 バイトの配列中には、16 の可能なスクリーンの色を、
123 赤、緑、青の順に 0 をオフ、255を最大強度とした値として納める。 デフォルトの色は順に、黒、濃い赤、濃い緑、茶、濃い青、濃い紫、濃いシアン、
124 明るい灰色、濃い灰色、明るい赤、明るい緑、黄、明るい青、明るい紫、 明るいシアン、白である。(カーネル 1.3.3以降)
127 拡張された形式で 256 文字のスクリーンフォントを得る。 \fIargp\fP は 8192 バイトの配列を指す。 現在ロードされているフォントが 512
128 文字のフォントであるか、コンソールが テキストモードでない時には失敗し \fBEINVAL\fP のエラーコードを返す。
131 Gets screen font and associated information. \fIargp\fP points to a \fIstruct
132 consolefontdesc\fP (see \fBPIO_FONTX\fP). On call, the \fIcharcount\fP field should
133 be set to the maximum number of characters that would fit in the buffer
134 pointed to by \fIchardata\fP. On return, the \fIcharcount\fP and \fIcharheight\fP
135 are filled with the respective data for the currently loaded font, and the
136 \fIhardata\fP array contains the font data if the initial value of \fIcharcount\fP
137 indicated enough space was available; otherwise the buffer is untouched and
138 \fIerrno\fP is set to \fBENOMEM\fP. (Since 1.3.1.)
141 Sets 256\-character screen font. Load font into the EGA/VGA character
142 generator. \fIargp\fP points to a 8192 byte map, with 32 bytes per character.
143 Only the first \fIN\fP of them are used for an 8x\fIN\fP font (0 < \fIN\fP <=
144 32). This call also invalidates the Unicode mapping.
147 Sets screen font and associated rendering information. \fIargp\fP
153 struct consolefontdesc {
154 unsigned short charcount; /* フォントの文字数
156 unsigned short charheight; /* 一文字の走査線の数
158 char *chardata; /* 展開されたフォントデータ */
163 必要ならスクリーンは適当にサイズ変更され、\fBSIGWINCH\fP が適切な プロセスに送られる。 このコールにより Unicode
167 スクリーンフォント、サイズ、 Unicode マッピングをブート時のデフォルト値に リセットする。\fIargp\fP は用いられないが、将来のバージョンの
168 Linux との互換性を保つために NULL にセットすべきである。
171 スクリーンマッピングをカーネルより取得する。\fIargp\fP はサイズ E_TABSZ の
172 領域を指す。その領域には各キャラクターを表示するのに用いられるフォントの 位置がロードされている。 この呼び出しは現在ロードされているフォントが 256
173 文字よりも多い時には 無意味な情報を返す事が多い。
176 Get full Unicode screen mapping from kernel. \fIargp\fP points to an area of
177 size \fIE_TABSZ*sizeof(unsigned\fPshort)\fI,\fP which is loaded with the Unicodes
178 each character represent. A special set of Unicodes, starting at U+F000,
179 are used to represent "direct to font" mappings. (Since 1.3.1.)
182 「ユーザー定義可能な(user definable)」(4番目の)テーブルをカーネルに
183 ロードする。そのテーブルは各バイトをスクリーンシンボルにマッピングする。 \fIargp\fP はサイズE_TABSZの領域を指す。
186 「ユーザー定義可能な」(4番目の)テーブルをカーネルにロードする。 そのテーブルは各バイトをユニコードにマッピングし、その後、
187 現在ロードされているユニコードからフォントへのマップに従い スクリーンシンボルに変換される。 U+F000
188 に始まるユニコードは直接フォントシンボルにマッピングするのに 使える(カーネル 1.3.1 以降)
191 Unicode からフォントへのマッピングをカーネルから取得する。 \fIargp\fP は、
196 unsigned short entry_ct;
197 struct unipair *entries;
202 という構造体を指す。 ここで \fIentries\fP は以下の構造体の配列へのポインターである。
207 unsigned short unicode;
208 unsigned short fontpos;
216 Put unicode\-to\-font mapping in kernel. \fIargp\fP points to a \fIstruct
217 unimapdesc\fP. (Since 1.1.92)
220 テーブルをクリアし、その事をハシュアルゴリズムに伝える。 \fIargp\fPは
225 unsigned short advised_hashsize; /* 0 if no opinion */
226 unsigned short advised_hashstep; /* 0 if no opinion */
227 unsigned short advised_hashlevel; /* 0 if no opinion */
235 現在のキーボードモードを取得する。\fIargp\fP の指す \fIlong\fP 型変数が、 次のうちのどれかに設定される。
246 現在のキーボードモードを設定する。 \fIargp\fP は上記の値のうちのどれかに等しい \fIlong\fP にする。
249 メタキーハンドリングモード(meta key handling mode)を取得する。 \fIargp\fP が指す \fIlong\fP
254 K_METABIT 0x03 set high order bit
255 K_ESCPREFIX 0x04 escape prefix
259 メタキーハンドリングモードを設定する。 \fIargp\fP は上記の値のどれかに等しい \fIlong\fP にする。
262 キーコードをアクションコードに変換するキー変換表のエントリーの一つを 取得する。 \fIargp\fP は、
267 unsigned char kb_table;
268 unsigned char kb_index;
269 unsigned short kb_value;
274 へのポインターである。 最初の2つの要素、\fIkb_table\fP には選択するキーテーブル (0 <= \fIkb_table\fP <
275 MAX_NR_KEYMAPS)、\fIkb_index\fP にはキーコード(0 <= \fIkb_index\fP <
276 NR_KEYS)を設定する。 \fIkb_value\fP は対応するアクションコード、または、そのようなキーが ないときには
277 K_HOLE、\fIkb_table\fP が無効な時には K_NOSUCHMAP に設定される。
280 変換テーブルのエントリーの一つを設定する。\fIargp\fP は 構造体 \fIstruct kbentry\fP へのポインターである。
283 ファンクションキーの文字列を取得する。\fIargp\fP は 以下の構造体へのポインターである。
288 unsigned char kb_func;
289 unsigned char kb_string[512];
294 \fIkb_func\fP 番目のファンクションキーのアクションコードに対応する (NULL で終端された) 文字列が \fIkb_string\fP
298 ファンクションキーの文字列のエントリーを設定する。\fIargp\fP は、 構造体 \fIstruct kbsentry\fP へのポインターである。
301 カーネルのアクセントテーブル(accent table)を読み込む。\fIargp\fPは、 次の構造体へのポインターである。
307 struct kbdiacr kbdiacr[256];
312 ここで、\fIkb_cnt\fP は配列中のエントリーの個数で、個々のエントリーは 以下の構造体である。
319 unsigned char result;
325 カーネルの(スキャンコードからキーコードへ 変換する)キーコードテーブルエントリーを読み込む。 \fIargp\fP は、
330 unsigned int scancode;
331 unsigned int keycode;
336 へのポインターである。 \fIkeycode\fP は、\fIscancode\fP に対応した値に設定される。(ただし、89 <= \fIscancode\fP
337 <= 255 のみについて。1 <= \fIscancode\fP <= 88 では \fIkeycode\fP ==
338 \fIscancode\fP である。) (カーネル 1.1.63 以降)
341 カーネルのキーコードテーブルエントリーを書き込む。\fIargp\fP は構造体 \fIstruct kbkeycode\fP へのポインターである。 (カーネル
345 The calling process indicates its willingness to accept the signal \fIargp\fP
346 when it is generated by pressing an appropriate key combination. (1 <=
347 \fIargp\fP <= NSIG). (See \fIspawn_console\fP() in
348 \fIlinux/drivers/char/keyboard.c\fP.)
351 最初の空いている(まだオープンされていない)コンソールを返す。 \fIargp\fP の指す \fIint\fP 型の整数には、vt の番号がセットされる (1
352 <= \fI*argp\fP <= MAX_NR_CONSOLES)。
355 アクティブな vt のモードを取得する。\fIargp\fPは、
360 char mode; /* vt mode */
361 char waitv; /* if set, hang on writes if not active */
362 short relsig; /* signal to raise on release req */
363 short acqsig; /* signal to raise on acquisition */
364 short frsig; /* unused (set to 0) */
369 という構造体を指すポインタであり、アクティブな vt のモードが セットされる。 \fImode\fP は次のどれかに設定される:
373 VT_AUTO auto vt switching
374 VT_PROCESS process controls switching
375 VT_ACKACQ acknowledge switch
379 アクティブな vt のモードを設定する。\fIargp\fP は構造体 \fIstruct vt_mode\fP への ポインターである。
382 グローバルな vt の状態の情報を取得する。\fIargp\fPは、
387 unsigned short v_active; /* active vt */
388 unsigned short v_signal; /* signal to send */
389 unsigned short v_state; /* vt bit mask */
394 へのポインターである。 使用されているそれぞれの vt につき \fIv_state\fP の対応するビットが セットされる。 (カーネルl 1.0 から
401 \fIargp\fP (1 <= \fIargp\fP <= MAX_NR_CONSOLES)の vt に切替える。
404 \fIargp\fPの vt がアクティブになるまで待つ。
407 \fIargp\fP の vt に結びつけられたメモリーを解放する。 (カーネル 1.1.54 以降)
410 カーネルが認識するスクリーンサイズを設定する。\fIargp\fP は、
415 unsigned short v_rows; /* # rows */
416 unsigned short v_cols; /* # columns */
417 unsigned short v_scrollsize; /* no longer used */
422 へのポインターである。 これはビデオモードを変更しない事に注意。 \fBresizecons\fP(8) を見よ(カーネル 1.1.54 以降)。
425 カーネルが認識する各種のスクリーンパラメータを設定する。\fIargp\fP は、 以下の構造体へのポインターである。
430 unsigned short v_rows; /* number of rows */
431 unsigned short v_cols; /* number of columns */
432 unsigned short v_vlin; /* number of pixel rows
434 unsigned short v_clin; /* number of pixel rows
436 unsigned short v_vcol; /* number of pixel columns
438 unsigned short v_ccol; /* number of pixel columns
444 パラメータはゼロであってもよい。そのときは「変更しないこと」を 意味するが、複数のパラメータが設定された時にはそれらの間で矛盾が
445 ないようにしなければならない。 この関数呼び出しによってもビデオモードは変更されない事に注意。 \fBresizecons\fP(8) を参照の事(カーネル
448 以下の ioctl がどのように動作をするかは、\fIargp\fP が指す構造体の 最初のバイト(ここでは \fIsubcode\fP と呼ぶ)に依存する。
449 これらの呼出しは、スーパーユーザーか現在の端末のオーナにのみ許される。
451 \fBTIOCLINUX, subcode=0\fP
452 Dump the screen. Disappeared in 1.1.92. (With kernel 1.1.92 or later, read
453 from \fI/dev/vcsN\fP or \fI/dev/vcsaN\fP instead.)
455 \fBTIOCLINUX, subcode=1\fP
456 タスク情報を取得する。カーネル 1.1.92 でなくなった。
458 \fBTIOCLINUX, subcode=2\fP
459 選択を設定する。 \fIargp\fP が指すのは、
465 short xs, ys, xe, ye;
471 \fIxs\fP and \fIys\fP are the starting column and row. \fIxe\fP and \fIye\fP are the
472 ending column and row. (Upper left corner is row=column=1.) \fIsel_mode\fP is
473 0 for character\-by\-character selection, 1 for word\-by\-word selection, or 2
474 for line\-by\-line selection. The indicated screen characters are highlighted
475 and saved in the static array sel_buffer in \fIdevices/char/console.c\fP.
477 \fBTIOCLINUX, subcode=3\fP
478 選択したものをペーストする。 選択バッファ中の文字 が \fIfd\fP に書き出される。
480 \fBTIOCLINUX, subcode=4\fP
481 スクリーンをアンブランク(unblank)する。
483 \fBTIOCLINUX, subcode=5\fP
484 語毎の選択のための「語」中の文字を規定している 256 ビットのルックアップ テーブルの内容を設定する(カーネル 1.1.32 以降)。
486 \fBTIOCLINUX, subcode=6\fP
487 \fIargp\fP は文字変数を指すポインタで、その内容がカーネル変数 \fIshift_state\fPの値に設定される(カーネル 1.1.32 以降)。
489 \fBTIOCLINUX, subcode=7\fP
490 \fIargp\fP は文字変数を指すポインタで、その内容がカーネル変数 \fIreport_mouse\fP の値に設定される(カーネル 1.1.33 以降)。
492 \fBTIOCLINUX, subcode=8\fP
493 Dump screen width and height, cursor position, and all the
494 character\-attribute pairs. (Kernels 1.1.67 through 1.1.91 only. With
495 kernel 1.1.92 or later, read from \fI/dev/vcsa*\fP instead.)
497 \fBTIOCLINUX, subcode=9\fP
498 Restore screen width and height, cursor position, and all the
499 character\-attribute pairs. (Kernels 1.1.67 through 1.1.91 only. With
500 kernel 1.1.92 or later, write to \fI/dev/vcsa*\fP instead.)
502 \fBTIOCLINUX, subcode=10\fP
503 Handles the Power Saving feature of the new generation of monitors. VESA
504 screen blanking mode is set to \fIargp[1]\fP, which governs what screen
508 Screen blanking is disabled.
510 The current video adapter register settings are saved, then the controller
511 is programmed to turn off the vertical synchronization pulses. This puts
512 the monitor into "standby" mode. If your monitor has an Off_Mode timer,
513 then it will eventually power down by itself.
515 The current settings are saved, then both the vertical and horizontal
516 synchronization pulses are turned off. This puts the monitor into "off"
517 mode. If your monitor has no Off_Mode timer, or if you want your monitor to
518 power down immediately when the blank_timer times out, then you choose this
519 option. (\fICaution:\fP Powering down frequently will damage the monitor.)
523 On success, 0 is returned. On error, \-1 is returned, and \fIerrno\fP is set.
525 \fIerrno\fP は次のような値をとる:
531 ファイルディスクリプタがキャラクタ・スペシャルデバイスと関連付けられて いない。または、要求されたものがそれに当てはまらない。
534 ファイルディスクリプタまたは \fIargp\fP が無効。
539 \fBWarning\fP: Do not regard this man page as documentation of the Linux
540 console ioctls. This is provided for the curious only, as an alternative to
541 reading the source. Ioctl's are undocumented Linux internals, liable to be
542 changed without warning. (And indeed, this page more or less describes the
543 situation as of kernel version 1.1.94; there are many minor and not\-so\-minor
544 differences with earlier versions.)
546 Very often, ioctls are introduced for communication between the kernel and
547 one particular well\-known program (fdisk, hdparm, setserial, tunelp,
548 loadkeys, selection, setfont, etc.), and their behavior will be changed when
549 required by this particular program.
551 Programs using these ioctls will not be portable to other versions of UNIX,
552 will not work on older versions of Linux, and will not work on future
557 \fBdumpkeys\fP(1), \fBkbd_mode\fP(1), \fBloadkeys\fP(1), \fBmknod\fP(1), \fBsetleds\fP(1),
558 \fBsetmetamode\fP(1), \fBexecve\fP(2), \fBfcntl\fP(2), \fBioperm\fP(2), \fBtermios\fP(3),
559 \fBconsole\fP(4), \fBconsole_codes\fP(4), \fBmt\fP(4), \fBsd\fP(4), \fBtty\fP(4),
560 \fBtty_ioctl\fP(4), \fBttyS\fP(4), \fBvcs\fP(4), \fBvcsa\fP(4), \fBcharsets\fP(7),
561 \fBmapscrn\fP(8), \fBresizecons\fP(8), \fBsetfont\fP(8)
563 \fI/usr/include/linux/kd.h\fP, \fI/usr/include/linux/vt.h\fP
565 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
566 である。プロジェクトの説明とバグ報告に関する情報は
567 http://www.kernel.org/doc/man\-pages/ に書かれている。