Xenomai  3.1
mqueue.h
1 /*
2  * Written by Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>.
3  *
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.
8  *
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.
13  *
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.
17  */
18 
19 #ifndef _COBALT_POSIX_MQUEUE_H
20 #define _COBALT_POSIX_MQUEUE_H
21 
22 #include <linux/types.h>
23 #include <linux/fcntl.h>
24 #include <xenomai/posix/syscall.h>
25 
26 struct mq_attr {
27  long mq_flags;
28  long mq_maxmsg;
29  long mq_msgsize;
30  long mq_curmsgs;
31 };
32 
33 int __cobalt_mq_open(const char __user *u_name, int oflags,
34  mode_t mode, struct mq_attr *attr);
35 
36 int __cobalt_mq_getattr(mqd_t uqd, struct mq_attr *attr);
37 
38 int __cobalt_mq_timedsend(mqd_t uqd, const void __user *u_buf, size_t len,
39  unsigned int prio, const void __user *u_ts,
40  int (*fetch_timeout)(struct timespec *ts,
41  const void __user *u_ts));
42 
43 int __cobalt_mq_timedreceive(mqd_t uqd, void __user *u_buf,
44  ssize_t *lenp,
45  unsigned int __user *u_prio,
46  const void __user *u_ts,
47  int (*fetch_timeout)(struct timespec *ts,
48  const void __user *u_ts));
49 
50 int __cobalt_mq_notify(mqd_t fd, const struct sigevent *evp);
51 
52 COBALT_SYSCALL_DECL(mq_open,
53  (const char __user *u_name, int oflags,
54  mode_t mode, struct mq_attr __user *u_attr));
55 
56 COBALT_SYSCALL_DECL(mq_close, (mqd_t uqd));
57 
58 COBALT_SYSCALL_DECL(mq_unlink, (const char __user *u_name));
59 
60 COBALT_SYSCALL_DECL(mq_getattr, (mqd_t uqd, struct mq_attr __user *u_attr));
61 
62 COBALT_SYSCALL_DECL(mq_timedsend,
63  (mqd_t uqd, const void __user *u_buf, size_t len,
64  unsigned int prio, const struct timespec __user *u_ts));
65 
66 COBALT_SYSCALL_DECL(mq_timedreceive,
67  (mqd_t uqd, void __user *u_buf, ssize_t __user *u_len,
68  unsigned int __user *u_prio,
69  const struct timespec __user *u_ts));
70 
71 COBALT_SYSCALL_DECL(mq_notify,
72  (mqd_t fd, const struct sigevent *__user evp));
73 
74 #endif /* !_COBALT_POSIX_MQUEUE_H */
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_notify(mqd_t q, const struct sigevent *evp)
Enable notification on message arrival
Definition: mq.c:576
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