This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

conformtest: Clean up expectations for POSIX for pthread.h


This patch cleans up the conformtest expectations for pthread.h for
POSIX (1996).

The specification of pthread.h in that version of POSIX is a
particular mess, with interfaces listed in the main body of the
standard as in pthread.h but not mentioned in the non-normative Annex
C, and vice versa (pthread_atfork), and no global normative definition
of what belongs in the header.
<http://standards.ieee.org/findstds/interps/1003-1-90_int/pasc-1003.1-86.html>
discusses some of the issues.

These changes represent my best interpretation of how conformtest
should test this header for that version.  In the case of
PTHREAD_MUTEX_INITIALIZER, it's an unambiguous conformtest bug.  In
the case of the *_t types, not requiring the header to define them
matches the usual POSIX (1996) practice of not requiring headers to
define such types from sys/types.h; subsequent POSIX versions
generally made headers self-contained in this regard (and normal glibc
practice is, for any POSIX version specifying that a function is
declared in a header, to define the *_t types used by that function's
prototype whether or not that POSIX version requires them in that
header).  In the case of pthread_atfork, POSIX (1996) only mentions
<sys/types.h> when specifying the function, but it's in the list in
Annex C for <pthread.h>, and subsequent POSIX versions normatively put
it there; Unix98 puts it in <unistd.h> instead.

conformtest is definitely not being consistent about whether functions
listed as optional in POSIX are marked as "function" or
"optional-function" (and likewise for other optional symbols), but
this applies also to many other headers and standards, not just this
one.

Tested x86_64.

2013-09-13  Joseph Myers  <joseph@codesourcery.com>

	* conform/data/pthread.h-data [POSIX] (PTHREAD_MUTEX_INITIALIZER):
	Expect macro.
	[POSIX] (pthread_attr_t): Do not require type.
	[POSIX] (pthread_cond_t): Likewise.
	[POSIX] (pthread_condattr_t): Likewise.
	[POSIX] (pthread_key_t): Likewise.
	[POSIX] (pthread_mutex_t): Likewise.
	[POSIX] (pthread_mutexattr_t): Likewise.
	[POSIX] (pthread_once_t): Likewise.
	[POSIX] (pthread_t): Likewise.
	[POSIX-based standards] (pthread_atfork): Expect function.

diff --git a/conform/data/pthread.h-data b/conform/data/pthread.h-data
index 292b125..c1e32c8 100644
--- a/conform/data/pthread.h-data
+++ b/conform/data/pthread.h-data
@@ -17,11 +17,11 @@ constant PTHREAD_PROCESS_SHARED
 constant PTHREAD_PROCESS_PRIVATE
 constant PTHREAD_SCOPE_PROCESS
 constant PTHREAD_SCOPE_SYSTEM
+macro PTHREAD_MUTEX_INITIALIZER
 # ifndef POSIX
 constant PTHREAD_MUTEX_DEFAULT
 constant PTHREAD_MUTEX_ERRORCHECK
 constant PTHREAD_MUTEX_NORMAL
-macro PTHREAD_MUTEX_INITIALIZER
 constant PTHREAD_MUTEX_RECURSIVE
 macro PTHREAD_RWLOCK_INITIALIZER
 # endif
@@ -30,26 +30,27 @@ constant PTHREAD_MUTEX_ROBUST
 constant PTHREAD_MUTEX_STALLED
 # endif
 
+# ifndef POSIX
 type pthread_attr_t
-# if !defined POSIX && !defined UNIX98
+#  ifndef UNIX98
 type pthread_barrier_t
 type pthread_barrierattr_t
-# endif
+#  endif
 type pthread_cond_t
 type pthread_condattr_t
 type pthread_key_t
 type pthread_mutex_t
 type pthread_mutexattr_t
 type pthread_once_t
-# if !defined POSIX
 type pthread_rwlock_t
 type pthread_rwlockattr_t
-# endif
-# if !defined POSIX && !defined UNIX98
+#  ifndef UNIX98
 type pthread_spinlock_t
-# endif
+#  endif
 type pthread_t
+# endif
 
+function int pthread_atfork (void (*) (void), void (*) (void), void (*) (void))
 function int pthread_attr_destroy (pthread_attr_t*)
 function int pthread_attr_getdetachstate (const pthread_attr_t*, int*)
 # ifndef POSIX

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]