IEEE Standards Interpretation for IEEE Std 1003.1™-1990 IEEE Standard for Information Technology--Portable Operating System Interfaces (POSIX®)
Copyright © 2001 by the Institute of Electrical and Electronics Engineers, Inc. 3 Park Avenue New York, New York 10016-5997 USA All Rights Reserved.
Interpretations are issued to explain and clarify the intent of a standard and do not constitute an alteration to the original standard. In addition, interpretations are not intended to supply consulting information. Permission is hereby granted to download and print one copy of this document. Individuals seeking permission to reproduce and/or distribute this document in its entirety or portions of this document must contact the IEEE Standards Department for the appropriate license. Use of the information contained in this document is at your own risk.
IEEE Standards Department Copyrights and Permissions 445 Hoes Lane, Piscataway, New Jersey 08855-1331, USA
Interpretation Request #6
Topic: order of error numbers Relevant Sections: 2.4, 188.8.131.52
In 2.4 Error Numbers, page 23, lines 508-510:
"If more than one error occurs in processing a function call, this part of ISO/IEC 9945 does not define in what order the errors are detected; therefore any one of the possible errors may be returned."
In 184.108.40.206 Errors [Execute a file], page 45, lines 178-182 and
page 46, lines 195-196:
"[EACCES] ... ... [ENOEXEC] The new process image has the appropriate access permissions, but is not in the proper format."
The definition of the error condition corresponding to [ENOEXEC] excludes the possibility that it can co-occur with [EACCES]. Nevertheless, it seems to clearly violate the spirit of the more general requirement, that the order of detection of error conditions not be specified. Is there a conflict here?
If an ENOEXEC error can be generated, then the file must have the correct access permissions, so the EACCES error cannot occur. If the file does not have the correct access permissions, then EACCES will occur. There is no conflict.
Rationale for Interpretation
The wording in section 2.4 applies only to errors that can co-occur. The wording in section 220.127.116.11 indeed excludes the possibility that the [ENOEXEC] and [EACCES] errors can co-occur. This simply means that the wording in section 2.4 does not apply to this case. There is no "spirit" of section 2.4 that is violated here. There are several places in the standard where one error condition is explicitly worded so that it cannot co-occur with another error condition. This is often necessary either to give the caller useful feedback on error conditions or to prevent violations of access restrictions. The purpose of the wording in section 2.4 is to avoid implicit and unnecessary requirements on implementations, and the assumption of such requirements by application writers. The purpose is not to prevent the standard from making explicit, useful requirements.