rt_mq_init(2)

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

-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 <[email protected]>

From rtlinux 2.0rel-1 in Debian 2.2 (Potato). Parsed by carta from the page's man source.