RT_MQ_RECEIVE(2)

NAME
rt_mq_receive - message queue 'receive' operation

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_receive(rt_mq_t *mq, char *msg, RTIME wait);

DESCRIPTION
rt_mq_receive dequeues the data msg from the message queue mq. The data will be of the size with which rt_mq_init was called. An optional timeout can be specified. If wait is RT_WAIT_FOREVER, the function does not time out. If wait is RT_NO_WAIT and the semaphore is not available, rt_mq_receive returns immediately. If wait is any other value, it represent a time at which the call to rt_mq_receive should time out. If that time is reached, rt_mq_receive returns with -ETIME.

RETURN VALUE
On success, 0 is returned. On failure, a negative value is returned as described below.

ERRORS

-ETIME
    The timeout period expired.

-EAGAIN
    wait was RT_NO_WAIT, and no data was available for dequeueing.

-EINVAL
    mq does not point to a valid rt_mq_t.

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

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