VTIME
VTIME is a control parameter used in the POSIX termios interface on Unix-like systems. It is an index into the c_cc array and works together with VMIN to govern the behavior of read() when terminal input is in noncanonical mode (i.e., when ICANON is not set).
In practice, VTIME specifies a timeout for input in tenths of a second, stored as an unsigned
How to use it. Programs typically obtain, modify, and apply terminal attributes with tcgetattr and tcsetattr
Behavior summary. When ICANON is disabled:
- If VMIN > 0 and VTIME > 0, read() blocks until at least VMIN characters are available or
- If VTIME == 0, read() blocks until VMIN characters are available.
- If VMIN == 0 and VTIME > 0, read() may return as soon as data is available, or
Note that exact behavior can differ slightly across systems, so consulting system-specific documentation is advised.
VTIME, together with VMIN, provides fine-grained control over input latency for interactive or serial-style programs.