IEEE Standards Interpretations for IEEE Std 1003.1™-2001 IEEE Standard for Information Technology - Portable Operating System Interface (POSIX®)
Copyright © 2006 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 #5
Topic: Defect in XSH unlink Relevant Sections: unlink
The unlink() function defines the following error condition [EPERM] The file named by path is a directory, and either the calling process does not have appropriate privileges, or the implementation prohibits using unlink() on directories. The EISDIR error condition would also seem an appropriate error to return in the case when unlink() is attempted on a directory. Is an implementation conforming that returns EISDIR rather than EPERM ? A certain body of implementors believe that this is the more natural error code to expect in this case.
The standard is clear on the requirements, however concerns should be forwarded to the sponsor to consider allowing the EISDIR error.
Applications receiving an error should be able to cope with any unexpected error code. The EISDIR code would seem a logical return.
The standard clearly states that unlink() on a directory returns EPERM for this condition,and conforming implementations must conform to this.
Rationale for Interpretation
The standard is clear. Only EPERM is defined for this error. To make a change would reduce the consensus.