source: rtems/c/src/exec/posix/include/rtems/posix/mqueue.h @ 9d3a44b

4.104.114.84.95
Last change on this file since 9d3a44b was 9d3a44b, checked in by Joel Sherrill <joel.sherrill@…>, on Nov 2, 1999 at 3:27:20 PM

Added include of <sys/siginfo.h>.

  • Property mode set to 100644
File size: 4.2 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 *
84 *  _POSIX_Message_queue_Send_support
85 *
86 *  DESCRIPTION:
87 *
88 *  This routine posts a message to a specified message queue.
89 */
90
91int _POSIX_Message_queue_Send_support(
92  mqd_t               mqdes,
93  const char         *msg_ptr,
94  unsigned32          msg_len,
95  Priority_Control    msg_prio,
96  Watchdog_Interval   timeout
97);
98
99/*
100 *  _POSIX_Message_queue_Allocate
101 *
102 *  DESCRIPTION:
103 *
104 *  This function allocates a message queue control block from
105 *  the inactive chain of free message queue control blocks.
106 */
107 
108RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void );
109 
110/*
111 *  _POSIX_Message_queue_Free
112 *
113 *  DESCRIPTION:
114 *
115 *  This routine frees a message queue control block to the
116 *  inactive chain of free message queue control blocks.
117 */
118 
119RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
120  POSIX_Message_queue_Control *the_mq
121);
122 
123/*
124 *  _POSIX_Message_queue_Get
125 *
126 *  DESCRIPTION:
127 *
128 *  This function maps message queue IDs to message queue control blocks.
129 *  If ID corresponds to a local message queue, then it returns
130 *  the_mq control pointer which maps to ID and location
131 *  is set to OBJECTS_LOCAL.  if the message queue ID is global and
132 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
133 *  and the_message queue is undefined.  Otherwise, location is set
134 *  to OBJECTS_ERROR and the_mq is undefined.
135 */
136 
137RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
138  Objects_Id         id,
139  Objects_Locations *location
140);
141 
142/*
143 *  _POSIX_Message_queue_Is_null
144 *
145 *  DESCRIPTION:
146 *
147 *  This function returns TRUE if the_message_queue is NULL and FALSE otherwise.
148 */
149 
150RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
151  POSIX_Message_queue_Control *the_mq
152);
153
154/*
155 *  _POSIX_Message_queue_Name_to_id
156 *
157 *  DESCRIPTION:
158 *
159 *  XXX
160 */
161
162int _POSIX_Message_queue_Name_to_id(
163  const char          *name,
164  Objects_Id          *id
165);
166
167/*
168 *  _POSIX_Message_queue_Priority_to_core
169 *
170 *  DESCRIPTION:
171 *
172 *  XXX
173 */
174 
175RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Message_queue_Priority_to_core(
176  unsigned int priority
177);
178
179#include <rtems/posix/mqueue.inl>
180#if defined(RTEMS_MULTIPROCESSING)
181#include <rtems/posix/mqueuemp.h>
182#endif
183
184#ifdef __cplusplus
185}
186#endif
187 
188#endif
189/*  end of include file */
190
Note: See TracBrowser for help on using the repository browser.