rt_mq_receive2
Message queue 'receive' operation
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_receive(rt_mq_t *mq, char *msg, RTIME wait);
Overview
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
|
The timeout period expired. |
|---|---|
|
wait was RT_NO_WAIT, and no data was available for dequeueing. |
|
mq does not point to a valid rt_mq_t. |