summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxhdrs/signal
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2015-02-11 13:59:29 -0600
committerJoel Sherrill <joel.sherrill@oarcorp.com>2015-02-12 15:30:44 -0600
commitb57a6a711adb5f6afe6aee57ecc211fd746ea5ab (patch)
tree2a85a8537c8948067fe22c76ef7310373c9cd446 /testsuites/psxtests/psxhdrs/signal
parentpsxhdrs: Remove test of pthread_attr_[gs]et_cputime (diff)
downloadrtems-b57a6a711adb5f6afe6aee57ecc211fd746ea5ab.tar.bz2
psxhdrs: Reorganize into subdirectories per .h file and rename files
This is a better organization and makes it clearer which file is testing which method from which header file.
Diffstat (limited to 'testsuites/psxtests/psxhdrs/signal')
-rw-r--r--testsuites/psxtests/psxhdrs/signal/pthread_sigmask.c41
-rw-r--r--testsuites/psxtests/psxhdrs/signal/raise.c31
-rw-r--r--testsuites/psxtests/psxhdrs/signal/signal.c31
-rw-r--r--testsuites/psxtests/psxhdrs/signal/sigpending.c31
-rw-r--r--testsuites/psxtests/psxhdrs/signal/sigprocmask.c37
-rw-r--r--testsuites/psxtests/psxhdrs/signal/sigsuspend.c31
-rw-r--r--testsuites/psxtests/psxhdrs/signal/sigtimedwait.c33
-rw-r--r--testsuites/psxtests/psxhdrs/signal/sigwait.c32
-rw-r--r--testsuites/psxtests/psxhdrs/signal/sigwaitinfo.c32
9 files changed, 299 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxhdrs/signal/pthread_sigmask.c b/testsuites/psxtests/psxhdrs/signal/pthread_sigmask.c
new file mode 100644
index 0000000000..7a25895b23
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/signal/pthread_sigmask.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 <signal.h>
+
+#ifndef _POSIX_THREADS
+#define "rtems is supposed to have pthread_sigmask"
+#endif
+
+int test( void );
+
+int test( void )
+{
+ int how;
+ sigset_t set;
+ sigset_t oset;
+ int result;
+
+ how = SIG_BLOCK;
+ how = SIG_UNBLOCK;
+ how = SIG_SETMASK;
+
+ (void) sigemptyset( &set );
+
+ result = pthread_sigmask( how, &set, &oset );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/signal/raise.c b/testsuites/psxtests/psxhdrs/signal/raise.c
new file mode 100644
index 0000000000..bae84d06a2
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/signal/raise.c
@@ -0,0 +1,31 @@
+/*
+ * 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 <signal.h>
+
+int test( void );
+
+int test( void )
+{
+ int signal_number;
+ int result;
+
+ signal_number = SIGALRM;
+
+ result = raise( signal_number );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/signal/signal.c b/testsuites/psxtests/psxhdrs/signal/signal.c
new file mode 100644
index 0000000000..266f50fa39
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/signal/signal.c
@@ -0,0 +1,31 @@
+/*
+ * 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 <signal.h>
+
+int test( void );
+
+int test( void )
+{
+ void (*signal_function_pointer)(int);
+ int signal_number;
+
+ signal_number = SIGALRM;
+
+ signal_function_pointer = signal( signal_number, SIG_IGN );
+
+ return (signal_function_pointer == SIG_ERR) ? -1 : 0;
+}
diff --git a/testsuites/psxtests/psxhdrs/signal/sigpending.c b/testsuites/psxtests/psxhdrs/signal/sigpending.c
new file mode 100644
index 0000000000..16d4cf7404
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/signal/sigpending.c
@@ -0,0 +1,31 @@
+/*
+ * 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 <signal.h>
+
+int test( void );
+
+int test( void )
+{
+ sigset_t set;
+ int result;
+
+ (void) sigemptyset( &set );
+
+ result = sigpending( &set );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/signal/sigprocmask.c b/testsuites/psxtests/psxhdrs/signal/sigprocmask.c
new file mode 100644
index 0000000000..0c4a93cd30
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/signal/sigprocmask.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 <signal.h>
+
+int test( void );
+
+int test( void )
+{
+ int how;
+ sigset_t set;
+ sigset_t oset;
+ int result;
+
+ how = SIG_BLOCK;
+ how = SIG_UNBLOCK;
+ how = SIG_SETMASK;
+
+ (void) sigemptyset( &set );
+
+ result = sigprocmask( how, &set, &oset );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/signal/sigsuspend.c b/testsuites/psxtests/psxhdrs/signal/sigsuspend.c
new file mode 100644
index 0000000000..635d2ef013
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/signal/sigsuspend.c
@@ -0,0 +1,31 @@
+/*
+ * 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 <signal.h>
+
+int test( void );
+
+int test( void )
+{
+ sigset_t sigmask;
+ int result;
+
+ (void) sigemptyset( &sigmask );
+
+ result = sigsuspend( &sigmask );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/signal/sigtimedwait.c b/testsuites/psxtests/psxhdrs/signal/sigtimedwait.c
new file mode 100644
index 0000000000..ca2eee72f9
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/signal/sigtimedwait.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 <signal.h>
+
+int test( void );
+
+int test( void )
+{
+ sigset_t set;
+ siginfo_t info;
+ struct timespec timeout;
+ int result;
+
+ sigemptyset( &set );
+
+ result = sigtimedwait( &set, &info, &timeout );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/signal/sigwait.c b/testsuites/psxtests/psxhdrs/signal/sigwait.c
new file mode 100644
index 0000000000..16050e88bd
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/signal/sigwait.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 <signal.h>
+
+int test( void );
+
+int test( void )
+{
+ sigset_t set;
+ int sig;
+ int result;
+
+ (void) sigemptyset( &set );
+
+ result = sigwait( &set, &sig );
+
+ return result;
+}
diff --git a/testsuites/psxtests/psxhdrs/signal/sigwaitinfo.c b/testsuites/psxtests/psxhdrs/signal/sigwaitinfo.c
new file mode 100644
index 0000000000..d6e64d7b20
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/signal/sigwaitinfo.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 <signal.h>
+
+int test( void );
+
+int test( void )
+{
+ sigset_t set;
+ siginfo_t info;
+ int result;
+
+ (void) sigemptyset( &set );
+
+ result = sigwaitinfo( &set, &info );
+
+ return result;
+}