Changeset 9b67f170 in rtems
- Timestamp:
- 08/13/96 15:36:28 (26 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- b2e8026
- Parents:
- fc960ab
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/tests/psxtests/psx03/init.c
rfc960ab r9b67f170 147 147 assert( !status ); 148 148 149 /* signal handler is still installed, maskis still set for SIGUSR1 */149 /* signal handler is still installed, waitset is still set for SIGUSR1 */ 150 150 151 151 /* wait on SIGUSR1 for 3 seconds, will receive SIGUSR1 from Task_2 */ … … 161 161 162 162 puts( "Init: waiting on any signal for 3 seconds." ); 163 signo = sigtimedwait( & mask, &siginfo, &timeout );164 printf( "Init: correctly received SIGUSR1 - %d\n", siginfo.si_signo);163 signo = sigtimedwait( &waitset, &siginfo, &timeout ); 164 printf( "Init: received (%d) SIGUSR1=%d\n", siginfo.si_signo, SIGUSR1 ); 165 165 assert( signo == SIGUSR1 ); 166 166 assert( siginfo.si_signo == SIGUSR1 ); … … 168 168 assert( siginfo.si_value.sival_int != -1 ); /* rtems does always set this */ 169 169 170 171 /*172 status = sigemptyset( &mask );173 assert( !status );174 175 status = sigaddset( &mask, SIGUSR1 );176 assert( !status );177 178 printf( "Init: Block SIGUSR1\n" );179 status = sigprocmask( SIG_BLOCK, &mask, NULL );180 assert( !status );181 182 status = sigpending( &pending_set );183 assert( !status );184 printf( "Init: Signals pending 0x%08x\n", pending_set );185 186 printf( "Init: send SIGUSR1 to self\n" );187 status = pthread_kill( Init_id, SIGUSR1 );188 assert( !status );189 190 status = sigpending( &pending_set );191 assert( !status );192 printf( "Init: Signals pending 0x%08x\n", pending_set );193 194 printf( "Init: Unblock SIGUSR1\n" );195 status = sigprocmask( SIG_UNBLOCK, &mask, NULL );196 assert( !status );197 198 */199 200 /*201 * Loop for 5 seconds seeing how many signals we catch202 */203 204 /*205 tr.tv_sec = 5;206 tr.tv_nsec = 0;207 208 do {209 tv = tr;210 211 Signal_occurred = 0;212 213 status = nanosleep ( &tv, &tr );214 assert( !status );215 216 printf(217 "Init: signal was %sprocessed with %d:%d time remaining\n",218 (Signal_occurred) ? "" : "not ",219 (int) tr.tv_sec,220 (int) tr.tv_nsec221 );222 223 } while ( tr.tv_sec || tr.tv_nsec );224 225 */226 227 170 /* exit this thread */ 228 171 -
testsuites/psxtests/psx03/init.c
rfc960ab r9b67f170 147 147 assert( !status ); 148 148 149 /* signal handler is still installed, maskis still set for SIGUSR1 */149 /* signal handler is still installed, waitset is still set for SIGUSR1 */ 150 150 151 151 /* wait on SIGUSR1 for 3 seconds, will receive SIGUSR1 from Task_2 */ … … 161 161 162 162 puts( "Init: waiting on any signal for 3 seconds." ); 163 signo = sigtimedwait( & mask, &siginfo, &timeout );164 printf( "Init: correctly received SIGUSR1 - %d\n", siginfo.si_signo);163 signo = sigtimedwait( &waitset, &siginfo, &timeout ); 164 printf( "Init: received (%d) SIGUSR1=%d\n", siginfo.si_signo, SIGUSR1 ); 165 165 assert( signo == SIGUSR1 ); 166 166 assert( siginfo.si_signo == SIGUSR1 ); … … 168 168 assert( siginfo.si_value.sival_int != -1 ); /* rtems does always set this */ 169 169 170 171 /*172 status = sigemptyset( &mask );173 assert( !status );174 175 status = sigaddset( &mask, SIGUSR1 );176 assert( !status );177 178 printf( "Init: Block SIGUSR1\n" );179 status = sigprocmask( SIG_BLOCK, &mask, NULL );180 assert( !status );181 182 status = sigpending( &pending_set );183 assert( !status );184 printf( "Init: Signals pending 0x%08x\n", pending_set );185 186 printf( "Init: send SIGUSR1 to self\n" );187 status = pthread_kill( Init_id, SIGUSR1 );188 assert( !status );189 190 status = sigpending( &pending_set );191 assert( !status );192 printf( "Init: Signals pending 0x%08x\n", pending_set );193 194 printf( "Init: Unblock SIGUSR1\n" );195 status = sigprocmask( SIG_UNBLOCK, &mask, NULL );196 assert( !status );197 198 */199 200 /*201 * Loop for 5 seconds seeing how many signals we catch202 */203 204 /*205 tr.tv_sec = 5;206 tr.tv_nsec = 0;207 208 do {209 tv = tr;210 211 Signal_occurred = 0;212 213 status = nanosleep ( &tv, &tr );214 assert( !status );215 216 printf(217 "Init: signal was %sprocessed with %d:%d time remaining\n",218 (Signal_occurred) ? "" : "not ",219 (int) tr.tv_sec,220 (int) tr.tv_nsec221 );222 223 } while ( tr.tv_sec || tr.tv_nsec );224 225 */226 227 170 /* exit this thread */ 228 171
Note: See TracChangeset
for help on using the changeset viewer.