Xenomai  3.0-rc3
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(int, open(const char *path, int oflag, ...));
31 
32 COBALT_DECL(mqd_t, mq_open(const char *name,
33  int oflags,
34  ...));
35 
36 COBALT_DECL(int, mq_close(mqd_t qd));
37 
38 COBALT_DECL(int, mq_unlink(const char *name));
39 
40 COBALT_DECL(int, mq_getattr(mqd_t qd,
41  struct mq_attr *attr));
42 
43 COBALT_DECL(int, mq_setattr(mqd_t qd,
44  const struct mq_attr *__restrict__ attr,
45  struct mq_attr *__restrict__ oattr));
46 
47 COBALT_DECL(int, mq_send(mqd_t qd,
48  const char *buffer,
49  size_t len,
50  unsigned prio));
51 
52 COBALT_DECL(int, mq_timedsend(mqd_t q,
53  const char * buffer,
54  size_t len,
55  unsigned prio,
56  const struct timespec *timeout));
57 
58 COBALT_DECL(ssize_t, mq_receive(mqd_t q,
59  char *buffer,
60  size_t len,
61  unsigned *prio));
62 
63 COBALT_DECL(ssize_t, mq_timedreceive(mqd_t q,
64  char *__restrict__ buffer,
65  size_t len,
66  unsigned *__restrict__ prio,
67  const struct timespec *__restrict__ timeout));
68 
69 COBALT_DECL(int, mq_notify(mqd_t q,
70  const struct sigevent *evp));
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #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:259
int mq_close(mqd_t qd)
Close a message queue.
Definition: mq.c:144
int mq_unlink(const char *name)
Unlink a message queue.
Definition: mq.c:179
int mq_getattr(mqd_t qd, struct mq_attr *attr)
Get message queue attributes.
Definition: mq.c:217
int mq_send(mqd_t qd, const char *buffer, size_t len, unsigned prio)
Send a message to a message queue.
Definition: mq.c:322
int mq_notify(mqd_t q, const struct sigevent *evp)
Enable notification on message arrival.
Definition: mq.c:558
ssize_t mq_receive(mqd_t q, char *buffer, size_t len, unsigned *prio)
Receive a message from a message queue.
Definition: mq.c:438
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:378
mqd_t mq_open(const char *name, int oflags,...)
Open a message queue.
Definition: mq.c:102
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:499