source: rtems/cpukit/posix/include/rtems/posix/mqueue.h @ 277cc95

4.104.114.84.95
Last change on this file since 277cc95 was 8e36f29, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:54:26

2003-09-04 Joel Sherrill <joel@…>

  • include/rtems/posix/cond.h, include/rtems/posix/condmp.h, include/rtems/posix/config.h, include/rtems/posix/intr.h, include/rtems/posix/key.h, include/rtems/posix/mqueue.h, include/rtems/posix/mqueuemp.h, include/rtems/posix/mutex.h, include/rtems/posix/mutexmp.h, include/rtems/posix/posixapi.h, include/rtems/posix/pthread.h, include/rtems/posix/pthreadmp.h, include/rtems/posix/ptimer.h, include/rtems/posix/semaphore.h, include/rtems/posix/semaphoremp.h, inline/rtems/posix/cond.inl, inline/rtems/posix/intr.inl, inline/rtems/posix/key.inl, inline/rtems/posix/mqueue.inl, inline/rtems/posix/mutex.inl, inline/rtems/posix/pthread.inl, inline/rtems/posix/semaphore.inl, inline/rtems/posix/timer.inl, macros/rtems/posix/cond.inl, macros/rtems/posix/intr.inl, macros/rtems/posix/key.inl, macros/rtems/posix/mqueue.inl, macros/rtems/posix/mutex.inl, macros/rtems/posix/pthread.inl, macros/rtems/posix/semaphore.inl, macros/rtems/posix/timer.inl, src/alarm.c, src/kill.c, src/killinfo.c, src/mqueuetranslatereturncode.c, src/pause.c, src/pthreadattrdestroy.c, src/pthreadattrgetdetachstate.c, src/pthreadattrgetinheritsched.c, src/pthreadattrgetschedparam.c, src/pthreadattrgetschedpolicy.c, src/pthreadattrgetscope.c, src/pthreadattrgetstackaddr.c, src/pthreadattrgetstacksize.c, src/pthreadattrinit.c, src/pthreadattrsetdetachstate.c, src/pthreadattrsetinheritsched.c, src/pthreadattrsetschedparam.c, src/pthreadattrsetschedpolicy.c, src/pthreadattrsetscope.c, src/pthreadattrsetstackaddr.c, src/pthreadattrsetstacksize.c, src/pthreadcreate.c, src/pthreaddetach.c, src/pthreadequal.c, src/pthreadexit.c, src/pthreadgetcpuclockid.c, src/pthreadgetcputime.c, src/pthreadgetschedparam.c, src/pthreadjoin.c, src/pthreadkill.c, src/pthreadonce.c, src/pthreadself.c, src/pthreadsetcputime.c, src/pthreadsetschedparam.c, src/pthreadsigmask.c, src/sigaction.c, src/sigaddset.c, src/sigdelset.c, src/sigemptyset.c, src/sigfillset.c, src/sigismember.c, src/signal_2.c, src/sigpending.c, src/sigprocmask.c, src/sigqueue.c, src/sigsuspend.c, src/sigtimedwait.c, src/sigwait.c, src/sigwaitinfo.c, src/ualarm.c: URL for license changed.
  • Property mode set to 100644
