WARNING: ioctl's are undocumented Linux internals, liable to be changed without warning. Use POSIX functions.
The following Linux-peculiar ioctl() requests are supported. Each requires a third argument, assumed here to be argp.
LED_CAP 0x04 caps lock led
LEC_NUM 0x02 num lock led
LED_SCR 0x01 scroll lock led
Before 1.1.54, the leds just reflected the state of the corresponding keyboard flags, and KDGETLED/KDSETLED would also change the keyboard flags. Since 1.1.54 the leds can be made to display arbitrary information, but by default they display the keyboard flags. The following two ioctl's are used to access the keyboard flags.
KD_TEXT 0x00
KD_GRAPHICS 0x01
struct unimapdesc { u_short entry_ct; struct unipair *entries; };
where entries points to an array of
struct unipair { u_short unicode; u_short fontpos; };
(Since 1.1.92.)
struct unimapinit { u_short advised_hashsize; /* 0 if no opinion */ u_short advised_hashstep; /* 0 if no opinion */ u_short advised_hashlevel; /* 0 if no opinion */ };
(Since 1.1.92.)
K_RAW 0x00
K_XLATE 0x01
K_MEDIUMRAW 0x02
K_UNICODE 0x03
K_METABIT 0x03 set high order bit
K_ESCPREFIX 0x04 escape prefix
struct kbentry { u_char kb_table; u_char kb_index; u_short kb_value; };
with the first two members filled in: kb_table selects the key table (0 <= kb_table < MAX_NR_KEYMAPS), and kb_index is the keycode (0 <= kb_index < NR_KEYS). kb_value is set to the corresponding action code, or K_HOLE if there is no such key, or K_NOSUCHMAP if kb_table is invalid.
struct kbsentry { u_char kb_func; u_char kb_string[512]; };
kb_string is set to the (NULL terminated) string corresponding to the kb_functh function key action code.
struct kbdiacrs { unsigned int kb_cnt; struct kbdiacr kbdiacr[256]; };
where kb_cnt is the number of entries in the array, each of which is a
struct kbdiacr { u_char diacr, base, result; };
struct kbkeycode { unsigned int scancode, keycode; };
keycode is set to correspond to the given scancode. (89 <= scancode <= 255 only. For 1 <= scancode <= 88, keycode==scancode.) (Since 1.1.63.)
struct vt_mode { char mode; /* vt mode */ char waitv; /* if set, hang on writes if not active */ short relsig; /* signal to raise on release req */ short acqsig; /* signal to raise on acquisition */ short frsig; /* unused (set to 0) */ };
mode is set to one of these values:
VT_AUTO auto vt switching
VT_PROCESS process controls switching
VT_ACKACQ acknowledge switch
struct vt_stat { ushort v_active; /* active vt */ ushort v_signal; /* signal to send */ ushort v_state; /* vt bitmask */ };
For each vt in use, the corresponding bit in the v_state member is set. (Kernels 1.0 through 1.1.92.)
struct vt_sizes { ushort v_rows; /* # rows */ ushort v_cols; /* # columns */ ushort v_scrollsize; /* no longer used */ };
(Since 1.1.54.) Note that this does not change the videomode. See resizecons(8).
The action of the following ioctls depends on the first byte in the struct pointed to by argp, referred to here as the subcode. These are legal only for the superuser or the owner of the current tty.
struct {char subcode;
short xs, ys, xe, ye;
short sel_mode;
}
xs and ys are the starting column and row. xe and ye are the ending column and row. (Upper left corner is row=column=1.) sel_mode 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 devices/char/console.c.
0: Screen blanking is disabled.
1: 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 "standby" mode.
If your monitor has an Off_Mode timer, then
it will eventually power down by itself.
2: The current
settings are saved, then both the vertical and horizontal
synchronization pulses are turned off.
This puts the monitor into "off" 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.
(Caution: Powering down frequently will damage the monitor.)
(Since 1.1.76.)
Programs using these ioctl's 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.
Use POSIX functions.