WG15 Defect Report Ref: 14519-05
Topic: Behavior of Read when interrupted by a signal


This is an approved interpretation of 14519:1994.

.

Last update: 1997-05-20


                                                                14519-92 #5

Class: Ambiguous

The standard is unclear on this issue, and no  conformance distinction
can be made on alternative implementations based on this. It is thus
possible that the standard could be read to conflict with the C language
binding, which was not the intent. This will be referred to the sponsor
for clarifying wording in the next amendment.

 _____________________________________________________________________________


	Topic:			Behavior of Read when interrupted by a signal
	Relevant Sections:	ISO/IEC 14519:1994:  section 6.1.2,
			     	ISO/IEC 9945-1:1990:  section 6.4.1.2


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

What exactly is the behavior of a read operation when interrupted by a
signal?  Is it partial read with a normal return, or is POSIX_ERROR
raised with the error code INTERRUPTED_BY_SIGNAL?

WG15 response for 9945-1:1990 (9945-1:1990):
--------------------------------------------------

POSIX.1, lines 125-128, clarifies the exact behavior of read() in the
face of signals.  EINTR is returned if -NO- data can be read,
otherwise a partial read occurs.  

POSIX.5 does not make this distinction clear, but the intent is to
match POSIX.1.  Therefore, POSIX_Error (error code
Interrupted_Operation) shall be raised when the operation is
interrupted by a signal and no data has been transferred.  If some
data has been transferred, and the operation is interrupted by a
signal, then Read shall transfer this data into Buffer and return the
number of elements transferred in the parameter Last.

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

POSIX.5 does not prohibit the behavior specified in POSIX.1, nor does
it make it clear.  This interpretation clarifies the exact behavior of
POSIX.5 to match POSIX.1.


Editorial note for future revision of standard (not part of the interpretation)
-------------------------------------------------------------------------------

We will add text to make this distinction clear in the 14519 revision.


 _____________________________________________________________________________