---
name: "TIOCLINUX"
section: "2const"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/TIOCLINUX"
---

# TIOCLINUX(2const)

ioctls for console terminal and virtual consoles

## NAME

TIOCLINUX - ioctls for console terminal and virtual consoles

## SYNOPSIS

```
#include <linux/tiocl.h>  /* Definition of TIOCL_* constants */
#include <sys/ioctl.h>
```

**int ioctl(int** *fd***, TIOCLINUX, void \****argp***);**

## DESCRIPTION

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 terminal.

- **subcode**=**0**

  Dump the screen. Disappeared in Linux 1.1.92. (With Linux 1.1.92 or later, read from */dev/vcs*N or */dev/vcsa*N instead.)

- **subcode**=**1**

  Get task information. Disappeared in Linux 1.1.92.

- **subcode**=**TIOCL\_SETSEL**

  Set selection. *argp* points to a

-

  ```
  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* may be one of the following operations:

  - **TIOCL\_SELCHAR**

    Select character-by-character. The indicated screen characters are highlighted and saved in a kernel buffer.

  -

    Since Linux 6.7, using this selection mode requires the **CAP\_SYS\_ADMIN** capability.

  - **TIOCL\_SELWORD**

    Select word-by-word, expanding the selection outwards to align with word boundaries. The indicated screen characters are highlighted and saved in a kernel buffer.

  -

    Since Linux 6.7, using this selection mode requires the **CAP\_SYS\_ADMIN** capability.

  - **TIOCL\_SELLINE**

    Select line-by-line, expanding the selection outwards to select full lines. The indicated screen characters are highlighted and saved in a kernel buffer.

  -

    Since Linux 6.7, using this selection mode requires the **CAP\_SYS\_ADMIN** capability.

  - **TIOCL\_SELPOINTER**

    Show the pointer at position (*xs*, *ys*) or (*xe*, *ye*), whichever is later in text flow order.

  - **TIOCL\_SELCLEAR**

    Remove the current selection highlight, if any, from the console holding the selection.

  -

    This does not affect the stored selected text.

  - **TIOCL\_SELMOUSEREPORT**

    Make the terminal report (*xs*, *ys*) as the current mouse location using the [**xterm**(1)](/xterm/1.md) mouse tracking protocol (see [**console\_codes**(4)](/console_codes/4.md)). The lower 4 bits of *sel\_mode* (**TIOCL\_SELBUTTONMASK**) indicate the desired button press and modifier key information for the mouse event.

  -

    If mouse reporting is not enabled for the terminal, this operation yields an **EINVAL** error.

  -

    Since Linux 6.7, using this selection mode requires the **CAP\_SYS\_ADMIN** capability.

- **subcode**=**TIOCL\_PASTESEL**

  Paste selection. The characters in the selection buffer are written to *fd*.

-

  Since Linux 6.7, using this subcode requires the **CAP\_SYS\_ADMIN** capability.

- **subcode**=**TIOCL\_UNBLANKSCREEN**

  Unblank the screen.

- **subcode**=**TIOCL\_SELLOADLUT**

  Sets contents of a 256-bit look up table defining characters in a "word", for word-by-word selection. (Since Linux 1.1.32.)

-

  Since Linux 6.7, using this subcode requires the **CAP\_SYS\_ADMIN** capability.

- **subcode**=**TIOCL\_GETSHIFTSTATE**

  *argp* points to a char which is set to the value of the kernel variable *shift\_state*. (Since Linux 1.1.32.)

- **subcode**=**TIOCL\_GETMOUSEREPORTING**

  *argp* points to a char which is set to the value of the kernel variable *report\_mouse*. (Since Linux 1.1.33.)

- **subcode**=**8**

  Dump screen width and height, cursor position, and all the character-attribute pairs. (Linux 1.1.67 through Linux 1.1.91 only. With Linux 1.1.92 or later, read from */dev/vcsa\** instead.)

- **subcode**=**9**

  Restore screen width and height, cursor position, and all the character-attribute pairs. (Linux 1.1.67 through Linux 1.1.91 only. With Linux 1.1.92 or later, write to */dev/vcsa\** instead.)

- **subcode**=**TIOCL\_SETVESABLANK**

  Handles the Power Saving feature of the new generation of monitors. VESA screen blanking mode is set to *argp\[1\]*, which governs what screen blanking does:

  - **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 Linux 1.1.76.)

- **subcode**=**TIOCL\_SETKMSGREDIRECT**

  Change target of kernel messages ("console"): by default, and if this is set to **0**, messages are written to the currently active VT. The VT to write to is a single byte following **subcode**. (Since Linux 2.5.36.)

- **subcode**=**TIOCL\_GETFGCONSOLE**

  Returns the number of VT currently in foreground. (Since Linux 2.5.36.)

- **subcode**=**TIOCL\_SCROLLCONSOLE**

  Scroll the foreground VT by the specified amount of *lines* down, or half the screen if **0**. *lines* is \*(((int32\_t \*)&subcode) + 1). (Since Linux 2.5.67.)

- **subcode**=**TIOCL\_BLANKSCREEN**

  Blank the foreground VT, ignoring "pokes" (typing): can only be unblanked explicitly (by switching VTs, to text mode, etc.). (Since Linux 2.5.71.)

- **subcode**=**TIOCL\_BLANKEDSCREEN**

  Returns the number of VT currently blanked, **0** if none. (Since Linux 2.5.71.)

- **subcode**=**16**

  Never used.

- **subcode**=**TIOCL\_GETKMSGREDIRECT**

  Returns target of kernel messages. (Since Linux 2.6.17.)

- **subcode**=**TIOCL\_GETBRACKETEDPASTE**

  Returns **1** if the application advertised bracketed paste compatibility to the terminal, **0** otherwise. (Since Linux 6.16.)

## RETURN VALUE

On success, 0 is returned (except where indicated). On failure, -1 is returned, and *errno* is set to indicate the error.

## ERRORS

- **EINVAL**

  *argp* is invalid.

- **EPERM**

  Insufficient permission.

## STANDARDS

Linux.

## SEE ALSO

[**ioctl**(2)](/ioctl/2.md), [**ioctl\_console**(2)](/ioctl_console/2.md)
