bfin: remove inline keyword
[xenomai-head.git] / include / posix / mqueue.h
blob22368dbdd2989304a2b4b0bdeb787c3bae3de17c
1 /*
2 * Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 #ifndef _XENO_POSIX_MQUEUE_H
20 #define _XENO_POSIX_MQUEUE_H
22 #if defined(__KERNEL__) || defined(__XENO_SIM__)
24 #include <nucleus/xenomai.h>
26 #ifdef __KERNEL__
27 #include <linux/types.h>
28 #include <linux/signal.h>
29 #include <linux/fcntl.h>
30 #endif /* !__KERNEL__ */
32 #ifdef __XENO_SIM__
33 #include <posix_overrides.h>
34 #endif /* __XENO_SIM__ */
36 #else /* !(__KERNEL__ || __XENO_SIM__) */
38 #include <xeno_config.h>
39 #include <fcntl.h>
41 #endif /* !(__KERNEL__ || __XENO_SIM__) */
43 #if defined(__KERNEL__) || defined(__XENO_SIM__) || !defined(CONFIG_XENO_HAVE_MQUEUE_H)
45 #ifndef MQ_PRIO_MAX
46 #define MQ_PRIO_MAX 32768
47 #endif
49 #ifndef __KERNEL__
50 typedef unsigned long mqd_t;
51 #endif /* !__KERNEL__ */
53 struct mq_attr {
54 long mq_flags;
55 long mq_maxmsg;
56 long mq_msgsize;
57 long mq_curmsgs;
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
64 int mq_getattr(mqd_t qd,
65 struct mq_attr *attr);
67 int mq_setattr(mqd_t qd,
68 const struct mq_attr *__restrict__ attr,
69 struct mq_attr *__restrict__ oattr);
71 int mq_send(mqd_t qd,
72 const char *buffer,
73 size_t len,
74 unsigned prio);
76 int mq_close(mqd_t qd);
78 ssize_t mq_receive(mqd_t q,
79 char *buffer,
80 size_t len,
81 unsigned *prio);
83 ssize_t mq_timedreceive(mqd_t q,
84 char *__restrict__ buffer,
85 size_t len,
86 unsigned *__restrict__ prio,
87 const struct timespec *__restrict__ timeout);
89 int mq_timedsend(mqd_t q,
90 const char *buffer,
91 size_t len,
92 unsigned prio,
93 const struct timespec *timeout);
95 int mq_notify(mqd_t mqdes, const struct sigevent *notification);
97 mqd_t mq_open(const char *name,
98 int oflags,
99 ...);
101 int mq_unlink(const char *name);
103 #ifdef __cplusplus
105 #endif
107 #else /* !(__KERNEL__ || __XENO_SIM__ || !CONFIG_XENO_HAVE_MQUEUE_H) */
109 #pragma GCC system_header
111 #include_next <mqueue.h>
113 #ifdef __cplusplus
114 extern "C" {
115 #endif
117 mqd_t __real_mq_open(const char *name,
118 int oflags,
119 ...);
121 int __real_mq_close(mqd_t qd);
123 int __real_mq_unlink(const char *name);
125 int __real_mq_getattr(mqd_t qd,
126 struct mq_attr *attr);
128 int __real_mq_setattr(mqd_t qd,
129 const struct mq_attr *__restrict__ attr,
130 struct mq_attr *__restrict__ oattr);
132 int __real_mq_send(mqd_t qd,
133 const char *buffer,
134 size_t len,
135 unsigned prio);
137 int __real_mq_timedsend(mqd_t q,
138 const char * buffer,
139 size_t len,
140 unsigned prio,
141 const struct timespec *timeout);
143 ssize_t __real_mq_receive(mqd_t q,
144 char *buffer,
145 size_t len,
146 unsigned *prio);
148 ssize_t __real_mq_timedreceive(mqd_t q,
149 char *__restrict__ buffer,
150 size_t len,
151 unsigned *__restrict__ prio,
152 const struct timespec *__restrict__ timeout);
154 int __real_mq_notify(mqd_t mqdes, const struct sigevent *notification);
156 #ifdef __cplusplus
158 #endif
160 #endif /* !(__KERNEL__ || __XENO_SIM__ || !CONFIG_XENO_HAVE_MQUEUE_H) */
162 #endif /* _XENO_POSIX_MQUEUE_H */