Use of the information contained in this unapproved document is at your own risk
.Last update: 10 April,2001
1003.1-96 #86
_____________________________________________________________________________
Interpretation Number: XXXX
Topic: pthread.h and namespace
Relevant Sections: Clauses 11.3 and 11.4 in POSIX.1-1996, P252-266
Interpretation Request: (Defect Report)
-----------------------
Date: Wed, 25 Feb 1998 12:16:12 -0600
From: Don.Cragun@eng.sun.com
------------------------------------------------------------------------
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):
2
Error=1 , Omission=2, Clarification=3
------------------------------------------------------------------------
9 References in document (e.g. page, clause, figure, and/or table
numbers):
Clauses 11.3 and 11.4 in POSIX.1-1996, P252-266
------------------------------------------------------------------------
10 Nature of defect (complete, concise explanation of the perceived
problem):
POSIX.1 usually devotes a subclause to each header describing what
is contained in that header. Except for the statement in POSIX.1-1996
subclause 2.7.3 saying that <pthread.h> contains function prototypes
or declarations for the functions described in clauses 11.3 and 11.4,
there is no indication of what is contained in <pthread.h>.
The prototypes that are required in <pthread.h> use types that are
defined in <sys/types.h>, <sched.h>, and <time.h>, but the synopses
and descriptions in clauses 11.3 and 11.4 don't describe how the
types defined in those headers will be made available to the function
prototypes required in <pthread.h>. The synopsis sections don't
specify any headers except <pthread.h>.
The standard seems to require that all of the types defined in these
headers be made available by inclusion of <pthread.h>, but doesn't
allow implementations to make them available because of the
namespace preservation requirements Table 2-2 and the rest of clause
2.7.
------------------------------------------------------------------------
11 Solution proposed by the submitter (optional):
There are several problems here. I suggest the following changes:
1. Add a new clause (before clauses 13.3 and 13.4) that describes
the contents of <pthread.h>. At the start of that clause,
include the following text:
Inclusion of the <pthread.h> header may make
visible symbols allowed by this part of ISO/IEC
9945 to be in the <time.h> and <sched.h> headers.
(matching what is done on POSIX.1-1996, P319, L2-4 for <mqueue.h>.
Also add that <pthread.h> defines PTHREAD_PROCESS_SHARED,
PTHREAD_PROCESS_PRIVATE, PTHREAD_MUTEX_INITIALIZER, ...
appropriately.
2. Since the standard requires that types needed by <pthread.h>
(like pthread_attr_t and pthread_mutextattr_t) be defined
in <sys/types.h> instead of in <pthread.h>, change all of
the synopses in clauses 13.3 and 13.4 that include
<pthread.h> to include <sys/types.h> first.
3. In addition to adding <sys/types.h>, add <time.h> to the
synopsis for pthread_cond_timedwait() (subclause 11.4.4.1,
P264, before L817).
4. In addition to adding <sys/types.h>, add <sched.h> to the
synopsis sections for all of the functions in clauses 11.3
and 11.4 that deal with scheduling policy. These include,
but might not be limited to, subclauses 11.3.1.1, 11.3.3.1,
and 11.4.1.1.
------------------------------------------------------------------------
Interpretation response
------------------------
The standard does not speak to this issue, and as such no conformance
distinction can be made between alternative implementations based on this.
This is being referred to the sponsor.
Rationale
-------------
This appears to be an ommision that should be addressed in
a future revision.
Forwarded to Interpretations group: 26 Feb 1998
Finalised: 30 March 1998