summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxhdrs/pthread
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/psxtests/psxhdrs/pthread')
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_destroy.c33
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_getdetachstate.c34
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_getguardsize.c36
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_getinheritsched.c34
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_getschedparam.c34
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_getschedpolicy.c34
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_getscope.c34
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_getstack.c42
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_getstackaddr.c39
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_getstacksize.c38
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_init.c33
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_setdetachstate.c37
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_setguardsize.c39
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_setinheritsched.c37
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_setschedparam.c34
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_setschedpolicy.c41
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_setscope.c37
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_setstack.c45
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_setstackaddr.c41
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_attr_setstacksize.c41
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_cancel.c39
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_cleanup.c41
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_cond_broadcast.c33
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_cond_destroy.c33
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_cond_init.c34
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_cond_signal.c33
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_cond_timedwait.c35
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_cond_wait.c34
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_condattr_destroy.c33
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_condattr_getpshared.c37
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_condattr_init.c33
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_condattr_setpshared.c40
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_create.c45
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_detach.c34
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_equal.c34
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_exit.c30
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_getcpuclockid.c36
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_getschedparam.c35
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_getspecific.c35
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_join.c36
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_key_create.c40
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_key_delete.c33
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_mutex_destroy.c33
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_mutex_getprioceiling.c37
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_mutex_init.c34
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_mutex_lock.c33
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_mutex_setprioceiling.c40
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_mutex_timedlock.c37
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_mutex_trylock.c33
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_mutex_unlock.c33
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_destroy.c33
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_getprioceiling.c37
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_getprotocol.c37
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_getpshared.c37
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_init.c33
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_setprioceiling.c37
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_setprotocol.c41
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_setpshared.c40
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_once.c38
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_self.c32
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_setcancelstate.c42
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_setcanceltype.c42
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_setschedparam.c55
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_setspecific.c37
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_testcancel.c33
65 files changed, 2380 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_destroy.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_destroy.c
new file mode 100644
index 0000000000..05a0fedb08
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_destroy.c
@@ -0,0 +1,33 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_attr_destroy"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attribute;
+ int result;
+
+ result = pthread_attr_destroy( &attribute );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getdetachstate.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getdetachstate.c
new file mode 100644
index 0000000000..55164ebe73
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getdetachstate.c
@@ -0,0 +1,34 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_attr_getdetachstate"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attribute;
+ int state;
+ int result;
+
+ result = pthread_attr_getdetachstate( &attribute, &state );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getguardsize.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getguardsize.c
new file mode 100644
index 0000000000..3780747365
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getguardsize.c
@@ -0,0 +1,36 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#if HAVE_DECL_PTHREAD_ATTR_GETGUARDSIZE
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_getstacksize"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attribute;
+ size_t size;
+ int result;
+
+ result = pthread_attr_getguardsize( &attribute, &size );
+
+ return result;
+}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getinheritsched.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getinheritsched.c
new file mode 100644
index 0000000000..df73441d28
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getinheritsched.c
@@ -0,0 +1,34 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING
+#error "RTEMS is supposed to have pthread_attr_getinheritsched"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attr;
+ int inheritsched;
+ int result;
+
+ result = pthread_attr_getinheritsched( &attr, &inheritsched );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getschedparam.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getschedparam.c
new file mode 100644
index 0000000000..b44f73073b
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getschedparam.c
@@ -0,0 +1,34 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING
+#error "RTEMS is supposed to have pthread_attr_getschedparam"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attr;
+ struct sched_param param;
+ int result;
+
+ result = pthread_attr_getschedparam( &attr, &param );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getschedpolicy.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getschedpolicy.c
new file mode 100644
index 0000000000..e2a34b7aa6
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getschedpolicy.c
@@ -0,0 +1,34 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING
+#error "RTEMS is supposed to have pthread_attr_getschedpolicy"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attr;
+ int policy;
+ int result;
+
+ result = pthread_attr_getschedpolicy( &attr, &policy );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getscope.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getscope.c
new file mode 100644
index 0000000000..f32137c849
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getscope.c
@@ -0,0 +1,34 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING
+#error "RTEMS is supposed to have pthread_attr_getscope"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attr;
+ int contentionscope;
+ int result;
+
+ result = pthread_attr_getscope( &attr, &contentionscope );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getstack.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getstack.c
new file mode 100644
index 0000000000..bbef6a8ce1
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getstack.c
@@ -0,0 +1,42 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2010.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#if HAVE_DECL_PTHREAD_ATTR_SETSTACK
+#include <pthread.h>
+#include <limits.h> /* only for PTHREAD_STACK_MIN */
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_getstackaddr"
+#endif
+
+#ifndef _POSIX_THREAD_ATTR_STACKADDR
+#error "rtems is supposed to have pthread_getstackaddr"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attribute;
+ void *stackaddr;
+ size_t stacksize;
+ int result;
+
+ result = pthread_attr_getstack( &attribute, &stackaddr, &stacksize );
+
+ return result;
+}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getstackaddr.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getstackaddr.c
new file mode 100644
index 0000000000..0e84c5844a
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getstackaddr.c
@@ -0,0 +1,39 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+#include <limits.h> /* only for PTHREAD_STACK_MIN */
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_getstackaddr"
+#endif
+
+#ifndef _POSIX_THREAD_ATTR_STACKADDR
+#error "rtems is supposed to have pthread_getstackaddr"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attribute;
+ void *stackaddr;
+ int result;
+
+ result = pthread_attr_getstackaddr( &attribute, &stackaddr );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getstacksize.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getstacksize.c
new file mode 100644
index 0000000000..bd9cdff8e3
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_getstacksize.c
@@ -0,0 +1,38 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_getstacksize"
+#endif
+
+#ifndef _POSIX_THREAD_ATTR_STACKSIZE
+#error "rtems is supposed to have pthread_getstacksize"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attribute;
+ size_t size;
+ int result;
+
+ result = pthread_attr_getstacksize( &attribute, &size );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_init.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_init.c
new file mode 100644
index 0000000000..d0fb6cb5ee
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_init.c
@@ -0,0 +1,33 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_attr_init"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attribute;
+ int result;
+
+ result = pthread_attr_init( &attribute );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setdetachstate.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setdetachstate.c
new file mode 100644
index 0000000000..c752d4e935
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setdetachstate.c
@@ -0,0 +1,37 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_attr_setdetachstate"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attribute;
+ int state;
+ int result;
+
+ state = PTHREAD_CREATE_DETACHED;
+ state = PTHREAD_CREATE_JOINABLE;
+
+ result = pthread_attr_setdetachstate( &attribute, state );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setguardsize.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setguardsize.c
new file mode 100644
index 0000000000..ea9338a715
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setguardsize.c
@@ -0,0 +1,39 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2010.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#if HAVE_DECL_PTHREAD_ATTR_SETGUARDSIZE
+#include <pthread.h>
+#include <limits.h> /* only for PTHREAD_STACK_MIN */
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_setstacksize"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attribute;
+ size_t size;
+ int result;
+
+ size = PTHREAD_STACK_MIN;
+
+ result = pthread_attr_setguardsize( &attribute, size );
+
+ return result;
+}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setinheritsched.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setinheritsched.c
new file mode 100644
index 0000000000..b82c10be37
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setinheritsched.c
@@ -0,0 +1,37 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING
+#error "RTEMS is supposed to have pthread_attr_setinheritsched"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attr;
+ int inheritsched;
+ int result;
+
+ inheritsched = PTHREAD_INHERIT_SCHED;
+ inheritsched = PTHREAD_EXPLICIT_SCHED;
+
+ result = pthread_attr_setinheritsched( &attr, inheritsched );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setschedparam.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setschedparam.c
new file mode 100644
index 0000000000..0454e8b60c
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setschedparam.c
@@ -0,0 +1,34 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING
+#error "RTEMS is supposed to have pthread_attr_setschedparam"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attr;
+ struct sched_param param;
+ int result;
+
+ result = pthread_attr_setschedparam( &attr, &param );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setschedpolicy.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setschedpolicy.c
new file mode 100644
index 0000000000..519010e6e4
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setschedpolicy.c
@@ -0,0 +1,41 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING
+#error "RTEMS is supposed to have pthread_attr_setschedpolicy"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attr;
+ int policy;
+ int result;
+
+ policy = SCHED_FIFO;
+ policy = SCHED_RR;
+ policy = SCHED_OTHER;
+#ifdef _POSIX_SPORADIC_SERVER
+ policy = SCHED_SPORADIC;
+#endif
+
+ result = pthread_attr_setschedpolicy( &attr, policy );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setscope.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setscope.c
new file mode 100644
index 0000000000..9372758c2a
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setscope.c
@@ -0,0 +1,37 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING
+#error "RTEMS is supposed to have pthread_attr_setscope"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attr;
+ int contentionscope;
+ int result;
+
+ contentionscope = PTHREAD_SCOPE_SYSTEM;
+ contentionscope = PTHREAD_SCOPE_PROCESS;
+
+ result = pthread_attr_setscope( &attr, contentionscope );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setstack.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setstack.c
new file mode 100644
index 0000000000..a4de9c8f78
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setstack.c
@@ -0,0 +1,45 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2010.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#if HAVE_DECL_PTHREAD_ATTR_SETSTACK
+#include <pthread.h>
+#include <limits.h> /* only for PTHREAD_STACK_MIN */
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_setstackaddr"
+#endif
+
+#ifndef _POSIX_THREAD_ATTR_STACKADDR
+#error "rtems is supposed to have pthread_setstackaddr"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attribute;
+ void *stackaddr;
+ size_t stacksize;
+ int result;
+
+ stackaddr = NULL;
+ stacksize = 1024;
+
+ result = pthread_attr_setstack( &attribute, stackaddr, stacksize );
+
+ return result;
+}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setstackaddr.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setstackaddr.c
new file mode 100644
index 0000000000..661826f86b
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setstackaddr.c
@@ -0,0 +1,41 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+#include <limits.h> /* only for PTHREAD_STACK_MIN */
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_setstackaddr"
+#endif
+
+#ifndef _POSIX_THREAD_ATTR_STACKADDR
+#error "rtems is supposed to have pthread_setstackaddr"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attribute;
+ void *stackaddr;
+ int result;
+
+ stackaddr = NULL;
+
+ result = pthread_attr_setstackaddr( &attribute, stackaddr );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setstacksize.c b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setstacksize.c
new file mode 100644
index 0000000000..4a12266e6a
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_attr_setstacksize.c
@@ -0,0 +1,41 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+#include <limits.h> /* only for PTHREAD_STACK_MIN */
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_setstacksize"
+#endif
+
+#ifndef _POSIX_THREAD_ATTR_STACKSIZE
+#error "rtems is supposed to have pthread_setstacksize"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_attr_t attribute;
+ size_t size;
+ int result;
+
+ size = PTHREAD_STACK_MIN;
+
+ result = pthread_attr_setstacksize( &attribute, size );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_cancel.c b/testsuites/psxtests/psxhdrs/pthread/pthread_cancel.c
new file mode 100644
index 0000000000..287f394589
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_cancel.c
@@ -0,0 +1,39 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_cancel"
+#endif
+
+int test( void );
+void init_routine( void );
+
+void init_routine( void )
+{
+}
+
+int test( void )
+{
+ pthread_t thread;
+ int result;
+
+ thread = 0;
+ result = pthread_cancel( thread );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_cleanup.c b/testsuites/psxtests/psxhdrs/pthread/pthread_cleanup.c
new file mode 100644
index 0000000000..647b469b5c
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_cleanup.c
@@ -0,0 +1,41 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_cleanup_push"
+#endif
+
+void test( void );
+void cleanup_routine( void *argument );
+
+void cleanup_routine(
+ void *argument
+)
+{
+ (void) argument;
+}
+
+void test( void )
+{
+ int argument;
+
+ argument = 0;
+
+ pthread_cleanup_push( cleanup_routine, &argument );
+ pthread_cleanup_pop( 1 );
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_cond_broadcast.c b/testsuites/psxtests/psxhdrs/pthread/pthread_cond_broadcast.c
new file mode 100644
index 0000000000..6ba0c92149
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_cond_broadcast.c
@@ -0,0 +1,33 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_cond_broadcast"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
+ int result;
+
+ result = pthread_cond_broadcast( &cond );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_cond_destroy.c b/testsuites/psxtests/psxhdrs/pthread/pthread_cond_destroy.c
new file mode 100644
index 0000000000..2beef01f04
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_cond_destroy.c
@@ -0,0 +1,33 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_cond_destroy"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
+ int result;
+
+ result = pthread_cond_destroy( &cond );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_cond_init.c b/testsuites/psxtests/psxhdrs/pthread/pthread_cond_init.c
new file mode 100644
index 0000000000..9a83d83bf8
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_cond_init.c
@@ -0,0 +1,34 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_cond_init"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
+ pthread_condattr_t attribute;
+ int result;
+
+ result = pthread_cond_init( &cond, &attribute );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_cond_signal.c b/testsuites/psxtests/psxhdrs/pthread/pthread_cond_signal.c
new file mode 100644
index 0000000000..57c83361dc
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_cond_signal.c
@@ -0,0 +1,33 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_cond_signal"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
+ int result;
+
+ result = pthread_cond_signal( &cond );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_cond_timedwait.c b/testsuites/psxtests/psxhdrs/pthread/pthread_cond_timedwait.c
new file mode 100644
index 0000000000..c8f6183252
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_cond_timedwait.c
@@ -0,0 +1,35 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_cond_timedwait"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
+ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+ struct timespec abstime;
+ int result;
+
+ result = pthread_cond_timedwait( &cond, &mutex, &abstime );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_cond_wait.c b/testsuites/psxtests/psxhdrs/pthread/pthread_cond_wait.c
new file mode 100644
index 0000000000..d9ab134eba
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_cond_wait.c
@@ -0,0 +1,34 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_cond_wait"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
+ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+ int result;
+
+ result = pthread_cond_wait( &cond, &mutex );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_condattr_destroy.c b/testsuites/psxtests/psxhdrs/pthread/pthread_condattr_destroy.c
new file mode 100644
index 0000000000..5575f9b594
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_condattr_destroy.c
@@ -0,0 +1,33 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_condattr_destroy"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_condattr_t attribute;
+ int result;
+
+ result = pthread_condattr_destroy( &attribute );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_condattr_getpshared.c b/testsuites/psxtests/psxhdrs/pthread/pthread_condattr_getpshared.c
new file mode 100644
index 0000000000..74139d57de
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_condattr_getpshared.c
@@ -0,0 +1,37 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_condattr_getpshared"
+#endif
+#ifndef _POSIX_THREAD_PROCESS_SHARED
+#error "rtems is supposed to have pthread_condattr_setpshared"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_condattr_t attribute;
+ int pshared;
+ int result;
+
+ result = pthread_condattr_getpshared( &attribute, &pshared );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_condattr_init.c b/testsuites/psxtests/psxhdrs/pthread/pthread_condattr_init.c
new file mode 100644
index 0000000000..e4f71db621
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_condattr_init.c
@@ -0,0 +1,33 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_condattr_init"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_condattr_t attribute;
+ int result;
+
+ result = pthread_condattr_init( &attribute );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_condattr_setpshared.c b/testsuites/psxtests/psxhdrs/pthread/pthread_condattr_setpshared.c
new file mode 100644
index 0000000000..db2b18d263
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_condattr_setpshared.c
@@ -0,0 +1,40 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_condattr_setpshared"
+#endif
+#ifndef _POSIX_THREAD_PROCESS_SHARED
+#error "rtems is supposed to have pthread_condattr_setpshared"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_condattr_t attribute;
+ int pshared;
+ int result;
+
+ pshared = PTHREAD_PROCESS_SHARED;
+ pshared = PTHREAD_PROCESS_PRIVATE;
+
+ result = pthread_condattr_setpshared( &attribute, pshared );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_create.c b/testsuites/psxtests/psxhdrs/pthread/pthread_create.c
new file mode 100644
index 0000000000..516d94bb34
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_create.c
@@ -0,0 +1,45 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_create"
+#endif
+
+int test( void );
+void *test_task( void * arg );
+
+void *test_task(
+ void * arg
+)
+{
+ for ( ; ; )
+ ;
+ return NULL;
+}
+
+int test( void )
+{
+ pthread_t thread;
+ pthread_attr_t attribute;
+ void *arg = NULL;
+ int result;
+
+ result = pthread_create( &thread, &attribute, test_task, arg );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_detach.c b/testsuites/psxtests/psxhdrs/pthread/pthread_detach.c
new file mode 100644
index 0000000000..4b75eac362
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_detach.c
@@ -0,0 +1,34 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_detach"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_t thread;
+ int result;
+
+ thread = 0;
+ result = pthread_detach( thread );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_equal.c b/testsuites/psxtests/psxhdrs/pthread/pthread_equal.c
new file mode 100644
index 0000000000..4e9fca919e
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_equal.c
@@ -0,0 +1,34 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_equal"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_t id_1 = 0;
+ pthread_t id_2 = 0;
+ int result;
+
+ result = pthread_equal( id_1, id_2 );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_exit.c b/testsuites/psxtests/psxhdrs/pthread/pthread_exit.c
new file mode 100644
index 0000000000..2a68a9f6ef
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_exit.c
@@ -0,0 +1,30 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_exit"
+#endif
+
+void test( void );
+
+void test( void )
+{
+ void *status = NULL;
+
+ pthread_exit( status );
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_getcpuclockid.c b/testsuites/psxtests/psxhdrs/pthread/pthread_getcpuclockid.c
new file mode 100644
index 0000000000..bf1dd33e09
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_getcpuclockid.c
@@ -0,0 +1,36 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREAD_CPUTIME
+#error "rtems is supposed to have pthread_getcpuclockid"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_t thread;
+ clockid_t clock_id;
+ int result;
+
+ thread = 0;
+
+ result = pthread_getcpuclockid( thread, &clock_id );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_getschedparam.c b/testsuites/psxtests/psxhdrs/pthread/pthread_getschedparam.c
new file mode 100644
index 0000000000..122a100e22
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_getschedparam.c
@@ -0,0 +1,35 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING
+#error "RTEMS is supposed to have pthread_getschedparam"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_t thread = 0;
+ int policy;
+ struct sched_param param;
+ int result;
+
+ result = pthread_getschedparam( thread, &policy, &param );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_getspecific.c b/testsuites/psxtests/psxhdrs/pthread/pthread_getspecific.c
new file mode 100644
index 0000000000..3be0373978
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_getspecific.c
@@ -0,0 +1,35 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_getspecific"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_key_t key;
+ void *value;
+
+ key = 0;
+
+ value = pthread_getspecific( key );
+
+ return (value != 0);
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_join.c b/testsuites/psxtests/psxhdrs/pthread/pthread_join.c
new file mode 100644
index 0000000000..69040c46f8
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_join.c
@@ -0,0 +1,36 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_join"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_t thread;
+ void *value_ptr;
+ int result;
+
+ thread = 0;
+
+ result = pthread_join( thread, &value_ptr );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_key_create.c b/testsuites/psxtests/psxhdrs/pthread/pthread_key_create.c
new file mode 100644
index 0000000000..70322328af
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_key_create.c
@@ -0,0 +1,40 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_key_create"
+#endif
+
+int test( void );
+void key_destructor( void *argument );
+
+void key_destructor(
+ void *argument
+)
+{
+}
+
+int test( void )
+{
+ pthread_key_t key;
+ int result;
+
+ result = pthread_key_create( &key, key_destructor );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_key_delete.c b/testsuites/psxtests/psxhdrs/pthread/pthread_key_delete.c
new file mode 100644
index 0000000000..c6c1c34dd3
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_key_delete.c
@@ -0,0 +1,33 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_key_delete"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_key_t key = 0;
+ int result;
+
+ result = pthread_key_delete( key );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_destroy.c b/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_destroy.c
new file mode 100644
index 0000000000..c577ab1c09
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_destroy.c
@@ -0,0 +1,33 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_mutex_destroy"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+ int result;
+
+ result = pthread_mutex_destroy( &mutex );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_getprioceiling.c b/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_getprioceiling.c
new file mode 100644
index 0000000000..51a78b552b
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_getprioceiling.c
@@ -0,0 +1,37 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREAD_PRIO_INHERIT
+#error "rtems is supposed to have pthread_mutex_getprioceiling"
+#endif
+#ifndef _POSIX_THREAD_PRIO_PROTECT
+#error "rtems is supposed to have pthread_mutex_getprioceiling"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_mutex_t mutex;
+ int prioceiling;
+ int result;
+
+ result = pthread_mutex_getprioceiling( &mutex, &prioceiling );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_init.c b/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_init.c
new file mode 100644
index 0000000000..b59c3f6d37
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_init.c
@@ -0,0 +1,34 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_mutex_init"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+ pthread_mutexattr_t attribute;
+ int result;
+
+ result = pthread_mutex_init( &mutex, &attribute );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_lock.c b/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_lock.c
new file mode 100644
index 0000000000..0a416f2d90
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_lock.c
@@ -0,0 +1,33 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_mutex_lock"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+ int result;
+
+ result = pthread_mutex_lock( &mutex );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_setprioceiling.c b/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_setprioceiling.c
new file mode 100644
index 0000000000..754068acdd
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_setprioceiling.c
@@ -0,0 +1,40 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREAD_PRIO_INHERIT
+#error "rtems is supposed to have pthread_mutex_setprioceiling"
+#endif
+#ifndef _POSIX_THREAD_PRIO_PROTECT
+#error "rtems is supposed to have pthread_mutex_setprioceiling"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_mutex_t mutex;
+ int prioceiling;
+ int oldceiling;
+ int result;
+
+ prioceiling = 0;
+
+ result = pthread_mutex_setprioceiling( &mutex, prioceiling, &oldceiling );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_timedlock.c b/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_timedlock.c
new file mode 100644
index 0000000000..4fbe812157
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_timedlock.c
@@ -0,0 +1,37 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_mutex_timedlock"
+#endif
+#ifndef _POSIX_TIMEOUTS
+#error "rtems is supposed to have pthread_mutex_timedlock"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+ struct timespec timeout;
+ int result;
+
+ result = pthread_mutex_timedlock( &mutex, &timeout );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_trylock.c b/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_trylock.c
new file mode 100644
index 0000000000..b0f517c658
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_trylock.c
@@ -0,0 +1,33 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_mutex_trylock"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+ int result;
+
+ result = pthread_mutex_trylock( &mutex );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_unlock.c b/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_unlock.c
new file mode 100644
index 0000000000..fff3f84d00
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_mutex_unlock.c
@@ -0,0 +1,33 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_mutex_unlock"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+ int result;
+
+ result = pthread_mutex_unlock( &mutex );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_destroy.c b/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_destroy.c
new file mode 100644
index 0000000000..3b2e072563
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_destroy.c
@@ -0,0 +1,33 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_mutexattr_destroy"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_mutexattr_t attribute;
+ int result;
+
+ result = pthread_mutexattr_destroy( &attribute );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_getprioceiling.c b/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_getprioceiling.c
new file mode 100644
index 0000000000..20327de527
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_getprioceiling.c
@@ -0,0 +1,37 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREAD_PRIO_INHERIT
+#error "rtems is supposed to have pthread_mutexattr_getprioceiling"
+#endif
+#ifndef _POSIX_THREAD_PRIO_PROTECT
+#error "rtems is supposed to have pthread_mutexattr_getprioceiling"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_mutexattr_t attribute;
+ int prioceiling = 0;
+ int result;
+
+ result = pthread_mutexattr_getprioceiling( &attribute, &prioceiling );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_getprotocol.c b/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_getprotocol.c
new file mode 100644
index 0000000000..a72c966dbb
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_getprotocol.c
@@ -0,0 +1,37 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREAD_PRIO_INHERIT
+#error "rtems is supposed to have pthread_mutexattr_getprotocol"
+#endif
+#ifndef _POSIX_THREAD_PRIO_PROTECT
+#error "rtems is supposed to have pthread_mutexattr_getprotocol"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_mutexattr_t attribute;
+ int protocol;
+ int result;
+
+ result = pthread_mutexattr_getprotocol( &attribute, &protocol );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_getpshared.c b/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_getpshared.c
new file mode 100644
index 0000000000..a85d37047a
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_getpshared.c
@@ -0,0 +1,37 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_mutexattr_getpshared"
+#endif
+#ifndef _POSIX_THREAD_PROCESS_SHARED
+#error "rtems is supposed to have pthread_mutexattr_setpshared"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_mutexattr_t attribute;
+ int pshared;
+ int result;
+
+ result = pthread_mutexattr_getpshared( &attribute, &pshared );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_init.c b/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_init.c
new file mode 100644
index 0000000000..73790f2019
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_init.c
@@ -0,0 +1,33 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_mutexattr_init"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_mutexattr_t attribute;
+ int result;
+
+ result = pthread_mutexattr_init( &attribute );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_setprioceiling.c b/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_setprioceiling.c
new file mode 100644
index 0000000000..31cf69f438
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_setprioceiling.c
@@ -0,0 +1,37 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREAD_PRIO_INHERIT
+#error "rtems is supposed to have pthread_mutexattr_setprioceiling"
+#endif
+#ifndef _POSIX_THREAD_PRIO_PROTECT
+#error "rtems is supposed to have pthread_mutexattr_setprioceiling"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_mutexattr_t attribute;
+ int prioceiling = 0;
+ int result;
+
+ result = pthread_mutexattr_setprioceiling( &attribute, prioceiling );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_setprotocol.c b/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_setprotocol.c
new file mode 100644
index 0000000000..f8cc0cd5a4
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_setprotocol.c
@@ -0,0 +1,41 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREAD_PRIO_INHERIT
+#error "rtems is supposed to have pthread_mutexattr_setprotocol"
+#endif
+#ifndef _POSIX_THREAD_PRIO_PROTECT
+#error "rtems is supposed to have pthread_mutexattr_setprotocol"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_mutexattr_t attribute;
+ int protocol;
+ int result;
+
+ protocol = PTHREAD_PRIO_NONE;
+ protocol = PTHREAD_PRIO_INHERIT;
+ protocol = PTHREAD_PRIO_PROTECT;
+
+ result = pthread_mutexattr_setprotocol( &attribute, protocol );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_setpshared.c b/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_setpshared.c
new file mode 100644
index 0000000000..1a3b8e9e5e
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_mutexattr_setpshared.c
@@ -0,0 +1,40 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_mutexattr_setpshared"
+#endif
+#ifndef _POSIX_THREAD_PROCESS_SHARED
+#error "rtems is supposed to have pthread_mutexattr_setpshared"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_mutexattr_t attribute;
+ int pshared;
+ int result;
+
+ pshared = PTHREAD_PROCESS_SHARED;
+ pshared = PTHREAD_PROCESS_PRIVATE;
+
+ result = pthread_mutexattr_setpshared( &attribute, pshared );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_once.c b/testsuites/psxtests/psxhdrs/pthread/pthread_once.c
new file mode 100644
index 0000000000..a4355e461d
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_once.c
@@ -0,0 +1,38 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_once"
+#endif
+
+int test( void );
+void init_routine( void );
+
+void init_routine( void )
+{
+}
+
+int test( void )
+{
+ pthread_once_t once_control = PTHREAD_ONCE_INIT;
+ int result;
+
+ result = pthread_once( &once_control, init_routine );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_self.c b/testsuites/psxtests/psxhdrs/pthread/pthread_self.c
new file mode 100644
index 0000000000..84c1d0cc03
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_self.c
@@ -0,0 +1,32 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_self"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_t self;
+
+ self = pthread_self();
+
+ return ( self != 0 );
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_setcancelstate.c b/testsuites/psxtests/psxhdrs/pthread/pthread_setcancelstate.c
new file mode 100644
index 0000000000..816908394a
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_setcancelstate.c
@@ -0,0 +1,42 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_setcancelstate"
+#endif
+
+int test( void );
+void init_routine( void );
+
+void init_routine( void )
+{
+}
+
+int test( void )
+{
+ int state;
+ int oldstate;
+ int result;
+
+ state = PTHREAD_CANCEL_ENABLE;
+ state = PTHREAD_CANCEL_DISABLE;
+
+ result = pthread_setcancelstate( state, &oldstate );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_setcanceltype.c b/testsuites/psxtests/psxhdrs/pthread/pthread_setcanceltype.c
new file mode 100644
index 0000000000..f1e0adeaa4
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_setcanceltype.c
@@ -0,0 +1,42 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_setcanceltype"
+#endif
+
+int test( void );
+void init_routine( void );
+
+void init_routine( void )
+{
+}
+
+int test( void )
+{
+ int type;
+ int oldtype;
+ int result;
+
+ type = PTHREAD_CANCEL_DEFERRED;
+ type = PTHREAD_CANCEL_ASYNCHRONOUS;
+
+ result = pthread_setcanceltype( type, &oldtype );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_setschedparam.c b/testsuites/psxtests/psxhdrs/pthread/pthread_setschedparam.c
new file mode 100644
index 0000000000..50cd98a815
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_setschedparam.c
@@ -0,0 +1,55 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING
+#error "RTEMS is supposed to have pthread_setschedparam"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_t thread = 0;
+ int policy;
+ struct sched_param param;
+ int result;
+
+ policy = SCHED_OTHER;
+ policy = SCHED_FIFO;
+ policy = SCHED_RR;
+#ifdef _POSIX_SPORADIC_SERVER
+ policy = SCHED_SPORADIC;
+#endif
+
+ /*
+ * really should use sched_get_priority_min() and sched_get_priority_max()
+ */
+
+ param.sched_priority = 0;
+#ifdef _POSIX_SPORADIC_SERVER
+ param.sched_ss_low_priority = 0;
+ param.sched_ss_repl_period.tv_sec = 0;
+ param.sched_ss_repl_period.tv_nsec = 0;
+ param.sched_ss_init_budget.tv_sec = 0;
+ param.sched_ss_init_budget.tv_nsec = 0;
+#endif
+
+ result = pthread_setschedparam( thread, policy, &param );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_setspecific.c b/testsuites/psxtests/psxhdrs/pthread/pthread_setspecific.c
new file mode 100644
index 0000000000..c82992954c
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_setspecific.c
@@ -0,0 +1,37 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_setspecific"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pthread_key_t key;
+ int value;
+ int result;
+
+ key = 0;
+ value = 0;
+
+ result = pthread_setspecific( key, &value );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_testcancel.c b/testsuites/psxtests/psxhdrs/pthread/pthread_testcancel.c
new file mode 100644
index 0000000000..ef07bf9ab1
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_testcancel.c
@@ -0,0 +1,33 @@
+/*
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ *
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#ifndef _POSIX_THREADS
+#error "rtems is supposed to have pthread_testcancel"
+#endif
+
+void test( void );
+void init_routine( void );
+
+void init_routine( void )
+{
+}
+
+void test( void )
+{
+ pthread_testcancel();
+}