Xenomai  3.1
mqueue.h
1 /*
2  * Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library 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 GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17  */
18 #pragma GCC system_header
19 #include_next <mqueue.h>
20 
21 #ifndef _COBALT_MQUEUE_H
22 #define _COBALT_MQUEUE_H
23 
24 #include <cobalt/wrappers.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 COBALT_DECL(mqd_t, mq_open(const char *name,
31  int oflags,
32  ...));
33 
34 COBALT_DECL(int, mq_close(mqd_t qd));
35 
36 COBALT_DECL(int, mq_unlink(const char *name));
37 
38 COBALT_DECL(int, mq_getattr(mqd_t qd,
39  struct mq_attr *attr));
40 
41 COBALT_DECL(int, mq_setattr(mqd_t qd,
42  const struct mq_attr *__restrict__ attr,
43  struct mq_attr *__restrict__ oattr));
44 
45 COBALT_DECL(int, mq_send(mqd_t qd,
46  const char *buffer,
47  size_t len,
48  unsigned prio));
49 
50 COBALT_DECL(int, mq_timedsend(mqd_t q,
51  const char * buffer,
52  size_t len,
53  unsigned prio,
54  const struct timespec *timeout));
55 
56 COBALT_DECL(ssize_t, mq_receive(mqd_t q,
57  char *buffer,
58  size_t len,
59  unsigned *prio));
60 
61 COBALT_DECL(ssize_t, mq_timedreceive(mqd_t q,
62  char *__restrict__ buffer,
63  size_t len,
64  unsigned *__restrict__ prio,
65  const struct timespec *__restrict__ timeout));
66 
67 COBALT_DECL(int, mq_notify(mqd_t q,
68  const struct sigevent *evp));
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif /* !_COBALT_MQUEUE_H */
int mq_setattr(mqd_t qd, const struct mq_attr *__restrict__ attr, struct mq_attr *__restrict__ oattr)
Set message queue attributes
Definition: mq.c:270
int mq_close(mqd_t qd)
Close a message queue
Definition: mq.c:149
int mq_unlink(const char *name)
Unlink a message queue
Definition: mq.c:186
int mq_getattr(mqd_t qd, struct mq_attr *attr)
Get message queue attributes
Definition: mq.c:226
int mq_send(mqd_t qd, const char *buffer, size_t len, unsigned prio)
Send a message to a message queue.
Definition: mq.c:335
int mq_notify(mqd_t q, const struct sigevent *evp)
Enable notification on message arrival
Definition: mq.c:576
ssize_t mq_receive(mqd_t q, char *buffer, size_t len, unsigned *prio)
Receive a message from a message queue.
Definition: mq.c:455
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:393
mqd_t mq_open(const char *name, int oflags,...)
Open a message queue
Definition: mq.c:105
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:518