Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
mqueue.h
Go to the documentation of this file.
1 
4 #ifndef __KERNEL_MQUEUE_H__
5 #define __KERNEL_MQUEUE_H__
6 
7 #include <mqueue.h>
8 #include <stddef.h>
9 #include <unistd.h>
10 
11 struct mqueue_data {
12  struct list_head list;
13  size_t size;
14  char data[0];
15 };
16 
17 struct mqueue {
18  char name[NAME_MAX];
19  char *buf;
20  size_t size;
21  size_t cnt;
22  struct list_head free_list;
23  struct list_head used_list[MQ_PRIO_MAX + 1];
24  struct list_head r_wait_list;
25  struct list_head w_wait_list;
26  struct list_head list;
27 };
28 
29 struct mq_desc {
30  struct mqueue *mq;
31  struct mq_attr attr;
32 };
33 
34 struct mqueue *__mq_allocate(struct mq_attr *attr);
35 void __mq_free(struct mqueue *mq);
36 size_t __mq_len(struct mqueue *mq);
37 ssize_t __mq_receive(struct mqueue *mq,
38  const struct mq_attr *attr,
39  char *msg_ptr,
40  size_t msg_len,
41  unsigned int *priority);
42 ssize_t __mq_send(struct mqueue *mq,
43  const struct mq_attr *attr,
44  const char *msg_ptr,
45  size_t msg_len,
46  unsigned int priority);
47 
48 #endif
Definition: list.h:111
Definition: mqueue.h:13
Definition: mqueue.h:29
Definition: mqueue.h:11
Definition: mqueue.h:17