The VMIN and VTIME c_cc values were incorrectly defined as MIN and TIME.

Obtained from: NetBSD PR# 3243
This commit is contained in:
Mike Pritchard 1997-03-14 05:01:14 +00:00
parent d06ae27bd3
commit ed7922d368

View File

@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)termios.4 8.4 (Berkeley) 4/19/94
.\" $Id$
.\" $Id: termios.4,v 1.4 1997/03/07 02:49:36 jmg Exp $
.\"
.Dd April 19, 1994
.Dt TERMIOS 4
@ -346,62 +346,62 @@ queue.
.Ss Noncanonical Mode Input Processing
In noncanonical mode input processing, input bytes are not assembled into
lines, and erase and kill processing does not occur. The values of the
.Dv MIN
.Dv VMIN
and
.Dv TIME
.Dv VTIME
members of the
.Fa c_cc
array are used to determine how to
process the bytes received.
.Pp
.Dv MIN
.Dv VMIN
represents the minimum number of bytes that should be received when
the
.Xr read 2
function successfully returns.
.Dv TIME
.Dv VTIME
is a timer of 0.1 second
granularity that is used to time out bursty and short term data
transmissions. If
.Dv MIN
.Dv VMIN
is greater than
.Dv \&{ Dv MAX_INPUT Ns \&} ,
the response to the
request is undefined. The four possible values for
.Dv MIN
.Dv VMIN
and
.Dv TIME
.Dv VTIME
and
their interactions are described below.
.Ss "Case A: MIN > 0, TIME > 0"
.Ss "Case A: VMIN > 0, VTIME > 0"
In this case
.Dv TIME
.Dv VTIME
serves as an inter-byte timer and is activated after
the first byte is received. Since it is an inter-byte timer, it is reset
after a byte is received. The interaction between
.Dv MIN
.Dv VMIN
and
.Dv TIME
.Dv VTIME
is as
follows: as soon as one byte is received, the inter-byte timer is
started. If
.Dv MIN
.Dv VMIN
bytes are received before the inter-byte timer expires
(remember that the timer is reset upon receipt of each byte), the read is
satisfied. If the timer expires before
.Dv MIN
.Dv VMIN
bytes are received, the
characters received to that point are returned to the user. Note that if
.Dv TIME
.Dv VTIME
expires at least one byte is returned because the timer would
not have been enabled unless a byte was received. In this case
.Pf \&( Dv MIN
.Pf \&( Dv VMIN
> 0,
.Dv TIME
.Dv VTIME
> 0) the read blocks until the
.Dv MIN
.Dv VMIN
and
.Dv TIME
.Dv VTIME
mechanisms are
activated by the receipt of the first byte, or a signal is received. If
data is in the buffer at the time of the
@ -409,27 +409,27 @@ data is in the buffer at the time of the
the result is as
if data had been received immediately after the
.Fn read .
.Ss "Case B: MIN > 0, TIME = 0"
.Ss "Case B: VMIN > 0, VTIME = 0"
In this case, since the value of
.Dv TIME
.Dv VTIME
is zero, the timer plays no role
and only
.Dv MIN
.Dv VMIN
is significant. A pending read is not satisfied until
.Dv MIN
.Dv VMIN
bytes are received (i.e., the pending read blocks until
.Dv MIN
.Dv VMIN
bytes
are received), or a signal is received. A program that uses this case to
read record-based terminal
.Dv I/O
may block indefinitely in the read
operation.
.Ss "Case C: MIN = 0, TIME > 0"
.Ss "Case C: VMIN = 0, VTIME > 0"
In this case, since
.Dv MIN
.Dv VMIN
= 0,
.Dv TIME
.Dv VTIME
no longer represents an inter-byte
timer. It now serves as a read timer that is activated as soon as the
read function is processed. A read is satisfied as soon as a single
@ -438,12 +438,12 @@ the timer expires, no bytes are returned. If the timer does not
expire, the only way the read can be satisfied is if a byte is received.
In this case the read will not block indefinitely waiting for a byte; if
no byte is received within
.Dv TIME Ns *0.1
.Dv VTIME Ns *0.1
seconds after the read is initiated,
the read returns a value of zero, having read no data. If data is
in the buffer at the time of the read, the timer is started as if
data had been received immediately after the read.
.Ss Case D: MIN = 0, TIME = 0
.Ss Case D: VMIN = 0, VTIME = 0
The minimum of either the number of bytes requested or the number of
bytes currently available is returned without waiting for more
bytes to be input. If no characters are available, read returns a
@ -1290,10 +1290,10 @@ If
.Dv ICANON
is not set, read requests are satisfied directly from the input
queue. A read is not satisfied until at least
.Dv MIN
.Dv VMIN
bytes have been
received or the timeout value
.Dv TIME
.Dv VTIME
expired between bytes. The time value
represents tenths of seconds. See
.Sx "Noncanonical Mode Input Processing"