WG15 Defect Report Ref: 14519-07
Topic: Can IS_A_TERMINAL detect/report errors?

This is an approved interpretation of 14519:1994.


Last update: 1997-05-20

                                                                14519-92 #7

	Class: Defect situation

The standard requires different behavior to the C language binding
for conforming implementations. This  is being
referred to the sponsor for clarifying wording in the next amendment.


	Topic:			Can IS_A_TERMINAL detect/report errors?
	Relevant Sections:	ISO/IEC 14519:1994:  section 6.1.4,
			     	ISO/IEC 9945-1:1990:  section 4.7.2

Defect Report:

ISO/IEC 9945-1 does not specify that isatty() can detect or report
any errors.  ISO/IEC 14519 specifies errors that are required to be
detected/reported by IS_A_TERMINAL.

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

The standard is currently incorrect, in that it should not require
Is_A_Terminal to detect any errors.  However, Is_A_Terminal is still
required to return True if it can 'prove' that the parameter File is
associated with a terminal.

Conforming applications should not assume that a value of False
returned by Is_A_Terminal indicates that no errors as specified in
POSIX.5 6.1.4 were detected.  

Rationale for Interpretation:

POSIX.1 clearly does not require error checking, but it strongly
implies that a 'success' value (1) can be trusted.  A failure value
means either that the file descriptor is not a terminal, or that some
other error occurred.  Therefore, conforming POSIX.5 applications can
depend on the value True indicates a terminal device, but cannot apply
any additional meaning to the value False returned by Is_A_Terminal.

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

This wording will be corrected in the 14519 revision.