RTEMS 6.1-rc6
Loading...
Searching...
No Matches
mqueue.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
23/*
24 * COPYRIGHT (c) 1989-2011.
25 * On-Line Applications Research Corporation (OAR).
26 *
27 * Redistribution and use in source and binary forms, with or without
28 * modification, are permitted provided that the following conditions
29 * are met:
30 * 1. Redistributions of source code must retain the above copyright
31 * notice, this list of conditions and the following disclaimer.
32 * 2. Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in the
34 * documentation and/or other materials provided with the distribution.
35 *
36 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
37 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
39 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
40 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
41 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
42 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
43 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
44 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
45 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
46 * POSSIBILITY OF SUCH DAMAGE.
47 */
48
49#ifndef _MQUEUE_H
50#define _MQUEUE_H
51
52
53#include <unistd.h>
54
55#if defined(_POSIX_MESSAGE_PASSING)
56
57#include <sys/types.h>
58
67#ifdef __cplusplus
68extern "C" {
69#endif
70
71/*
72 * 15.1.1 Data Structures, P1003.1b-1993, p. 271
73 */
74
80typedef uint32_t mqd_t;
81
85struct mq_attr {
87 long mq_flags;
89 long mq_maxmsg;
91 long mq_msgsize;
93 long mq_curmsgs;
94};
95
99mqd_t mq_open(
100 const char *name,
101 int oflag,
102 ...
103);
104
108int mq_close(
109 mqd_t mqdes
110);
111
129int mq_unlink(
130 const char *name
131);
132
138int mq_send(
139 mqd_t mqdes,
140 const char *msg_ptr,
141 size_t msg_len,
142 unsigned int msg_prio
143);
144
145#if defined(_POSIX_TIMEOUTS)
146
147#include <time.h>
148
154int mq_timedsend(
155 mqd_t mqdes,
156 const char *msg_ptr,
157 size_t msg_len,
158 unsigned int msg_prio,
159 const struct timespec *abstime
160);
161
162#endif /* _POSIX_TIMEOUTS */
163
171ssize_t mq_receive(
172 mqd_t mqdes,
173 char *msg_ptr,
174 size_t msg_len,
175 unsigned int *msg_prio
176);
177
178#if defined(_POSIX_TIMEOUTS)
179
180ssize_t mq_timedreceive(
181 mqd_t mqdes,
182 char *__restrict msg_ptr,
183 size_t msg_len,
184 unsigned int *__restrict msg_prio,
185 const struct timespec *__restrict abstime
186);
187
188#endif /* _POSIX_TIMEOUTS */
189
190#if defined(_POSIX_REALTIME_SIGNALS)
191
198int mq_notify(
199 mqd_t mqdes,
200 const struct sigevent *notification
201);
202
203#endif /* _POSIX_REALTIME_SIGNALS */
204
210int mq_setattr(
211 mqd_t mqdes,
212 const struct mq_attr *__restrict mqstat,
213 struct mq_attr *__restrict omqstat
214);
215
216/*
217 * 15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283
218 */
219
220int mq_getattr(
221 mqd_t mqdes,
222 struct mq_attr *mqstat
223);
224
227#ifdef __cplusplus
228}
229#endif
230
231#endif /* _POSIX_MESSAGE_PASSING */
232
233#endif
234/* end of include file */