Changeset 3ebd4c1 in rtems
- Timestamp:
- 01/05/00 17:13:50 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- c5858ef
- Parents:
- fcd0c90
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/posix/src/mqueuesendsupp.c
rfcd0c90 r3ebd4c1 29 29 #include <rtems/posix/time.h> 30 30 31 31 32 /*PAGE 32 33 * … … 38 39 const char *msg_ptr, 39 40 unsigned32 msg_len, 40 Priority_Controlmsg_prio,41 unsigned32 msg_prio, 41 42 Watchdog_Interval timeout 42 43 ) … … 44 45 register POSIX_Message_queue_Control *the_mq; 45 46 Objects_Locations location; 46 47 CORE_message_queue_Status status; 48 49 /* 50 * Validate the priority. 51 * XXX - Do not validate msg_prio is not less than 0. 52 */ 53 54 if ( msg_prio > MQ_PRIO_MAX ) 55 set_errno_and_return_minus_one( EINVAL ); 56 47 57 the_mq = _POSIX_Message_queue_Get( mqdes, &location ); 58 48 59 switch ( location ) { 49 60 case OBJECTS_ERROR: 50 set_errno_and_return_minus_one( EINVAL ); 61 set_errno_and_return_minus_one( EBADF ); 62 51 63 case OBJECTS_REMOTE: 52 64 _Thread_Dispatch(); 53 65 return POSIX_MP_NOT_IMPLEMENTED(); 54 66 set_errno_and_return_minus_one( EINVAL ); 67 55 68 case OBJECTS_LOCAL: 56 /* XXX must add support for timeout and priority */ 57 _CORE_message_queue_Send( 69 if ( (the_mq->oflag & O_ACCMODE) == O_RDONLY ) { 70 _Thread_Enable_dispatch(); 71 set_errno_and_return_minus_one( EBADF ); 72 } 73 74 status = _CORE_message_queue_Submit( 58 75 &the_mq->Message_queue, 59 76 (void *) msg_ptr, 60 77 msg_len, 61 mqdes, 78 mqdes, /* mqd_t is an object id */ 62 79 #if defined(RTEMS_MULTIPROCESSING) 63 NULL 80 NULL, /* XXX _POSIX_Message_queue_Core_message_queue_mp_support*/ 64 81 #else 65 NULL 82 NULL, 66 83 #endif 84 _POSIX_Message_queue_Priority_to_core( msg_prio ) 67 85 ); 86 87 if ( status != CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL ) { 88 _Thread_Enable_dispatch(); 89 set_errno_and_return_minus_one( 90 _POSIX_Message_queue_Translate_core_message_queue_return_code(status) 91 ); 92 } 93 94 /* 95 * For now, we can't do a blocking send. So if we get here, it was 96 * a successful send. The return code in the TCB won't be set by 97 * the SuperCore since it does not support blocking mqueue sends. 98 */ 99 100 #if 1 101 _Thread_Enable_dispatch(); 102 return 0; 103 #else 68 104 _Thread_Enable_dispatch(); 69 105 return _Thread_Executing->Wait.return_code; 106 #endif 70 107 } 108 71 109 return POSIX_BOTTOM_REACHED(); 72 110 } 73 -
cpukit/posix/src/mqueuesendsupp.c
rfcd0c90 r3ebd4c1 29 29 #include <rtems/posix/time.h> 30 30 31 31 32 /*PAGE 32 33 * … … 38 39 const char *msg_ptr, 39 40 unsigned32 msg_len, 40 Priority_Controlmsg_prio,41 unsigned32 msg_prio, 41 42 Watchdog_Interval timeout 42 43 ) … … 44 45 register POSIX_Message_queue_Control *the_mq; 45 46 Objects_Locations location; 46 47 CORE_message_queue_Status status; 48 49 /* 50 * Validate the priority. 51 * XXX - Do not validate msg_prio is not less than 0. 52 */ 53 54 if ( msg_prio > MQ_PRIO_MAX ) 55 set_errno_and_return_minus_one( EINVAL ); 56 47 57 the_mq = _POSIX_Message_queue_Get( mqdes, &location ); 58 48 59 switch ( location ) { 49 60 case OBJECTS_ERROR: 50 set_errno_and_return_minus_one( EINVAL ); 61 set_errno_and_return_minus_one( EBADF ); 62 51 63 case OBJECTS_REMOTE: 52 64 _Thread_Dispatch(); 53 65 return POSIX_MP_NOT_IMPLEMENTED(); 54 66 set_errno_and_return_minus_one( EINVAL ); 67 55 68 case OBJECTS_LOCAL: 56 /* XXX must add support for timeout and priority */ 57 _CORE_message_queue_Send( 69 if ( (the_mq->oflag & O_ACCMODE) == O_RDONLY ) { 70 _Thread_Enable_dispatch(); 71 set_errno_and_return_minus_one( EBADF ); 72 } 73 74 status = _CORE_message_queue_Submit( 58 75 &the_mq->Message_queue, 59 76 (void *) msg_ptr, 60 77 msg_len, 61 mqdes, 78 mqdes, /* mqd_t is an object id */ 62 79 #if defined(RTEMS_MULTIPROCESSING) 63 NULL 80 NULL, /* XXX _POSIX_Message_queue_Core_message_queue_mp_support*/ 64 81 #else 65 NULL 82 NULL, 66 83 #endif 84 _POSIX_Message_queue_Priority_to_core( msg_prio ) 67 85 ); 86 87 if ( status != CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL ) { 88 _Thread_Enable_dispatch(); 89 set_errno_and_return_minus_one( 90 _POSIX_Message_queue_Translate_core_message_queue_return_code(status) 91 ); 92 } 93 94 /* 95 * For now, we can't do a blocking send. So if we get here, it was 96 * a successful send. The return code in the TCB won't be set by 97 * the SuperCore since it does not support blocking mqueue sends. 98 */ 99 100 #if 1 101 _Thread_Enable_dispatch(); 102 return 0; 103 #else 68 104 _Thread_Enable_dispatch(); 69 105 return _Thread_Executing->Wait.return_code; 106 #endif 70 107 } 108 71 109 return POSIX_BOTTOM_REACHED(); 72 110 } 73
Note: See TracChangeset
for help on using the changeset viewer.