summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-01-11 15:43:00 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-01-11 15:43:00 +0000
commite0c01614d908c4bc3f694415ae5558275761bc73 (patch)
tree39bb3b4d46539d1cb825409dad67255e55967e2a /testsuites/psxtests
parentThis code did not return properly when a process oriented signal (diff)
downloadrtems-e0c01614d908c4bc3f694415ae5558275761bc73.tar.bz2
This test was enhanced to test for the case in sigtimedwait() where it
must deal with a pending process oriented signal. Prior to the addition of this testcase, sigtimedwait() did not return properly when a process oriented signal was pending. The problem was reported by Wayne Bullaughey <wayneb@cacdsp.com>.
Diffstat (limited to 'testsuites/psxtests')
-rw-r--r--testsuites/psxtests/psx03/init.c28
-rw-r--r--testsuites/psxtests/psx03/psx03.scn4
2 files changed, 32 insertions, 0 deletions
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 ***