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