source: rtems/cpukit/posix/include/mqueue.h @ 874297f3

4.104.114.84.95
Last change on this file since 874297f3 was 874297f3, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/16/04 at 10:01:03

Remove stray white spaces.

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