View Issue Details

IDProjectCategoryView StatusLast Update
00001371003.1(2004)/Issue 6System Interfacespublic2013-04-16 13:06
Reportergeoffclare Assigned Toajosey  
PrioritynormalSeverityCommentTypeClarification Requested
Status ClosedResolutionAccepted As Marked 
NameGeoff Clare
OrganizationThe Open Group
User ReferencePR2549
Sectiontempnam
Page Number1532
Line Number47701
Interp StatusApproved
Final Accepted Text0000137:0000207
Summary0000137: Can tempnam() use more than one i-d directory?
DescriptionThe description of tempnam() states:

    "If dir is a null pointer or points to a string which is not a
    name for an appropriate directory, the path prefix defined as
    P_tmpdir in the <stdio.h> header shall be used. If that directory
    is not accessible, an implementation-defined directory may be used."

The way this is worded carries an implication (although not a strong
one) that there can only be one such implementation-defined directory.
However, it seems likely that this was accidental rather than a
deliberate intention to restrict tempnam() to one i-d directory.

Some implementations try more than one additional directory if
P_tmpdir is not accessible. This seems like a useful feature, and
the wording should be clarified to explicitly allow it.
Desired ActionChange "an implementation-defined directory"
to "one or more implementation-defined directories"

(Note that in XSH7 this text is at page 2102 line 66520.)
Tagstc1-2008

Activities

nick

2009-08-27 16:01

manager   bugnote:0000207

Last edited: 2009-10-12 06:14

Interpretation response
------------------------
The standard clearly state that this is implementation defined and conforming implementations must conform to this.

Rationale:
---------
"Implementation defined" permits the implementation to use any appropriate means to select an alternative directory, including selecting one entry from a list.

The standards developers do not see any need to change the current wording; indeed, the proposed change suggests that an implementation might want to use multiple directories at the same time, which is not the intent. The implementation may pick one of a potentially infinite set of accessible directories.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------

Add mkdtemp() and mkstemp() to the See Also list.
In the example (issue 7 lines 66534-66535) make the "directory" and "fileprefix" variables const.

   const char *directory = "/tmp";
   const char *fileprefix = "file";


Issue History

Date Modified Username Field Change
2009-08-25 15:08 geoffclare New Issue
2009-08-25 15:08 geoffclare Status New => Under Review
2009-08-25 15:08 geoffclare Assigned To => ajosey
2009-08-25 15:08 geoffclare Name => Geoff Clare
2009-08-25 15:08 geoffclare Organization => The Open Group
2009-08-25 15:08 geoffclare User Reference => PR2549
2009-08-25 15:08 geoffclare Section => tempnam
2009-08-25 15:08 geoffclare Page Number => 1532
2009-08-25 15:08 geoffclare Line Number => 47701
2009-08-27 16:01 nick Note Added: 0000207
2009-08-27 16:02 nick Interp Status => ---
2009-08-27 16:02 nick Final Accepted Text => 0000137:0000207
2009-08-27 16:02 nick Status Under Review => Interpretation Required
2009-08-27 16:02 nick Resolution Open => Accepted As Marked
2009-08-27 16:06 nick Note Edited: 0000207
2009-08-27 16:08 nick Note Edited: 0000207
2009-08-27 16:12 nick Interp Status --- => Pending
2009-10-12 06:14 ajosey Note Edited: 0000207
2009-10-12 06:14 ajosey Interp Status Pending => Approved
2010-09-03 20:37 Don Cragun Tag Attached: tc1-2008
2013-04-16 13:06 ajosey Status Interpretation Required => Closed