summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--c/src/tests/psxtests/psx03/init.c28
-rw-r--r--c/src/tests/psxtests/psx03/psx03.scn4
-rw-r--r--testsuites/psxtests/psx03/init.c28
-rw-r--r--testsuites/psxtests/psx03/psx03.scn4
4 files changed, 64 insertions, 0 deletions
diff --git a/c/src/tests/psxtests/psx03/init.c b/c/src/tests/psxtests/psx03/init.c
index 5a44392a1b..4547ac7221 100644
--- a/c/src/tests/psxtests/psx03/init.c
+++ b/c/src/tests/psxtests/psx03/init.c
@@ -166,6 +166,34 @@ void *POSIX_Init(
assert( siginfo.si_code == SI_USER );
assert( siginfo.si_value.sival_int != -1 ); /* rtems does always set this */
+ /* try out a process signal */
+
+ empty_line();
+ puts( "Init: kill with SIGUSR2." );
+ status = kill( getpid(), SIGUSR2 );
+ assert( !status );
+
+ siginfo.si_code = -1;
+ siginfo.si_signo = -1;
+ siginfo.si_value.sival_int = -1;
+
+ status = sigemptyset( &waitset );
+ assert( !status );
+
+ status = sigaddset( &waitset, SIGUSR1 );
+ assert( !status );
+
+ status = sigaddset( &waitset, SIGUSR2 );
+ assert( !status );
+
+ puts( "Init: waiting on any signal for 3 seconds." );
+ signo = sigtimedwait( &waitset, &siginfo, &timeout );
+ printf( "Init: received (%d) SIGUSR2=%d\n", siginfo.si_signo, SIGUSR2 );
+ assert( signo == SIGUSR2 );
+ assert( siginfo.si_signo == SIGUSR2 );
+ assert( siginfo.si_code == SI_USER );
+ assert( siginfo.si_value.sival_int != -1 ); /* rtems does always set this */
+
/* exit this thread */
puts( "*** END OF POSIX TEST 3 ***" );
diff --git a/c/src/tests/psxtests/psx03/psx03.scn b/c/src/tests/psxtests/psx03/psx03.scn
index 61ba36592a..28ebc311d4 100644
--- a/c/src/tests/psxtests/psx03/psx03.scn
+++ b/c/src/tests/psxtests/psx03/psx03.scn
@@ -14,4 +14,8 @@ Task_2: Fri May 24 11:05:06 1996
Task_1: pthread_kill - SIGUSR1 to Init
Signal: 16 caught by 0xc010001 (1)
Init: received (16) SIGUSR1=16
+
+Init: kill with SIGUSR2.
+Init: waiting on any signal for 3 seconds.
+Init: received (17) SIGUSR2=17
*** END OF POSIX TEST 3 ***
diff --git a/testsuites/psxtests/psx03/init.c b/testsuites/psxtests/psx03/init.c
index 5a44392a1b..4547ac7221 100644
--- a/testsuites/psxtests/psx03/init.c
+++ b/testsuites/psxtests/psx03/init.c
@@ -166,6 +166,34 @@ void *POSIX_Init(
assert( siginfo.si_code == SI_USER );
assert( siginfo.si_value.sival_int != -1 ); /* rtems does always set this */
+ /* try out a process signal */
+
+ empty_line();
+ puts( "Init: kill with SIGUSR2." );
+ status = kill( getpid(), SIGUSR2 );
+ assert( !status );
+
+ siginfo.si_code = -1;
+ siginfo.si_signo = -1;
+ siginfo.si_value.sival_int = -1;
+
+ status = sigemptyset( &waitset );
+ assert( !status );
+
+ status = sigaddset( &waitset, SIGUSR1 );
+ assert( !status );
+
+ status = sigaddset( &waitset, SIGUSR2 );
+ assert( !status );
+
+ puts( "Init: waiting on any signal for 3 seconds." );
+ signo = sigtimedwait( &waitset, &siginfo, &timeout );
+ printf( "Init: received (%d) SIGUSR2=%d\n", siginfo.si_signo, SIGUSR2 );
+ assert( signo == SIGUSR2 );
+ assert( siginfo.si_signo == SIGUSR2 );
+ assert( siginfo.si_code == SI_USER );
+ assert( siginfo.si_value.sival_int != -1 ); /* rtems does always set this */
+
/* exit this thread */
puts( "*** END OF POSIX TEST 3 ***" );
diff --git a/testsuites/psxtests/psx03/psx03.scn b/testsuites/psxtests/psx03/psx03.scn
index 61ba36592a..28ebc311d4 100644
--- a/testsuites/psxtests/psx03/psx03.scn
+++ b/testsuites/psxtests/psx03/psx03.scn
@@ -14,4 +14,8 @@ Task_2: Fri May 24 11:05:06 1996
Task_1: pthread_kill - SIGUSR1 to Init
Signal: 16 caught by 0xc010001 (1)
Init: received (16) SIGUSR1=16
+
+Init: kill with SIGUSR2.
+Init: waiting on any signal for 3 seconds.
+Init: received (17) SIGUSR2=17
*** END OF POSIX TEST 3 ***