OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [posix/] [include/] [mqueue.h] - Blame information for rev 279

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/* mqueue.h
2
 *
3
 *  $Id: mqueue.h,v 1.2 2001-09-27 11:59:13 chris Exp $
4
 */
5
 
6
#ifndef __POSIX_MESSAGE_QUEUE_h
7
#define __POSIX_MESSAGE_QUEUE_h
8
 
9
#ifdef __cplusplus
10
extern "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
 
26
typedef Objects_Id  mqd_t;
27
 
28
struct 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
 
39
mqd_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
 
49
int mq_close(
50
  mqd_t  mqdes
51
);
52
 
53
/*
54
 *  15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276
55
 */
56
 
57
int 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
 
67
int 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
 
78
int 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
 
94
ssize_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
 
103
int 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
 
120
int 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
 
131
int 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
 
141
int 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 */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.