PASC Interpretation Ref: pasc-1003.5-06
Topic: Can implementation errors raise POSIX_ERROR?


This is an unapproved interpretation of PASC P1003.5-1992.

Use of the information contained in this unapproved document is at your own risk.

Last update: 04 September,1996


                                                                1003.5-92 #6

Class: No change

This response will be incorporated in an IEEE interpretations
publication, and will be also made available on-line on the IEEE 
SPAsystem.

 _____________________________________________________________________________


	Interpretation Number:	XXXX
	Topic:			Can implementation errors raise POSIX_ERROR?
	Relevant Sections:	IEEE Std 1003.5-1992:  section 2.4.4


Interpretation Request:
-----------------------

The standard is not clear on whether an implementation may raise
POSIX_ERROR for implementation-defined and detected error conditions.

IEEE Interpretation for 1003.1-1990 (9945-1:1990):
--------------------------------------------------

Implementations may raise POSIX_Error for implementation-defined error
conditions.  

Implementations may return implementation-defined values of type
Error_Code.  However, an implementation-defined value must not
conflict with a POSIX-defined value.  The implementation-defined
values of type Error_Code may not defined in package POSIX; they must
be defined in an implementation-specific package.  The function
POSIX.Image on Error_Code should return the constant named defined in
the implementation-defined package.

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

This is the intent, and is the reason why the type Error_Code is
defined to permit implementation extensions, as documented in the
rationale.   For instance, if the implementation wishes to add a new
error condition "Kernel_Is_Trashed", it should define
a package akin to the following:

     with POSIX;
     package Implementation_Errors is

         Kernel_Is_Trashed : constant POSIX.Error_Code
     	   	 	       	            := 42; 
     	   -- value must not conflict with values in package POSIX

     end Implementation_Errors;

The function POSIX.Image (Implementation_Errors.Kernel_Is_Trashed)
should return the string "Kernel_Is_Trashed" (and not 
"Implementation_Errors.Kernel_Is_Trashed").

Note that a nice feature of Ada9X will be that the
implementation-defined error codes can be defined in a child package
of package POSIX.  However, this is not supported by Ada83, and this
is an Ada83 binding.


 _____________________________________________________________________________