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 #86
Topic: pthread.h and namespace Relevant Sections: Clauses 11.3 and 11.4 in POSIX.1-1996, P252-266
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.
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, ...
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 188.8.131.52, 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 184.108.40.206, 220.127.116.11, and 18.104.22.168.
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 for Interpretation
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