source: rtems/cpukit/posix/include/rtems/posix/mqueue.h @ 96c041c

4.104.114.84.95
Last change on this file since 96c041c was 8a5f2ca, checked in by Joel Sherrill <joel.sherrill@…>, on 11/02/99 at 17:18:58

Split mqueue into multiple files.

  • Property mode set to 100644
File size: 4.8 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-1998.
7 *  On-Line Applications Research Corporation (OAR).
8 *  Copyright assigned to U.S. Government, 1994.
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16 
17#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_h
18#define __RTEMS_POSIX_MESSAGE_QUEUE_h
19 
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#include <sys/siginfo.h>
25
26#include <rtems/score/coremsg.h>
27#include <rtems/score/object.h>
28
29/*
30 *  Data Structure used to manage a POSIX message queue
31 */
32 
33typedef struct {
34   Objects_Control             Object;
35   int                         process_shared;
36   int                         flags;
37   boolean                     named;
38   boolean                     linked;
39   boolean                     blocking;
40   unsigned32                  open_count;
41   CORE_message_queue_Control  Message_queue;
42   struct sigevent             notification;
43}  POSIX_Message_queue_Control;
44
45/*
46 *  The following defines the information control block used to manage
47 *  this class of objects.
48 */
49 
50POSIX_EXTERN Objects_Information  _POSIX_Message_queue_Information;
51 
52/*
53 *  _POSIX_Message_queue_Manager_initialization
54 *
55 *  DESCRIPTION:
56 *
57 *  This routine performs the initialization necessary for this manager.
58 */
59 
60void _POSIX_Message_queue_Manager_initialization(
61  unsigned32 maximum_message_queues
62);
63 
64/*
65 *
66 *  _POSIX_Message_queue_Create_support
67 *
68 *  DESCRIPTION:
69 *
70 *  This routine performs the creation of a message queue utilizing the
71 *  core message queue.
72 */
73 
74int _POSIX_Message_queue_Create_support(
75  const char                    *name,
76  int                            pshared,
77  unsigned int                   oflag,
78  struct mq_attr                *attr,
79  POSIX_Message_queue_Control  **message_queue
80);
81
82/*
83 *  _POSIX_Message_queue_Delete
84 *
85 *  DESCRIPTION:
86 *
87 *  This routine supports the mq_unlink and mq_close routines by
88 *  doing most of the work involved with removing a message queue.
89 */
90 
91void _POSIX_Message_queue_Delete(
92  POSIX_Message_queue_Control *the_mq
93);
94
95/*
96 *  _POSIX_Message_queue_Receive_support
97 *
98 *  DESCRIPTION:
99 *
100 *  This routine supports the various flavors of receiving a message.
101 */
102
103ssize_t _POSIX_Message_queue_Receive_support(
104  mqd_t               mqdes,
105  char               *msg_ptr,
106  size_t              msg_len,
107  unsigned int       *msg_prio,
108  Watchdog_Interval   timeout
109);
110
111/*
112 *  _POSIX_Message_queue_Send_support
113 *
114 *  DESCRIPTION:
115 *
116 *  This routine posts a message to a specified message queue.
117 */
118
119int _POSIX_Message_queue_Send_support(
120  mqd_t               mqdes,
121  const char         *msg_ptr,
122  unsigned32          msg_len,
123  Priority_Control    msg_prio,
124  Watchdog_Interval   timeout
125);
126
127/*
128 *  _POSIX_Message_queue_Allocate
129 *
130 *  DESCRIPTION:
131 *
132 *  This function allocates a message queue control block from
133 *  the inactive chain of free message queue control blocks.
134 */
135 
136RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void );
137 
138/*
139 *  _POSIX_Message_queue_Free
140 *
141 *  DESCRIPTION:
142 *
143 *  This routine frees a message queue control block to the
144 *  inactive chain of free message queue control blocks.
145 */
146 
147RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
148  POSIX_Message_queue_Control *the_mq
149);
150 
151/*
152 *  _POSIX_Message_queue_Get
153 *
154 *  DESCRIPTION:
155 *
156 *  This function maps message queue IDs to message queue control blocks.
157 *  If ID corresponds to a local message queue, then it returns
158 *  the_mq control pointer which maps to ID and location
159 *  is set to OBJECTS_LOCAL.  if the message queue ID is global and
160 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
161 *  and the_message queue is undefined.  Otherwise, location is set
162 *  to OBJECTS_ERROR and the_mq is undefined.
163 */
164 
165RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
166  Objects_Id         id,
167  Objects_Locations *location
168);
169 
170/*
171 *  _POSIX_Message_queue_Is_null
172 *
173 *  DESCRIPTION:
174 *
175 *  This function returns TRUE if the_message_queue is NULL and FALSE otherwise.
176 */
177 
178RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
179  POSIX_Message_queue_Control *the_mq
180);
181
182/*
183 *  _POSIX_Message_queue_Name_to_id
184 *
185 *  DESCRIPTION:
186 *
187 *  XXX
188 */
189
190int _POSIX_Message_queue_Name_to_id(
191  const char          *name,
192  Objects_Id          *id
193);
194
195/*
196 *  _POSIX_Message_queue_Priority_to_core
197 *
198 *  DESCRIPTION:
199 *
200 *  XXX
201 */
202 
203RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core(
204  unsigned int priority
205);
206
207#include <rtems/posix/mqueue.inl>
208#if defined(RTEMS_MULTIPROCESSING)
209#include <rtems/posix/mqueuemp.h>
210#endif
211
212#ifdef __cplusplus
213}
214#endif
215 
216#endif
217/*  end of include file */
218
Note: See TracBrowser for help on using the repository browser.