---
name: "rtf_get"
section: "2"
platform: "linux"
package: "rtlinux-doc"
version: "1.0-2"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/rtf_get"
---

# rtf\_get(2)

read data from a real-time fifo

## NAME

rtf\_get - read data from a real-time fifo

## SYNOPSIS

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

**int rtf\_get(unsigned int** *fifo***, char \*** *buf***, int** *count***);**

## DESCRIPTION

**rtf\_get** reads a block of data from a real-time fifo (RT-FIFO) previously created with a call to  [**rtf\_create**(2)](/rtf_create/2.md)**.** *fifo* is the ID with which the RT-FIFO was created. *buf* is the block of data to be filled with the received bytes, while  *count* is the size of the block in bytes.  This mechanism is available only to  real-time tasks; Linux processes use a **read (2)** from the corresponding fifo device to dequeue data from a fifo.  Similarly, Linux processes use  **write (2)** or similar functions to write the data to be read via **rtf\_put** by a real-time task.

**rtf\_get** is often used in conjunction with **rtf\_create\_handler** to process data received asynchronously from a Linux process.  A handler is installed via  **rtf\_create\_handler**; this handler calls  **rtf\_get** to receive any data present in the RT-FIFO as it becomes available.  In this way, polling is not necessary; the handler is called only when data is present in the fifo.

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)](/read/2.md)**, **[write(2)](/write/2.md)**, and **[select(2)](/select/2.md)**.

## RETURN VALUE

On success, the size of the received data block is returned.  Note that this value may be less than *count* if  *count* bytes are not available in the fifo.  On failure, a negative value is returned as described below.

## ERRORS

- **-ENODEV**

  *fifo* is greater than or equal to RTF\_NO.

- **-EINVAL**

  *fifo* is not a valid RT-FIFO identifier.

## SEE ALSO

[**read**(2)](/read/2.md), [**rtf\_create**(2)](/rtf_create/2.md), [**rtf\_create\_handler**(2)](/rtf_create_handler/2.md), [**rtf\_destroy**(2)](/rtf_destroy/2.md), [**rtf\_put**(2)](/rtf_put/2.md), [**rtf\_resize**(2)](/rtf_resize/2.md), [**write**(2)](/write/2.md)

## AUTHOR

This manual page was written by Jerry Epplin.

Copyright (C) 1997 Jerry Epplin, placed under the GNU General Public License, see the file copyright for details.
