From e0c01614d908c4bc3f694415ae5558275761bc73 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 11 Jan 2000 15:43:00 +0000 Subject: 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 . --- testsuites/psxtests/psx03/init.c | 28 ++++++++++++++++++++++++++++ testsuites/psxtests/psx03/psx03.scn | 4 ++++ 2 files changed, 32 insertions(+) (limited to 'testsuites/psxtests/psx03') 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 *** -- cgit v1.2.3