1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
---|
2 | |
---|
3 | /** |
---|
4 | * @file |
---|
5 | * |
---|
6 | * @brief POSIX Message Queues Private Private Support |
---|
7 | * |
---|
8 | * This include file contains all the private support information for |
---|
9 | * POSIX Message Queues. |
---|
10 | * |
---|
11 | * The structure of the routines is identical to that of POSIX |
---|
12 | * Message_queues to leave the option of having unnamed message |
---|
13 | * queues at a future date. They are currently not part of the |
---|
14 | * POSIX standard but unnamed message_queues are. This is also |
---|
15 | * the reason for the apparently unnecessary tracking of |
---|
16 | * the process_shared attribute. [In addition to the fact that |
---|
17 | * it would be trivial to add pshared to the mq_attr structure |
---|
18 | * and have process private message queues.] |
---|
19 | * |
---|
20 | * This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open |
---|
21 | * time. |
---|
22 | */ |
---|
23 | |
---|
24 | /* |
---|
25 | * COPYRIGHT (c) 1989-2011. |
---|
26 | * On-Line Applications Research Corporation (OAR). |
---|
27 | * |
---|
28 | * Redistribution and use in source and binary forms, with or without |
---|
29 | * modification, are permitted provided that the following conditions |
---|
30 | * are met: |
---|
31 | * 1. Redistributions of source code must retain the above copyright |
---|
32 | * notice, this list of conditions and the following disclaimer. |
---|
33 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
34 | * notice, this list of conditions and the following disclaimer in the |
---|
35 | * documentation and/or other materials provided with the distribution. |
---|
36 | * |
---|
37 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
38 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
39 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
40 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
---|
41 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
42 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
43 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
44 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
45 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
---|
47 | * POSSIBILITY OF SUCH DAMAGE. |
---|
48 | */ |
---|
49 | |
---|
50 | #ifndef _RTEMS_POSIX_MQUEUE_H |
---|
51 | #define _RTEMS_POSIX_MQUEUE_H |
---|
52 | |
---|
53 | #include <rtems/score/coremsg.h> |
---|
54 | #include <rtems/score/objectdata.h> |
---|
55 | |
---|
56 | #include <limits.h> |
---|
57 | #include <mqueue.h> |
---|
58 | #include <signal.h> |
---|
59 | |
---|
60 | #ifdef __cplusplus |
---|
61 | extern "C" { |
---|
62 | #endif |
---|
63 | |
---|
64 | /** |
---|
65 | * @defgroup POSIX_MQUEUE_P Message Queues Private Support |
---|
66 | * |
---|
67 | * @ingroup POSIXAPI |
---|
68 | * |
---|
69 | */ |
---|
70 | /**@{**/ |
---|
71 | |
---|
72 | /* |
---|
73 | * Data Structure used to manage a POSIX message queue |
---|
74 | */ |
---|
75 | |
---|
76 | typedef struct { |
---|
77 | Objects_Control Object; |
---|
78 | CORE_message_queue_Control Message_queue; |
---|
79 | bool linked; |
---|
80 | uint32_t open_count; |
---|
81 | struct sigevent notification; |
---|
82 | int oflag; |
---|
83 | } POSIX_Message_queue_Control; |
---|
84 | |
---|
85 | /** |
---|
86 | * @brief The POSIX Message Queue objects information. |
---|
87 | */ |
---|
88 | extern Objects_Information _POSIX_Message_queue_Information; |
---|
89 | |
---|
90 | /** |
---|
91 | * @brief Macro to define the objects information for the POSIX Message Queue |
---|
92 | * objects. |
---|
93 | * |
---|
94 | * This macro should only be used by <rtems/confdefs.h>. |
---|
95 | * |
---|
96 | * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag |
---|
97 | * may be set). |
---|
98 | */ |
---|
99 | #define POSIX_MESSAGE_QUEUE_INFORMATION_DEFINE( max ) \ |
---|
100 | OBJECTS_INFORMATION_DEFINE( \ |
---|
101 | _POSIX_Message_queue, \ |
---|
102 | OBJECTS_POSIX_API, \ |
---|
103 | OBJECTS_POSIX_MESSAGE_QUEUES, \ |
---|
104 | POSIX_Message_queue_Control, \ |
---|
105 | max, \ |
---|
106 | _POSIX_PATH_MAX, \ |
---|
107 | NULL \ |
---|
108 | ) |
---|
109 | |
---|
110 | /** @} */ |
---|
111 | |
---|
112 | #ifdef __cplusplus |
---|
113 | } |
---|
114 | #endif |
---|
115 | |
---|
116 | #endif |
---|
117 | /* end of include file */ |
---|