RTEMS  5.1
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 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 /*
53  * 15.1.1 Data Structures, P1003.1b-1993, p. 271
54  */
55 
61 typedef uint32_t mqd_t;
62 
66 struct mq_attr {
68  long mq_flags;
70  long mq_maxmsg;
72  long mq_msgsize;
74  long mq_curmsgs;
75 };
76 
80 mqd_t mq_open(
81  const char *name,
82  int oflag,
83  ...
84 );
85 
89 int mq_close(
90  mqd_t mqdes
91 );
92 
110 int mq_unlink(
111  const char *name
112 );
113 
119 int mq_send(
120  mqd_t mqdes,
121  const char *msg_ptr,
122  size_t msg_len,
123  unsigned int msg_prio
124 );
125 
126 #if defined(_POSIX_TIMEOUTS)
127 
128 #include <time.h>
129 
135 int mq_timedsend(
136  mqd_t mqdes,
137  const char *msg_ptr,
138  size_t msg_len,
139  unsigned int msg_prio,
140  const struct timespec *abstime
141 );
142 
143 #endif /* _POSIX_TIMEOUTS */
144 
152 ssize_t mq_receive(
153  mqd_t mqdes,
154  char *msg_ptr,
155  size_t msg_len,
156  unsigned int *msg_prio
157 );
158 
159 #if defined(_POSIX_TIMEOUTS)
160 
161 ssize_t mq_timedreceive(
162  mqd_t mqdes,
163  char *__restrict msg_ptr,
164  size_t msg_len,
165  unsigned int *__restrict msg_prio,
166  const struct timespec *__restrict abstime
167 );
168 
169 #endif /* _POSIX_TIMEOUTS */
170 
171 #if defined(_POSIX_REALTIME_SIGNALS)
172 
179 int mq_notify(
180  mqd_t mqdes,
181  const struct sigevent *notification
182 );
183 
184 #endif /* _POSIX_REALTIME_SIGNALS */
185 
191 int mq_setattr(
192  mqd_t mqdes,
193  const struct mq_attr *__restrict mqstat,
194  struct mq_attr *__restrict omqstat
195 );
196 
197 /*
198  * 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283
199  */
200 
201 int mq_getattr(
202  mqd_t mqdes,
203  struct mq_attr *mqstat
204 );
205 
208 #ifdef __cplusplus
209 }
210 #endif
211 
212 #endif /* _POSIX_MESSAGE_PASSING */
213 
214 #endif
215 /* end of include file */