rtf_create_handler(3)

rtf_create_handler3

Install a handler for real-time fifo data

Usage

#include <rtl_fifo.h>

int rtf_create_handler(unsigned int fifo, int (* handler)(unsigned int fifo));

Overview

rtf_create_handler installs a handler which is executed when data is written to or read from a real-time fifo (RT-FIFO). fifo is an RT-FIFO that must have previously been created with a call to rtf_create_fifo. handler is then called whenever a Linux process accesses that fifo.

rtf_create_handler is often used in conjunction with rtf_get to process data acquired asynchronously from a Linux process. The installed handler calls rtf_get when data is present. Because the handler is only executed when there is activity on the fifo, polling is not necessary.

The RT-FIFO is a mechanism, implemented as a character device, to communicate between real-time tasks and ordinary Linux processes. 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

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

Errors

-EINVAL

fifo is greater than or equal to RTF_NO, or is not a valid RT-FIFO identifier; or handler is NULL.

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