File size: 5.5 KB
Line 
1/*  rtems/posix/mqueue.h
2 *
3 *  This include file contains all the private support information for
4 *  POSIX Message Queues.
5 *
6 *  COPYRIGHT (c) 1989-1999.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15 
16#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_h
17#define __RTEMS_POSIX_MESSAGE_QUEUE_h
18 
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include <signal.h>
24
25#include <rtems/score/coremsg.h>
26#include <rtems/score/object.h>
27
28/*
29 *  Data Structure used to manage a POSIX message queue
30 */
31 
32typedef struct {
33   Objects_Control             Object;
34   int                         process_shared;
35   boolean                     named;
36   boolean                     linked;
37   unsigned32                  open_count;
38   CORE_message_queue_Control  Message_queue;
39   struct sigevent             notification;
40}  POSIX_Message_queue_Control;
41
42typedef struct {
43   Objects_Control              Object;
44   POSIX_Message_queue_Control *Queue;
45   int                          oflag;
46} POSIX_Message_queue_Control_fd;
47
48/*
49 *  The following defines the information control block used to manage
50 *  this class of objects.  The second item is used to manage the set
51 *  of "file descriptors" associated with the message queues.
52 */
53 
54POSIX_EXTERN Objects_Information  _POSIX_Message_queue_Information;
55POSIX_EXTERN Objects_Information  _POSIX_Message_queue_Information_fds;
56 
57/*
58 *  _POSIX_Message_queue_Manager_initialization
59 *
60 *  DESCRIPTION:
61 *
62 *  This routine performs the initialization necessary for this manager.
63 */
64 
65void _POSIX_Message_queue_Manager_initialization(
66  unsigned32 maximum_message_queues
67);
68 
69/*
70 *
71 *  _POSIX_Message_queue_Create_support
72 *
73 *  DESCRIPTION:
74 *
75 *  This routine performs the creation of a message queue utilizing the
76 *  core message queue.
77 */
78 
79int _POSIX_Message_queue_Create_support(
80  const char                    *name,
81  int                            pshared,
82  struct mq_attr                *attr,
83  POSIX_Message_queue_Control  **message_queue
84);
85
86/*
87 *  _POSIX_Message_queue_Delete
88 *
89 *  DESCRIPTION:
90 *
91 *  This routine supports the mq_unlink and mq_close routines by
92 *  doing most of the work involved with removing a message queue.
93 */
94 
95void _POSIX_Message_queue_Delete(
96  POSIX_Message_queue_Control *the_mq
97);
98
99/*
100 *  _POSIX_Message_queue_Receive_support
101 *
102 *  DESCRIPTION:
103 *
104 *  This routine supports the various flavors of receiving a message.
105 */
106
107ssize_t _POSIX_Message_queue_Receive_support(
108  mqd_t               mqdes,
109  char               *msg_ptr,
110  size_t              msg_len,
111  unsigned int       *msg_prio,
112  Watchdog_Interval   timeout
113);
114
115/*
116 *  _POSIX_Message_queue_Send_support
117 *
118 *  DESCRIPTION:
119 *
120 *  This routine posts a message to a specified message queue.
121 */
122
123int _POSIX_Message_queue_Send_support(
124  mqd_t               mqdes,
125  const char         *msg_ptr,
126  unsigned32          msg_len,
127  unsigned32          msg_prio,
128  Watchdog_Interval   timeout
129);
130
131/*
132 *  _POSIX_Message_queue_Allocate
133 *
134 *  DESCRIPTION:
135 *
136 *  This function allocates a message queue control block from
137 *  the inactive chain of free message queue control blocks.
138 */
139 
140RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void );
141 
142/*
143 *  _POSIX_Message_queue_Free
144 *
145 *  DESCRIPTION:
146 *
147 *  This routine frees a message queue control block to the
148 *  inactive chain of free message queue control blocks.
149 */
150 
151RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
152  POSIX_Message_queue_Control *the_mq
153);
154 
155/*
156 *  _POSIX_Message_queue_Get
157 *
158 *  DESCRIPTION:
159 *
160 *  This function maps message queue IDs to message queue control blocks.
161 *  If ID corresponds to a local message queue, then it returns
162 *  the_mq control pointer which maps to ID and location
163 *  is set to OBJECTS_LOCAL.  if the message queue ID is global and
164 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
165 *  and the_message queue is undefined.  Otherwise, location is set
166 *  to OBJECTS_ERROR and the_mq is undefined.
167 */
168 
169RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
170  Objects_Id         id,
171  Objects_Locations *location
172);
173 
174/*
175 *  _POSIX_Message_queue_Is_null
176 *
177 *  DESCRIPTION:
178 *
179 *  This function returns TRUE if the_message_queue is NULL and FALSE otherwise.
180 */
181 
182RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
183  POSIX_Message_queue_Control *the_mq
184);
185
186/*
187 *  _POSIX_Message_queue_Name_to_id
188 *
189 *  DESCRIPTION:
190 *
191 *  This routine looks up the specified name for a message queue and returns the
192 *  id of the message queue associated with it.
193 */
194
195int _POSIX_Message_queue_Name_to_id(
196  const char          *name,
197  Objects_Id          *id
198);
199
200/*
201 *  _POSIX_Message_queue_Priority_to_core
202 *
203 *  DESCRIPTION:
204 *
205 *  XXX
206 */
207 
208RTEMS_INLINE_ROUTINE CORE_message_queue_Submit_types _POSIX_Message_queue_Priority_to_core(
209  unsigned int priority
210);
211
212/*
213 *  _POSIX_Message_queue_Priority_from_core
214 *
215 *  DESCRIPTION:
216 *
217 *  XXX
218 */
219 
220RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core(
221  CORE_message_queue_Submit_types priority
222);
223
224/*PAGE
225 *
226 *  _POSIX_Message_queue_Translate_core_message_queue_return_code
227 *
228 *  DESCRIPTION:
229 *
230 *  XXX
231 */
232
233int _POSIX_Message_queue_Translate_core_message_queue_return_code(
234  unsigned32 the_message_queue_status
235);
236
237
238#include <rtems/posix/mqueue.inl>
239#if defined(RTEMS_MULTIPROCESSING)
240#include <rtems/posix/mqueuemp.h>
241#endif
242
243#ifdef __cplusplus
244}
245#endif
246 
247#endif
248/*  end of include file */
249
Note: See TracBrowser for help on using the repository browser.