19 #ifndef _XENO_POSIX_MQUEUE_H
20 #define _XENO_POSIX_MQUEUE_H
22 #if defined(__KERNEL__) || defined(__XENO_SIM__)
24 #include <nucleus/xenomai.h>
27 #include <linux/types.h>
28 #include <linux/signal.h>
29 #include <linux/fcntl.h>
33 #include <posix_overrides.h>
38 #include <xeno_config.h>
43 #if defined(__KERNEL__) || defined(__XENO_SIM__) || !defined(CONFIG_XENO_HAVE_MQUEUE_H)
46 #define MQ_PRIO_MAX 32768
50 typedef unsigned long mqd_t;
65 struct mq_attr *attr);
68 const struct mq_attr *__restrict__ attr,
69 struct mq_attr *__restrict__ oattr);
84 char *__restrict__ buffer,
86 unsigned *__restrict__ prio,
87 const struct timespec *__restrict__ timeout);
93 const struct timespec *timeout);
95 int mq_notify(mqd_t mqdes,
const struct sigevent *notification);
109 #pragma GCC system_header
111 #include_next <mqueue.h>
117 mqd_t __real_mq_open(
const char *name,
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,
137 int __real_mq_timedsend(mqd_t q,
141 const struct timespec *timeout);
143 ssize_t __real_mq_receive(mqd_t q,
148 ssize_t __real_mq_timedreceive(mqd_t q,
149 char *__restrict__ buffer,
151 unsigned *__restrict__ prio,
152 const struct timespec *__restrict__ timeout);
154 int __real_mq_notify(mqd_t mqdes,
const struct sigevent *notification);
int mq_send(mqd_t qd, const char *buffer, size_t len, unsigned prio)
Send a message to a message queue.
Definition: mq.c:798
ssize_t mq_receive(mqd_t q, char *buffer, size_t len, unsigned *prio)
Receive a message from a message queue.
Definition: mq.c:930
int mq_setattr(mqd_t qd, const struct mq_attr *__restrict__ attr, struct mq_attr *__restrict__ oattr)
Set flags of a message queue.
Definition: mq.c:1105
int mq_timedsend(mqd_t q, const char *buffer, size_t len, unsigned prio, const struct timespec *timeout)
Attempt, during a bounded time, to send a message to a message queue.
Definition: mq.c:861
int mq_unlink(const char *name)
Unlink a message queue.
Definition: mq.c:436
mqd_t mq_open(const char *name, int oflags,...)
Open a message queue.
Definition: mq.c:241
ssize_t mq_timedreceive(mqd_t q, char *__restrict__ buffer, size_t len, unsigned *__restrict__ prio, const struct timespec *__restrict__ timeout)
Attempt, during a bounded time, to receive a message from a message queue.
Definition: mq.c:997
int mq_notify(mqd_t mqdes, const struct sigevent *notification)
Register the current thread to be notified of message arrival at an empty message queue...
Definition: mq.c:1180
int mq_getattr(mqd_t qd, struct mq_attr *attr)
Get the attributes object of a message queue.
Definition: mq.c:1052
int mq_close(mqd_t qd)
Close a message queue.
Definition: mq.c:358