summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxhdrs/sched
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/psxtests/psxhdrs/sched')
-rw-r--r--testsuites/psxtests/psxhdrs/sched/sched_get_priority_max.c40
-rw-r--r--testsuites/psxtests/psxhdrs/sched/sched_get_priority_min.c40
-rw-r--r--testsuites/psxtests/psxhdrs/sched/sched_getparam.c36
-rw-r--r--testsuites/psxtests/psxhdrs/sched/sched_getscheduler.c35
-rw-r--r--testsuites/psxtests/psxhdrs/sched/sched_rr_get_interval.c36
-rw-r--r--testsuites/psxtests/psxhdrs/sched/sched_setparam.c49
-rw-r--r--testsuites/psxtests/psxhdrs/sched/sched_setscheduler.c57
-rw-r--r--testsuites/psxtests/psxhdrs/sched/sched_yield.c32
8 files changed, 325 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxhdrs/sched/sched_get_priority_max.c b/testsuites/psxtests/psxhdrs/sched/sched_get_priority_max.c
new file mode 100644
index 0000000000..c1546e372f
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/sched/sched_get_priority_max.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 <sched.h>
+
+#ifndef _POSIX_PRIORITY_SCHEDULING
+#error "rtems is supposed to have sched_get_priority_max"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ int policy;
+ int result;
+
+ policy = SCHED_RR;
+ policy = SCHED_FIFO;
+ policy = SCHED_OTHER;
+#ifdef _POSIX_SPORADIC_SERVER
+ policy = SCHED_SPORADIC;
+#endif
+
+ result = sched_get_priority_max( policy );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/sched/sched_get_priority_min.c b/testsuites/psxtests/psxhdrs/sched/sched_get_priority_min.c
new file mode 100644
index 0000000000..fbf4e09958
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/sched/sched_get_priority_min.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 <sched.h>
+
+#ifndef _POSIX_PRIORITY_SCHEDULING
+#error "rtems is supposed to have sched_get_priority_min"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ int policy;
+ int result;
+
+ policy = SCHED_RR;
+ policy = SCHED_FIFO;
+ policy = SCHED_OTHER;
+#ifdef _POSIX_SPORADIC_SERVER
+ policy = SCHED_SPORADIC;
+#endif
+
+ result = sched_get_priority_min( policy );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/sched/sched_getparam.c b/testsuites/psxtests/psxhdrs/sched/sched_getparam.c
new file mode 100644
index 0000000000..6814410744
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/sched/sched_getparam.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 <sched.h>
+
+#ifndef _POSIX_PRIORITY_SCHEDULING
+#error "rtems is supposed to have sched_getparam"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pid_t pid;
+ struct sched_param param;
+ int result;
+
+ pid = 0;
+
+ result = sched_getparam( pid, &param );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/sched/sched_getscheduler.c b/testsuites/psxtests/psxhdrs/sched/sched_getscheduler.c
new file mode 100644
index 0000000000..37d6b47397
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/sched/sched_getscheduler.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 <sched.h>
+
+#ifndef _POSIX_PRIORITY_SCHEDULING
+#error "rtems is supposed to have sched_getscheduler"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pid_t pid;
+ int result;
+
+ pid = 0;
+
+ result = sched_getscheduler( pid );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/sched/sched_rr_get_interval.c b/testsuites/psxtests/psxhdrs/sched/sched_rr_get_interval.c
new file mode 100644
index 0000000000..5f2bd75f27
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/sched/sched_rr_get_interval.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 <sched.h>
+
+#ifndef _POSIX_PRIORITY_SCHEDULING
+#error "rtems is supposed to have sched_rr_get_interval"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pid_t pid;
+ struct timespec interval;
+ int result;
+
+ pid = 0;
+
+ result = sched_rr_get_interval( pid, &interval );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/sched/sched_setparam.c b/testsuites/psxtests/psxhdrs/sched/sched_setparam.c
new file mode 100644
index 0000000000..c703369098
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/sched/sched_setparam.c
@@ -0,0 +1,49 @@
+/*
+ * 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 <sched.h>
+
+#ifndef _POSIX_PRIORITY_SCHEDULING
+#error "rtems is supposed to have sched_setparam"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pid_t pid;
+ struct sched_param param;
+ int result;
+
+ pid = 0;
+
+ /*
+ * 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 = sched_setparam( pid, &param );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/sched/sched_setscheduler.c b/testsuites/psxtests/psxhdrs/sched/sched_setscheduler.c
new file mode 100644
index 0000000000..3e1ecacd5e
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/sched/sched_setscheduler.c
@@ -0,0 +1,57 @@
+/*
+ * 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 <sched.h>
+
+#ifndef _POSIX_PRIORITY_SCHEDULING
+#error "rtems is supposed to have sched_setscheduler"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ pid_t pid;
+ int policy;
+ struct sched_param param;
+ int result;
+
+ pid = 0;
+
+ policy = SCHED_RR;
+ policy = SCHED_FIFO;
+ policy = SCHED_OTHER;
+#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 = sched_setscheduler( pid, policy, &param );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/sched/sched_yield.c b/testsuites/psxtests/psxhdrs/sched/sched_yield.c
new file mode 100644
index 0000000000..cb50fa1c69
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/sched/sched_yield.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 <sched.h>
+
+#ifndef _POSIX_PRIORITY_SCHEDULING
+#error "rtems is supposed to have sched_yield"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ int result;
+
+ result = sched_yield();
+
+ return result;
+}