Changeset d4548d1 in rtems for c/src/exec/posix/src/mqueuecreatesupp.c
- Timestamp:
- 12/23/99 22:07:11 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 96d4aea
- Parents:
- e1786ee3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/posix/src/mqueuecreatesupp.c
re1786ee3 rd4548d1 38 38 int pshared, 39 39 unsigned int oflag, 40 struct mq_attr *attr ,40 struct mq_attr *attr_ptr, 41 41 POSIX_Message_queue_Control **message_queue 42 42 ) 43 43 { 44 44 POSIX_Message_queue_Control *the_mq; 45 45 CORE_message_queue_Attributes *the_mq_attr; 46 struct mq_attr attr; 47 46 48 _Thread_Disable_dispatch(); 47 49 48 the_mq = _POSIX_Message_queue_Allocate(); 49 50 if ( !the_mq ) { 51 _Thread_Enable_dispatch(); 52 set_errno_and_return_minus_one( ENFILE ); 50 if ( attr_ptr == NULL ) { 51 attr.mq_maxmsg = 0; /* XXX */ 52 attr.mq_msgsize = 0; /* XXX */ 53 } else { 54 if ( attr_ptr->mq_maxmsg < 0 ){ 55 _Thread_Enable_dispatch(); 56 set_errno_and_return_minus_one( EINVAL ); 57 } 58 59 if ( attr_ptr->mq_msgsize < 0 ){ 60 _Thread_Enable_dispatch(); 61 set_errno_and_return_minus_one( EINVAL ); 62 } 63 64 attr = *attr_ptr; 53 65 } 54 66 55 67 #if defined(RTEMS_MULTIPROCESSING) 56 68 if ( pshared == PTHREAD_PROCESS_SHARED && … … 63 75 #endif 64 76 77 if ( name ) { 78 79 if( strlen(name) > PATH_MAX ) { /* XXX - Is strlen ok to use here ? */ 80 _Thread_Enable_dispatch(); 81 set_errno_and_return_minus_one( ENAMETOOLONG ); 82 } 83 84 /* 85 * XXX Greater than NAME_MAX while POSIX_NO_TRUNC in effect. 86 * XXX Error description in POSIX book different for mq_open and mq_unlink 87 * Why??? 88 */ 89 } 90 91 the_mq = _POSIX_Message_queue_Allocate(); 92 if ( !the_mq ) { 93 _Thread_Enable_dispatch(); 94 set_errno_and_return_minus_one( ENFILE ); 95 } 96 65 97 the_mq->process_shared = pshared; 66 98 … … 69 101 the_mq->open_count = 1; 70 102 the_mq->linked = TRUE; 103 } 104 else { 105 the_mq->named = FALSE; 106 71 107 } 72 else 73 the_mq->named = FALSE; 74 108 75 109 if ( oflag & O_NONBLOCK ) 76 110 the_mq->blocking = FALSE; … … 91 125 the_mq_attr->waiting_discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO; 92 126 */ 127 93 128 94 129 the_mq->Message_queue.Attributes.discipline = 95 130 CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO; 96 131 the_mq_attr = &the_mq->Message_queue.Attributes; 132 97 133 if ( ! _CORE_message_queue_Initialize( 98 134 &the_mq->Message_queue, 99 135 OBJECTS_POSIX_MESSAGE_QUEUES, 100 &the_mq->Message_queue.Attributes,101 attr ->mq_maxmsg,102 attr ->mq_msgsize,136 the_mq_attr, 137 attr.mq_maxmsg, 138 attr.mq_msgsize, 103 139 #if defined(RTEMS_MULTIPROCESSING) 104 140 _POSIX_Message_queue_MP_Send_extract_proxy … … 142 178 } 143 179 180 181 182 183
Note: See TracChangeset
for help on using the changeset viewer.