Changeset f643e230 in rtems
- Timestamp:
- 08/09/96 18:47:38 (27 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- d0b5249
- Parents:
- 8699a70
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/tests/psxtests/psx01/init.c
r8699a70 rf643e230 14 14 #include "system.h" 15 15 #include <sched.h> 16 17 16 18 17 void *POSIX_Init( … … 91 90 printf( "Init: ID is 0x%08x\n", Init_id ); 92 91 93 /* print theminimum priority */92 /* exercise get minimum priority */ 94 93 95 94 priority = sched_get_priority_min( SCHED_FIFO ); 96 printf( "Init: Minimum priority for FIFO is%d\n", priority );95 printf( "Init: sched_get_priority_min (SCHED_FIFO) -- %d\n", priority ); 97 96 assert( priority != -1 ); 98 97 99 /* print the maximum priority */ 98 puts( "Init: sched_get_priority_min -- EINVAL (invalid policy)" ); 99 priority = sched_get_priority_min( -1 ); 100 assert( priority == -1 ); 101 assert( errno == EINVAL ); 102 103 /* exercise get maximum priority */ 100 104 101 105 priority = sched_get_priority_max( SCHED_FIFO ); 102 printf( "Init: Maximum priority for FIFO is%d\n", priority );106 printf( "Init: sched_get_priority_max (SCHED_FIFO) -- %d\n", priority ); 103 107 assert( priority != -1 ); 108 109 puts( "Init: sched_get_priority_min -- EINVAL (invalid policy)" ); 110 priority = sched_get_priority_min( -1 ); 111 assert( priority == -1 ); 112 assert( errno == EINVAL ); 104 113 105 114 /* print the round robin time quantum */ … … 115 124 /* create a thread */ 116 125 126 puts( "Init: pthread_create - SUCCESSFUL" ); 117 127 status = pthread_create( &thread_id, NULL, Task_1_through_3, NULL ); 118 128 assert( !status ); 119 129 130 /* too may threads error */ 131 132 puts( "Init: pthread_create - EINVAL (too many threads)" ); 133 status = pthread_create( &thread_id, NULL, Task_1_through_3, NULL ); 134 assert( status == EINVAL ); 135 136 puts( "Init: sched_yield to Task_1" ); 137 status = sched_yield(); 138 assert( !status ); 139 140 /* switch to Task_1 */ 141 120 142 /* exit this thread */ 121 143 144 puts( "Init: pthread_exit" ); 122 145 pthread_exit( NULL ); 146 147 /* switch to Task_1 */ 123 148 124 149 return NULL; /* just so the compiler thinks we returned something */ -
testsuites/psxtests/psx01/init.c
r8699a70 rf643e230 14 14 #include "system.h" 15 15 #include <sched.h> 16 17 16 18 17 void *POSIX_Init( … … 91 90 printf( "Init: ID is 0x%08x\n", Init_id ); 92 91 93 /* print theminimum priority */92 /* exercise get minimum priority */ 94 93 95 94 priority = sched_get_priority_min( SCHED_FIFO ); 96 printf( "Init: Minimum priority for FIFO is%d\n", priority );95 printf( "Init: sched_get_priority_min (SCHED_FIFO) -- %d\n", priority ); 97 96 assert( priority != -1 ); 98 97 99 /* print the maximum priority */ 98 puts( "Init: sched_get_priority_min -- EINVAL (invalid policy)" ); 99 priority = sched_get_priority_min( -1 ); 100 assert( priority == -1 ); 101 assert( errno == EINVAL ); 102 103 /* exercise get maximum priority */ 100 104 101 105 priority = sched_get_priority_max( SCHED_FIFO ); 102 printf( "Init: Maximum priority for FIFO is%d\n", priority );106 printf( "Init: sched_get_priority_max (SCHED_FIFO) -- %d\n", priority ); 103 107 assert( priority != -1 ); 108 109 puts( "Init: sched_get_priority_min -- EINVAL (invalid policy)" ); 110 priority = sched_get_priority_min( -1 ); 111 assert( priority == -1 ); 112 assert( errno == EINVAL ); 104 113 105 114 /* print the round robin time quantum */ … … 115 124 /* create a thread */ 116 125 126 puts( "Init: pthread_create - SUCCESSFUL" ); 117 127 status = pthread_create( &thread_id, NULL, Task_1_through_3, NULL ); 118 128 assert( !status ); 119 129 130 /* too may threads error */ 131 132 puts( "Init: pthread_create - EINVAL (too many threads)" ); 133 status = pthread_create( &thread_id, NULL, Task_1_through_3, NULL ); 134 assert( status == EINVAL ); 135 136 puts( "Init: sched_yield to Task_1" ); 137 status = sched_yield(); 138 assert( !status ); 139 140 /* switch to Task_1 */ 141 120 142 /* exit this thread */ 121 143 144 puts( "Init: pthread_exit" ); 122 145 pthread_exit( NULL ); 146 147 /* switch to Task_1 */ 123 148 124 149 return NULL; /* just so the compiler thinks we returned something */
Note: See TracChangeset
for help on using the changeset viewer.