source: rtems/cpukit/posix/include/mqueue.h @ b69e6cd

4.115
Last change on this file since b69e6cd was b69e6cd, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/23/11 at 14:21:53

2011-02-23 Ralf Corsépius <ralf.corsepius@…>

  • posix/include/mqueue.h: Relocate "extern C++" guards.
  • Property mode set to 100644
File size: 3.0 KB
Line 
1/**
2 * @file mqueue.h
3 */
4
5/*
6 *  COPYRIGHT (c) 1989-2008.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#ifndef _MQUEUE_H
17#define _MQUEUE_H
18
19
20#include <unistd.h>
21
22#if defined(_POSIX_MESSAGE_PASSING)
23
24#include <sys/types.h>
25
26#include <rtems/system.h>
27#include <rtems/score/object.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33/*
34 *  15.1.1 Data Structures, P1003.1b-1993, p. 271
35 */
36
37/**
38 *  Message queue id type.
39 *
40 *  @note Use uint32_t since all POSIX Ids are 32-bit currently.
41 */
42typedef uint32_t  mqd_t;
43
44/**
45 *  This is the message queue attributes structure.
46 */
47struct mq_attr {
48  /** This is the message queue flags */
49  long  mq_flags;
50  /** This is the maximum number of messages */
51  long  mq_maxmsg;
52  /** This is the maximum message size */
53  long  mq_msgsize;
54  /** This is the mumber of messages currently queued */
55  long  mq_curmsgs;
56};
57
58/**
59 *  15.2.2 Open a Message Queue, P1003.1b-1993, p. 272
60 */
61mqd_t mq_open(
62  const char *name,
63  int         oflag,
64  ...
65);
66
67/**
68 *  15.2.2 Close a Message Queue, P1003.1b-1993, p. 275
69 */
70int mq_close(
71  mqd_t  mqdes
72);
73
74/**
75 *  15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276
76 */
77int mq_unlink(
78  const char *name
79);
80
81/**
82 *  15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277
83 *
84 *  @note P1003.4b/D8, p. 45 adds mq_timedsend().
85 */
86int mq_send(
87  mqd_t         mqdes,
88  const char   *msg_ptr,
89  size_t        msg_len,
90  unsigned int  msg_prio
91);
92
93#if defined(_POSIX_TIMEOUTS)
94
95#include <time.h>
96
97int mq_timedsend(
98  mqd_t                  mqdes,
99  const char            *msg_ptr,
100  size_t                 msg_len,
101  unsigned int           msg_prio,
102  const struct timespec *abstime
103);
104
105#endif /* _POSIX_TIMEOUTS */
106
107/*
108 *  15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
109 *
110 *  NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive().
111 */
112
113ssize_t mq_receive(
114  mqd_t         mqdes,
115  char         *msg_ptr,
116  size_t        msg_len,
117  unsigned int *msg_prio
118);
119
120#if defined(_POSIX_TIMEOUTS)
121
122ssize_t mq_timedreceive(
123  mqd_t                  mqdes,
124  char                  *msg_ptr,
125  size_t                 msg_len,
126  unsigned int          *msg_prio,
127  const struct timespec *abstime
128);
129
130#endif /* _POSIX_TIMEOUTS */
131
132#if defined(_POSIX_REALTIME_SIGNALS)
133
134/*
135 *  15.2.6 Notify Process that a Message is Available on a Queue,
136 *         P1003.1b-1993, p. 280
137 */
138
139int mq_notify(
140  mqd_t                  mqdes,
141  const struct sigevent *notification
142);
143
144#endif /* _POSIX_REALTIME_SIGNALS */
145
146/*
147 *  15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281
148 */
149
150int mq_setattr(
151  mqd_t                 mqdes,
152  const struct mq_attr *mqstat,
153  struct mq_attr       *omqstat
154);
155
156/*
157 *  15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283
158 */
159
160int mq_getattr(
161  mqd_t           mqdes,
162  struct mq_attr *mqstat
163);
164
165#ifdef __cplusplus
166}
167#endif
168
169#endif /* _POSIX_MESSAGE_PASSING */
170
171#endif
172/* end of include file */
Note: See TracBrowser for help on using the repository browser.