Expand description
Character device contracts, including the terminal line discipline controls.
§Terminal control commands (kind b'T')
| Number | Command | Direction | Input | Output | Effect |
|---|---|---|---|---|---|
0x00 | IS_A_TERMINAL | Read | () | u8 | Whether the device is an interactive terminal (0 or 1). |
0x01 | GET_TERMINAL_ATTRIBUTES | Read | () | TerminalAttributes | Returns the current line discipline settings. |
0x02 | SET_TERMINAL_ATTRIBUTES | Read | TerminalAttributes | () | Applies new line discipline settings. |
These commands play the role of POSIX tcgetattr and tcsetattr.
SET_TERMINAL_ATTRIBUTES is declared with the Read direction on purpose:
a program changes the settings of its standard input, which is opened
read-only, just as tcsetattr accepts a read-only descriptor. The VFS
requires write access only for commands declared Write.
A device that has no line discipline answers both commands with
Unsupported; callers then keep their usual behaviour. A device
rejects flags it does not know with InvalidArgument, so a program can
tell when a setting it asked for is not available.
Structs§
- GET_
TERMINAL_ ATTRIBUTES - IS_
A_ TERMINAL - SET_
TERMINAL_ ATTRIBUTES - Terminal
Attributes - Terminal line discipline settings, exchanged by
GET_TERMINAL_ATTRIBUTESandSET_TERMINAL_ATTRIBUTES. - Terminal
Flags - Line discipline switches of a terminal, see
TerminalAttributes.