RTF_RECEIVE(2)

NAME
rtf_receive - get data from an rt_ipc real-time fifo

SYNOPSIS
#define MODULE
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/errno.h>
#include <linux/rtf.h>
#include rt_ipc.h

int rtf_receive(unsigned int fifo, void *buf, int count, RTIME timeout)

DESCRIPTION
rtf_receive gets data from the rt-fifo fifo. The data, up to size count, is put into buf. If timeout is RT_NO_WAIT, the function returns immediately even if count bytes are not available. If timeout is RT_WAIT_FOREVER, the function blocks until count bytes are available. If timeout is any other value, it represents the time at which the function will return with a timeout after unsuccessfully waiting for data. In any case, as many bytes as possible are returned, even if a timeout occurs or RT_NO_WAIT is specified.

The rt_ipc RT-FIFO is a mechanism, implemented as a character device, to communicate between real-time tasks and ordinary Linux processes. It is based on the Real-Time Linux RT-FIFO mechanism. The rtf_* functions are used by the real-time tasks; Linux processes use standard character device access functions such as read(2), write(2), and select(2).

RETURN VALUE
If the return value is greater than or equal to zero, it represents the number of bytes received. This might be less than count if the function timed out or RT_NO_WAIT was specified and less than count bytes were available. On failure, a negative value is returned as described below.

ERRORS

-ENODEV
    fifo is not less than IPC_RTF_NO and RTF_NO.

-EINVAL
    fifo is not a valid fifo identifier.

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

SEE ALSO
rtf_ipc_create(2), rtf_ipc_destroy(2), rtf_send(2)