rtf_link_user_ioctl

Name

rtf_link_user_ioctl -- install an ioctl(3) handler for a realtime FIFO

Synopsis

       #include <rtl_fifo.h>

       int rtf_link_user_ioctl(unsigned int fifo, int (*handler)(unsigned int fifo, unsigned int cmd, unsigned long arg));      

DESCRIPTION

rtf_link_user_ioctl routes ioctl(3) calls on the RT-FIFO fifo Linux character device to the function handler in a real-time program. The handler is passed the request and an argument specified in the call to the ioctl. The return value of the handler is used as the return value of the ioctl call.

To uninstall the ioctl(3) handler, pass NULL as the handler value. The handler is also uninstalled on rtf_destroy.

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

RETURN VALUE

This function returns 0 on success and a negative error code on error.

ERRORS

-ENODEV

fifo is greater than or equal to RTF_NO.

-EINVAL

fifo is not a valid RT-FIFO identifier.

NOTES

This function is useful when implementing Linux character device drivers on top of RT-FIFOs.

SEE ALSO

read(2), rtf_create(3), rtf_create_handler(3), rtf_destroy(3), rtf_get(3), rtf_make_user_pair(3), write(2), ioctl(3)

2001 FSMLabs Inc.

All rights reserved.