source: rtems/c/src/exec/posix/include/mqueue.h @ 37f4c2d

4.104.114.84.95
Last change on this file since 37f4c2d was 5e9b32b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/26/95 at 19:27:15

posix support initially added

  • Property mode set to 100644
File size: 2.6 KB
Line 
1/* mqueue.h
2 *
3 */
4
5#ifndef __POSIX_MESSAGE_QUEUE_h
6#define __POSIX_MESSAGE_QUEUE_h
7
8#include <rtems/posix/features.h>
9
10#if defined(_POSIX_MESSAGE_PASSING)
11
12#include <sys/types.h>
13
14#include <rtems/system.h>
15#include <rtems/score/object.h>
16
17/*
18 *  15.1.1 Data Structures, P1003.1b-1993, p. 271
19 */
20
21typedef Objects_Id  mqd_t;
22
23struct mq_attr {
24  long  mq_flags;     /* Message queue flags */
25  long  mq_maxmsg;    /* Maximum number of messages */
26  long  mq_msgsize;   /* Maximum message size */
27  long  mq_curmsgs;   /* Number of messages currently queued */
28};
29
30/*
31 *  15.2.2 Open a Message Queue, P1003.1b-1993, p. 272
32 */
33
34mqd_t mq_open(
35  const char *name,
36  int         oflag,
37  ...
38);
39
40/*
41 *  15.2.2 Close a Message Queue, P1003.1b-1993, p. 275
42 */
43
44int mq_close(
45  mqd_t  mqdes
46);
47
48/*
49 *  15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276
50 */
51
52int mq_unlink(
53  const char *name
54);
55
56/*
57 *  15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277
58 *
59 *  NOTE: P1003.4b/D8, p. 45 adds mq_timedsend().
60 */
61
62int mq_send(
63  mqd_t         mqdes,
64  const char   *msg_ptr,
65  size_t        msg_len,
66  unsigned int  msg_prio
67);
68
69#if defined(_POSIX_TIMEOUTS)
70
71#include <time.h>
72
73int mq_timedsend(
74  mqd_t                  mqdes,
75  const char            *msg_ptr,
76  size_t                 msg_len,
77  unsigned int           msg_prio,
78  const struct timespec *timeout
79);
80
81#endif /* _POSIX_TIMEOUTS */
82
83/*
84 *  15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
85 *
86 *  NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive().
87 */
88
89ssize_t mq_receive(
90  mqd_t         mqdes,
91  char         *msg_ptr,
92  size_t        msg_len,
93  unsigned int *msg_prio
94);
95
96#if defined(_POSIX_TIMEOUTS)
97
98int mq_timedreceive(                  /* XXX: should this be ssize_t */
99  mqd_t                  mqdes,
100  char                  *msg_ptr,
101  size_t                 msg_len,
102  unsigned int          *msg_prio,
103  const struct timespec *timeout
104);
105
106#endif /* _POSIX_TIMEOUTS */
107
108#if defined(_POSIX_REALTIME_SIGNALS)
109
110/*
111 *  15.2.6 Notify Process that a Message is Available on a Queue,
112 *         P1003.1b-1993, p. 280
113 */
114
115int mq_notify(
116  mqd_t                  mqdes,
117  const struct sigevent *notification
118);
119
120#endif /* _POSIX_REALTIME_SIGNALS */
121
122/*
123 *  15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281
124 */
125
126int mq_setattr(
127  mqd_t                 mqdes,
128  const struct mq_attr *mqstat,
129  struct mq_attr       *omqstat
130);
131
132/*
133 *  15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283
134 */
135
136int mq_getattr(
137  mqd_t           mqdes,
138  struct mq_attr *mqstat
139);
140
141#endif /* _POSIX_MESSAGE_PASSING */
142
143#endif
144/* end of include file */
Note: See TracBrowser for help on using the repository browser.