WG15 Defect Report Ref: 9945-1-67
Topic: tcflow() tcflow


This is an approved interpretation of 9945-1:1990.

.

Last update: 1997-05-20


                                                                9945-1-90 #67
	Classification:  Duplicate of ISO/IEC 13210 #17


This is a duplicate, refer to interpretation to 13210 #17 (attached).

 _____________________________________________________________________________


	Topic:			tcflow()
	Relevant Sections:	7.2.2.2


Defect Report:
-----------------------

We request an official interpretation of the following item pertaining
to POSIX ISO/IEC 9945-1:1990 Part 1: System Application Program Interface.

The POSIX ISO/IEC 9945-1:1990 section 7.2.2.2 contains the following
statements:

	The tcflow() function shall suspend transmission or reception
	of data on the object referred to by fildes, depending on the
	value of action:

	    (1) If action is TCOOFF, it shall suspend output.

	    (2) If action is TCOON, it shall restart suspended output.

	    (3) If action is TCIOFF, the system shall transmit a STOP 
		character, which is intended to cause the terminal 
		device to stop transmitting data to the system. 
		(See the description of IXOFF in 7.1.2.2.)

	    (4) If action is TCION, the system shall transmit a START
		character, which is intended to cause the terminal 
		device to start transmitting data to the system. 
		(See the description of IXOFF in 7.1.2.2.)


The problem found is items (3) and (4) could be interpretted two ways.

	Interpretation One:

	    (3) If action is TCIOFF, WHETHER OUTPUT IS SUSPENDED OR NOT,
		the system shall transmit a STOP character, which 
		is intended to cause the terminal device to stop
		transmitting data to the system. 
		(See the description of IXOFF in 7.1.2.2.)

	    (4) If action is TCION, WHETHER OUTPUT IS SUSPENDED OR NOT,
		the system shall transmit a START character, which 
		is intended to cause the terminal device to start
		transmitting data to the system. 
		(See the description of IXOFF in 7.1.2.2.)

	Interpretation Two:

	    (3) If action is TCIOFF, AND OUTPUT IS NOT SUSPENDED,
		the system shall transmit a STOP character, which 
		is intended to cause the terminal device to stop
		transmitting data to the system. 
		(See the description of IXOFF in 7.1.2.2.)

	    (4) If action is TCION, AND OUTPUT IS NOT SUSPENDED,
		the system shall transmit a START character, which 
		is intended to cause the terminal device to start
		transmitting data to the system. 
		(See the description of IXOFF in 7.1.2.2.)


The ISO/IEC 13210:1994 section 7.2.2.3.2 test assertions [07,08] assume
"Interpretation One."  This interpretation expects a tty device which has
had its output suspended by the action of TCOOFF, item (1), to transmit
the STOP/START character so that it is made available to a read() on 
another tty device (even though output is suspended).

If "Interpretation Two" was assumed, a tty device which has had its output
suspended by the action of TCOOFF, item (1), would accept but not transmit 
the STOP/START character until suspended output had been restarted by
the action of TCOON, item (2).  Only then would it be transmitted and made
available to a read() on another tty device.

The POSIX Std 9945-1:1990 does not clearly state the behavior of items
(3) and (4) when item (1) is in effect.


Which interpretation is intended by POSIX ISO/IEC 9945-1:1990?


(Steve Korsness				e-mail: korsness@sequent.com)


WG15 response for ISO/IEC 9945-1:1990 (IEEE Std 1003.1-1990)
-----------------------------------
This is a duplicate of 13210 #17, see attachment below:



 _____________________________________________________________________________
                                                ISO/IEC Interpretation reference
                                                                13210-92 #17
	Classification:  No change

 _____________________________________________________________________________


	Topic:			tcflow
	Relevant Sections:	7.2.2.3.2


Defect Report:
-----------------------

The ISO/IEC 13210:1994 section 7.2.2.3.2 has the following
assertions.

          07  A call to tcflow(fildes,TCIOFF) causes the system to transmit
          a STOP character, and the  return value is zero.

          Testing Requirement(s):
              Test when the data transmission on the line is suspended
              and is not suspended.

          08  A call to tcflow(fildes,TCION) causes the system to transmit
          a START character to restart suspended input, and the
          return value is zero.

          Testing Requirement(s):
              Test when the data transmission on the line is suspended
              and is not suspended.

The problem lies in the testing requirements, for sending a
STOP character when the line is already suspended, and for
sending a START character when the line is not suspended.


The testing requirement makes additional implementation
restrictions beyond that specified in ISO/IEC POSIX
9945-1:1990.  We would request that these assertions be
reworded to:

          07  A call to tcflow(fildes,TCIOFF) causes the system to transmit
          a STOP character, and the  return value is zero.

          Testing Requirement(s):
              Test when the data transmission on the line is not suspended.

          08  A call to tcflow(fildes,TCION) causes the system to transmit
          a START character to restart suspended input, and the
          return value is zero.

          Testing Requirement(s):
              Test when the data transmission on the line is suspended.



WG15 response for 13210:1994
--------------------------------------------------


The testing requirements are correct as they are now written.  They
refer to suspension of output on the line.

ISO/IEC 9945-1:1990 provides for programmatic flow control on
terminals that use asynchronous serial data transmission through
the tcflow() interface (7.2.2.2: page 146, lines 697-706).  The
specifications for output control (requests TCOOFF and TCOON)
define a persistent state of "suspended output", such that a
call to tcflow(fildes, TCOOFF) causes output to be suspended and
the output stays suspended until a call is made to
tcflow(fildes, TCOON).

The specifications for input flow control say simply that a STOP
character or a START character be sent for tcflow(fildes,
TCIOFF) and tcflow(fildes, TCION), respectively.

These STOP and START characters are intended to be sent to the
terminal at the remote end of the line.  This means that STOP or
START must be transmitted whether or not output is suspended.

The text of the testing requirements would be easier to
understand if they referred specifically to suspension of
output.


Rationale for Interpretation:
-----------------------------

The output to a terminal is produced by processes on the local
system.  Therefore, tcflow() can control suspension or
resumption of output unconditionally.  The case is different for
input, which is generated by a remote device that is ordinarily
not under the direct control of the system.  For input, tcflow()
sends the STOP and START characters to request that the remote
device suspend or resume transmission.

Note that in the descriptions of the four possible actions for
tcflow() in ISO/IEC 9945-1:1990 697-706) neither the TCION nor
the TCIOFF action is conditional on whether output is
suspended.  This means that the START and STOP characters are
treated as special characters, and are not considered to be
output.

There is also a definite advantage to users in requiring
unconditional sending of START and STOP because
this is what makes it possible for an application
to regain control of a terminal connection that
has become confused because of flow control problems.

 _____________________________________________________________________________