source: rtems/cpukit/posix/include/mqueue.h @ 976162a6

4.104.114.95
Last change on this file since 976162a6 was fffda815, checked in by Ralf Corsepius <ralf.corsepius@…>, on 08/15/05 at 15:12:27

ssize_t mq_timedreceive() (POSIX compliance)

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