summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxhdrs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/psxtests/psxhdrs')
-rw-r--r--testsuites/psxtests/psxhdrs/Makefile.am2
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_getconcurrency.c34
-rw-r--r--testsuites/psxtests/psxhdrs/pthread/pthread_setconcurrency.c37
3 files changed, 73 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxhdrs/Makefile.am b/testsuites/psxtests/psxhdrs/Makefile.am
index 8dc13e17cf..3eecd84dbd 100644
--- a/testsuites/psxtests/psxhdrs/Makefile.am
+++ b/testsuites/psxtests/psxhdrs/Makefile.am
@@ -38,6 +38,7 @@ lib_a_SOURCES += pthread/pthread_create.c
lib_a_SOURCES += pthread/pthread_detach.c
lib_a_SOURCES += pthread/pthread_equal.c
lib_a_SOURCES += pthread/pthread_exit.c
+lib_a_SOURCES += pthread/pthread_getconcurrency.c
lib_a_SOURCES += pthread/pthread_getcpuclockid.c
lib_a_SOURCES += pthread/pthread_getschedparam.c
lib_a_SOURCES += pthread/pthread_getspecific.c
@@ -64,6 +65,7 @@ lib_a_SOURCES += pthread/pthread_once.c
lib_a_SOURCES += pthread/pthread_self.c
lib_a_SOURCES += pthread/pthread_setcancelstate.c
lib_a_SOURCES += pthread/pthread_setcanceltype.c
+lib_a_SOURCES += pthread/pthread_setconcurrency.c
lib_a_SOURCES += pthread/pthread_setschedparam.c
lib_a_SOURCES += pthread/pthread_setspecific.c
lib_a_SOURCES += pthread/pthread_testcancel.c
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_getconcurrency.c b/testsuites/psxtests/psxhdrs/pthread/pthread_getconcurrency.c
new file mode 100644
index 0000000000..dda472030e
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_getconcurrency.c
@@ -0,0 +1,34 @@
+/**
+ * @file
+ * @brief pthread_getconcurrency() API Conformance Test
+ */
+
+/*
+ * COPYRIGHT (c) 2016.
+ * 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_getconcurrency"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ int level;
+
+ level = pthread_getconcurrency();
+
+ return (level == 0);
+}
diff --git a/testsuites/psxtests/psxhdrs/pthread/pthread_setconcurrency.c b/testsuites/psxtests/psxhdrs/pthread/pthread_setconcurrency.c
new file mode 100644
index 0000000000..91b1889f10
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/pthread/pthread_setconcurrency.c
@@ -0,0 +1,37 @@
+/**
+ * @file
+ * @brief pthread_setconcurrency() API Conformance Test
+ */
+
+/*
+ * COPYRIGHT (c) 2016.
+ * 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_setconcurrency"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ int level;
+ int rc;
+
+ level = 42;
+
+ rc = pthread_setconcurrency( level );
+
+ return (rc == 0);
+}