RTEMS CPU Kit with SuperCore  4.11.3
mqueue.h
Go to the documentation of this file.
1 
21 /*
22  * COPYRIGHT (c) 1989-2011.
23  * On-Line Applications Research Corporation (OAR).
24  *
25  * The license and distribution terms for this file may be
26  * found in the file LICENSE in this distribution or at
27  * http://www.rtems.org/license/LICENSE.
28  */
29 
30 #ifndef _MQUEUE_H
31 #define _MQUEUE_H
32 
33 
34 #include <unistd.h>
35 
36 #if defined(_POSIX_MESSAGE_PASSING)
37 
38 #include <sys/types.h>
39 
40 #include <rtems/system.h>
41 #include <rtems/score/object.h>
42 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 /*
56  * 15.1.1 Data Structures, P1003.1b-1993, p. 271
57  */
58 
64 typedef uint32_t mqd_t;
65 
69 struct mq_attr {
71  long mq_flags;
73  long mq_maxmsg;
75  long mq_msgsize;
77  long mq_curmsgs;
78 };
79 
83 mqd_t mq_open(
84  const char *name,
85  int oflag,
86  ...
87 );
88 
92 int mq_close(
93  mqd_t mqdes
94 );
95 
113 int mq_unlink(
114  const char *name
115 );
116 
122 int mq_send(
123  mqd_t mqdes,
124  const char *msg_ptr,
125  size_t msg_len,
126  unsigned int msg_prio
127 );
128 
129 #if defined(_POSIX_TIMEOUTS)
130 
131 #include <time.h>
132 
138 int mq_timedsend(
139  mqd_t mqdes,
140  const char *msg_ptr,
141  size_t msg_len,
142  unsigned int msg_prio,
143  const struct timespec *abstime
144 );
145 
146 #endif /* _POSIX_TIMEOUTS */
147 
155 ssize_t mq_receive(
156  mqd_t mqdes,
157  char *msg_ptr,
158  size_t msg_len,
159  unsigned int *msg_prio
160 );
161 
162 #if defined(_POSIX_TIMEOUTS)
163 
164 ssize_t mq_timedreceive(
165  mqd_t mqdes,
166  char *__restrict msg_ptr,
167  size_t msg_len,
168  unsigned int *__restrict msg_prio,
169  const struct timespec *__restrict abstime
170 );
171 
172 #endif /* _POSIX_TIMEOUTS */
173 
174 #if defined(_POSIX_REALTIME_SIGNALS)
175 
182 int mq_notify(
183  mqd_t mqdes,
184  const struct sigevent *notification
185 );
186 
187 #endif /* _POSIX_REALTIME_SIGNALS */
188 
194 int mq_setattr(
195  mqd_t mqdes,
196  const struct mq_attr *__restrict mqstat,
197  struct mq_attr *__restrict omqstat
198 );
199 
200 /*
201  * 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283
202  */
203 
204 int mq_getattr(
205  mqd_t mqdes,
206  struct mq_attr *mqstat
207 );
208 
211 #ifdef __cplusplus
212 }
213 #endif
214 
215 #endif /* _POSIX_MESSAGE_PASSING */
216 
217 #endif
218 /* end of include file */
Constants and Structures Associated with the Object Handler.
POSIX Time Types.
Information Included in Every Function in the Executive.