RT_MQ_INIT(2)

NAME
rt_mq_init - create a message queue

SYNOPSIS
#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);

DESCRIPTION
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

-EINVAL
    msg_size is negative, or max_msgs is less than one.

-ENOMEM
    Space could not be allocated for the message queue.

BUGS
Priority inheritance is not currently supported.

AUTHOR
Jerry Epplin <JerryEpplin@worldnet.att.net>

SEE ALSO
rt_mq_destroy(2), rt_mq_receive(2), rt_mq_send(2), rt_task_ipc_delete(2), rt_task_ipc_init(2)