Defect Report concerning: IEEE Std. 1003.1c-1995, ISO/IEC 9945-1:1990 AMD 2 - Threads
Clause: 5.3.1.2 p 119 ll 225- , 15.2.1.2 p 322 ll 124-
PASC Interpretation Ref: pasc-1003.1c-48
Topic: open O_EXCL, mq_open O_EXCL


This is an unapproved interpretation of PASC 1003.1c-1995, ISO/IEC 9945-1:1990 AMD 2 - Threads.

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

Last update: 30 March,1998


								1003.1c-95  #48

 _____________________________________________________________________________

	Interpretation Number:	XXXX
        Topic:                  open O_EXCL, mq_open O_EXCL
        Relevant Sections:      5.3.1.2 p 119  ll 225- , 15.2.1.2 p 322 ll 124-

PASC Interpretation Request: (Defect Report)
----------------------------  

	From: David Butenhof
	Date: 1997 Oct 24


WG15 Status Block (official use only):
------------------------------------------------------------------------
 1  Defect report number: IS9945-1:1996 #1c-48

 2  Submitter:  IEEE PASC
		December 5th 1997

 3  Addressed to: JTC1/SC22  /WG15
                 editor's group on IS 9945-1

 4  WG secretariat:
------------------------------------------------------------------------
 5  Date circulated by WG secretariat:

 6  Deadline on response from editor:

------------------------------------------------------------------------ 

 7  Defect Report concerning (number and title of International Standard
    or DIS final text, if applicable): 

IEEE Std 1003.1-1996 (incorporates 1003.1-1990, 1003.1b-1993, 1003.1c-1995, 1003.1i-1995) (ISO 9945-1:1996)

------------------------------------------------------------------------ 

 8  Qualifier (e.g. error, omission, clarification required):

1

Error=1 , Omission=2, Clarification=3

------------------------------------------------------------------------ 

 9  References in document (e.g. page, clause, figure, and/or table
    numbers):

Pages 119 and 322, O_EXCL option

------------------------------------------------------------------------ 

10  Nature of defect (complete, concise explanation of the perceived
    problem):


These two sections represent yet another case where the word "process"
should have been changed to "thread".

The description of O_EXCL says that the open shall fail if the file
exists, and that "The check for the existence of the file and the
creation of the file if it does not exist shall be atomic with respect
to other processes [...]".


------------------------------------------------------------------------ 

11  Solution proposed by the submitter (optional):

Clearly, in the context of POSIX threads, this guarantee is of no
value should multiple threads within the same process be attempting to
open a file with O_EXCL. It should guarantee that "The check [...]
shall be atomic with respect to other threads [...]".

Although we haven't found a lot of these errors since the release of
1003.1-1996, it seems counterproductive to deal with each separately.
I would like to suggest a grep of the entire POSIX 1003.1 document
source for the word "process", followed by an attempt by "someone"
(the interpretations group, perhaps) to determine whether each match
is valid or should be changed.



------------------------------------------------------------------------ 



Interpretation response
----------------------------------
The standards states that this is atomic with respect to processes
executing open() or  mq_open() , however this is a defect in the standard and
concerns have been raised about this which are being referred to the sponsor.

The interpretation committee believes that the intent of the working
and balloting groups was to require this to be atomic with respect to
the thread and not the process.

Rationale
-------------
None.


Notes to project editor (not part of this interpretation)
----------------------------------------------------------
Proposed change (as per section 11 above)

Change the sentence on page 119 ll 227-228
from 
"with respect to other processes executing open()"
to
"with respect to other threads executing open()"

Change the sentence on page 322 ll 127-128
from 
"with respect to other processes executing mq_open()"
to
"with respect to other threads executing mq_open()"

Its recommend that in future a pass be made through the entire
POSIX 1003.1 document source for the word "process" to check
its use.
------------------------------------------------------------------------
12  Editor's response (any material proposed for processing as a
    technical corrigendum to, an amendment to, or a commentary on the
    International Standard or DIS final text is attached separately to
    this completed report):
                                                         
	See interpretation response above
------------------------------------------------------------------------

Forwarded to Interpretations gRoup: Oct 24 1997
Finalised: December 8th 1997