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

4.104.114.84.95
Last change on this file since 05195890 was eb5a7e07, checked in by Joel Sherrill <joel.sherrill@…>, on 10/06/95 at 20:48:38

fixed missing CVS IDs

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