Interpretations

Answering questions that may arise related to the meaning of portions of an IEEE standard concerning specific applications.

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 #74
Topic: tmpfile Relevant Sections: 8.2.3.9

Section 8.2.3.9 tmpfile(), line 398-399 describes the tmpfile() function as "tmpfile() shall allocate a file descriptor as fopen() does". The fopen() descriptions states "The fopen() function shall allocate a file descriptor as open() does". Many common implementations return a file descriptor for an unlinked file. Is it conforming for tmpfile() to call open() with a mode of zero, so that the temporary file created in the file namespace prior to unlinking be protected from access by other users ?

POSIX 2003.1 has an assertion 8.2.3.9-05(B) that would say that it is not conforming; the assertion states: "When a call to tmpfile() creates a file, then the file permission bits are set to allow both reading and writing for owner, for group, and for other users except for those bits set in the process's file mode creation mask. No execute (search) permission bits are set. The user ID of the file is set to the process's effective user ID and the group ID of the file is set to the process's effective group ID or to the group owner of its parent directory." This assertion relates to the references between tmpfile() -> fopen() -> open(). It appears to us that this requirement is beyond the specification in P1003.1 for tmpfile() which is to allocate a file descriptor and that this requirement in P2003.1 should be noted as incorrect.

Interpretation Response
Yes it is conforming. The standard clearly does not require a particular implementation of tmpfile(), just that a file descriptor be allocated. This is a conflict between the 1003.1-1990 base standard and the 2003.1-1992 test method standard. The test method standard clearly indicates that a conforming test suite is required to test this, however the base standard indicates that a conforming implementation may fail such a test. This situation is being referred to the sponsor(s).

Rationale for Interpretation
None.