rt_mq_init2
Create a message queue
Usage
#define MODULE #include <linux/module.h> #include <linux/kernel.h> #include <linux/version.h> #include <linux/errno.h> #include rt_ipc.h
int rt_mq_init(rt_mq_t *mq, int max_msgs, int msg_size);
Overview
rt_mq_init is called to initialize a real-time message queue. A message queue can be used for communicating data among real-time tasks. Communication between Linux processes and real-time tasks is done using the standard Real-Time Linux RT-FIFO facilities.
mq must point to a statically allocated structure. max_msgs is the maximum number of messages allowed, and msg_size is the size of each message.
Return value
On success, 0 is returned. On failure, a negative value is returned as described below.
Errors
|
msg_size is negative, or max_msgs is less than one. |
|---|---|
|
Space could not be allocated for the message queue. |