Copyright (C) 1996, 1997 Michael Barabanov



		RT-FIFOs


In RT-Linux v0.5 RT-FIFOs have been substantially rewritten. In this version
Linux processes see them as character devices /dev/rtf0, /dev/rtf1, etc.
RT-FIFO devices all have the major number of 63. Individual FIFOs are
identified by their minor numbers.

Please see the ../testing subdirectory for examples of their use.

Old RT-FIFOs are present for backward compatibility. The use of them is
deprecated.


Include file <linux/rtf.h> contains functions for reading and writing FIFOs
from real-time processes.


extern int rtf_create(unsigned int fifo, int size);
	Create an RT-FIFO. An RT-FIFO `fifo' is created with initial size of `size'.
	Return value: On success,  `size' is returned. On error, -1 is returned.


extern int rtf_destroy(unsigned int fifo);
	Destroy an RT-FIFO
	Return value: On success, 0 is returned


extern int rtf_resize(unsigned int minor, int size);
	Resize an RT-FIFO. 
	Return value: `size' is returned on success. On error, a negative value is 
	returned.
	Bugs: This operation destroys the contents of the FIFO


extern int rt_fifo_put(unsigned int fifo, char * buf, int count);
	Try to write to a FIFO; return -1 if there's not enough space
	in the FIFO; otherwise return "count"


extern int rt_fifo_get(unsigned int fifo, char * buf, int count);
	Try to read "count" bytes from a FIFO; return -1 if there's not
	enough data in the FIFO; otherwise return "count"



extern int rtf_create_handler(unsigned int fifo, int (*handler)(unsigned int fifo))
	Attach a handler to an RT-FIFO

	Allow function `handler' to be called when a _Linux_ process reads or
	writes to the FIFO. When the function is called, it is passed the fifo
	number as the argument.


Michael Barabanov

baraban@luz.cs.nmt.edu
