source: rtems/cpukit/include/mqueue.h @ 2afb22b

5
Last change on this file since 2afb22b was 2afb22b, checked in by Chris Johns <chrisj@…>, on 12/23/17 at 07:18:56

Remove make preinstall

A speciality of the RTEMS build system was the make preinstall step. It
copied header files from arbitrary locations into the build tree. The
header files were included via the -Bsome/build/tree/path GCC command
line option.

This has at least seven problems:

  • The make preinstall step itself needs time and disk space.
  • Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error.
  • There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult.
  • The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit.
  • An introduction of a new build system is difficult.
  • Include paths specified by the -B option are system headers. This may suppress warnings.
  • The parallel build had sporadic failures on some hosts.

This patch removes the make preinstall step. All installed header
files are moved to dedicated include directories in the source tree.
Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc,
etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g.
erc32, imx, qoriq, etc.

The new cpukit include directories are:

  • cpukit/include
  • cpukit/score/cpu/@RTEMS_CPU@/include
  • cpukit/libnetworking

The new BSP include directories are:

  • bsps/include
  • bsps/@RTEMS_CPU@/include
  • bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include

There are build tree include directories for generated files.

The include directory order favours the most general header file, e.g.
it is not possible to override general header files via the include path
order.

The "bootstrap -p" option was removed. The new "bootstrap -H" option
should be used to regenerate the "headers.am" files.

Update #3254.

  • Property mode set to 100644
File size: 4.7 KB
Line 
1/**
2 * @file
3 *
4 * @brief POSIX Message Queues
5 *
6 * This file contains the definitions related to POSIX Message Queues.
7 *
8 * The structure of the routines is identical to that of POSIX
9 * Message_queues to leave the option of having unnamed message
10 * queues at a future date.  They are currently not part of the
11 * POSIX standard but unnamed message_queues are.  This is also
12 * the reason for the apparently unnecessary tracking of
13 * the process_shared attribute.  [In addition to the fact that
14 * it would be trivial to add pshared to the mq_attr structure
15 * and have process private message queues.]
16 *
17 * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open
18 * time.
19 */
20
21/*
22 *  COPYRIGHT (c) 1989-2011.
23 *  On-Line Applications Research Corporation (OAR).
24 *
25 *  The license and distribution terms for this file may be
26 *  found in the file LICENSE in this distribution or at
27 *  http://www.rtems.org/license/LICENSE.
28 */
29
30#ifndef _MQUEUE_H
31#define _MQUEUE_H
32
33
34#include <unistd.h>
35
36#if defined(_POSIX_MESSAGE_PASSING)
37
38#include <sys/types.h>
39
40#include <rtems/system.h>
41#include <rtems/score/object.h>
42
43/**
44 * @defgroup POSIX_MQUEUE POSIX Message Queues
45 *
46 * @ingroup POSIXAPI
47 *
48 */
49/**@{**/
50
51#ifdef __cplusplus
52extern "C" {
53#endif
54
55/*
56 *  15.1.1 Data Structures, P1003.1b-1993, p. 271
57 */
58
59/**
60 * Message queue id type.
61 *
62 * NOTE: Use uint32_t since all POSIX Ids are 32-bit currently.
63 */
64typedef uint32_t  mqd_t;
65
66/**
67 * This is the message queue attributes structure.
68 */
69struct mq_attr {
70  /** This is the message queue flags */
71  long  mq_flags;
72  /** This is the maximum number of messages */
73  long  mq_maxmsg;
74  /** This is the maximum message size */
75  long  mq_msgsize;
76  /** This is the mumber of messages currently queued */
77  long  mq_curmsgs;
78};
79
80/**
81 * 15.2.2 Open a Message Queue, P1003.1b-1993, p. 272
82 */
83mqd_t mq_open(
84  const char *name,
85  int         oflag,
86  ...
87);
88
89/**
90 * 15.2.2 Close a Message Queue, P1003.1b-1993, p. 275
91 */
92int mq_close(
93  mqd_t  mqdes
94);
95
96/**
97 * @brief Remove a message queue.
98 *
99 * 15.2.2 Remove a Message Queue, P1003.1b-1993, p. 276
100 *
101 * NOTE:  The structure of the routines is identical to that of POSIX
102 *        Message_queues to leave the option of having unnamed message
103 *        queues at a future date.  They are currently not part of the
104 *        POSIX standard but unnamed message_queues are.  This is also
105 *        the reason for the apparently unnecessary tracking of
106 *        the process_shared attribute.  [In addition to the fact that
107 *        it would be trivial to add pshared to the mq_attr structure
108 *        and have process private message queues.]
109 *
110 *        This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open
111 *        time.
112 */
113int mq_unlink(
114  const char *name
115);
116
117/**
118 * 15.2.4 Send a Message to a Message Queue, P1003.1b-1993, p. 277
119 *
120 * NOTE; P1003.4b/D8, p. 45 adds mq_timedsend().
121 */
122int mq_send(
123  mqd_t         mqdes,
124  const char   *msg_ptr,
125  size_t        msg_len,
126  unsigned int  msg_prio
127);
128
129#if defined(_POSIX_TIMEOUTS)
130
131#include <time.h>
132
133/**
134 * @brief Send a message to a message queue.
135 *
136 * @see mq_send()
137 */
138int mq_timedsend(
139  mqd_t                  mqdes,
140  const char            *msg_ptr,
141  size_t                 msg_len,
142  unsigned int           msg_prio,
143  const struct timespec *abstime
144);
145
146#endif /* _POSIX_TIMEOUTS */
147
148/**
149 * @brief Receive a message from a message queue.
150 *
151 * 15.2.5 Receive a Message From a Message Queue, P1003.1b-1993, p. 279
152 *
153 * NOTE: P1003.4b/D8, p. 45 adds mq_timedreceive().
154 */
155ssize_t mq_receive(
156  mqd_t         mqdes,
157  char         *msg_ptr,
158  size_t        msg_len,
159  unsigned int *msg_prio
160);
161
162#if defined(_POSIX_TIMEOUTS)
163
164ssize_t mq_timedreceive(
165  mqd_t                  mqdes,
166  char                  *__restrict msg_ptr,
167  size_t                 msg_len,
168  unsigned int          *__restrict msg_prio,
169  const struct timespec *__restrict abstime
170);
171
172#endif /* _POSIX_TIMEOUTS */
173
174#if defined(_POSIX_REALTIME_SIGNALS)
175
176/**
177 * @brief Notify process that a message is available on a queue.
178 *
179 * 15.2.6 Notify Process that a Message is Available on a Queue,
180 *        P1003.1b-1993, p. 280
181 */
182int mq_notify(
183  mqd_t                  mqdes,
184  const struct sigevent *notification
185);
186
187#endif /* _POSIX_REALTIME_SIGNALS */
188
189/**
190 * @brief Set message queue attributes.
191 *
192 * 15.2.7 Set Message Queue Attributes, P1003.1b-1993, p. 281
193 */
194int mq_setattr(
195  mqd_t                 mqdes,
196  const struct mq_attr *__restrict mqstat,
197  struct mq_attr       *__restrict omqstat
198);
199
200/*
201 *  15.2.8 Get Message Queue Attributes, P1003.1b-1993, p. 283
202 */
203
204int mq_getattr(
205  mqd_t           mqdes,
206  struct mq_attr *mqstat
207);
208
209/** @} */
210
211#ifdef __cplusplus
212}
213#endif
214
215#endif /* _POSIX_MESSAGE_PASSING */
216
217#endif
218/* end of include file */
Note: See TracBrowser for help on using the repository browser.