IEEE Standards Interpretations for IEEE Std 1003.1c™-1995 IEEE Standard for Information Technology--Portable Operating System Interface (POSIX(R)) - System Application Program Interface (API) Amendment 2: Threads Extension (C Language)
Copyright © 1996 by the Institute of Electrical and Electronics Engineers, Inc. 345 East 47th Street New York, New York 10017 USA All Rights Reserved.
These are interpretations of IEEE Std 1003.1c-1995.
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 #9
Topic: pthread_atfork() Relevant Clauses: 220.127.116.11
This is related to Interpretation #4 and the interrelationship between IEEE Std 1003.1c™-1995 and IEEE Std 1003.2™-1992. Interpretation #4 stated:
IEEE Std 1003.1b™-1993, to which IEEE Std 1003.1™-1995 is an amendment, on page 39 section 2.7.3 lines 1119 to 1121, states that "if a function is not listed below, it shall have its prototype appear in <unistd.h>..." pthread_atfork is not listed, so the standard is clear that it shall be listed in <unistd.h>.
IEEE Std 1003.2™-1992 states that the functions in <unistd.h> are made available, when -l c is the argument to c89: POSIX.2 lines 167-169 page 691 states " -l c This library contains all library functions referenced in <stdlib.h>, <stdio.h>, <time.h>, <setjmp.h>, <signal.h>, <unistd.h>...". Is it thus the correct interpretation for IEEE Std 1003.1c™-1995 that the pthread_atfork() function be in the standard library found with the -l c argument? I'd propose that this be in a library other than that named found by "-l c".
The standard is clear that pthread_atfork() is made available by the -l c argument to c89. As stated in Interpretation #4: "IEEE Std 1003.1b-1993, to which IEEE Std 1003.11995 is an amendment, on page 39 section 2.7.3 lines 1119 to 1121, states that "if a function is not listed below, it shall have its prototype appear in <unistd.h>..." pthread_atfork is not listed, so the standard is clear that it shall be listed in <unistd.h>." and IEEE Std 1003.2-1992 says: "...the functions in <unistd.h> are made available when -l c is the argument to c89." However, it is the belief of the interpretations committee that this is not what was intended by the working group or the balloting group. The rationale in informative annex C, page 593, line 183, lists pthread_atfork() as being defined in <pthread.h>. Additionally, the "pthread_" function is the only one made available by the -l c argument to c89 is pthread_atfork(), which does not give the user of the standard a useful set of functions. This issue is being referred to the sponsor for consideration.
Rationale for Interpretation