What is supposed to happen when a user-process does the following?


  int n_ready;
  fd_set rfds;


/* assume fd is an already-opened /dev/rtf */
  ioctl(fd, FIONREAD, &n_ready);


  if (n_ready == 0) {

    FD_ZERO(&rfds);
    FD_SET(fd, &rfds);
    select (fd+1, &rfds, NULL, NULL, NULL); /* block indefinitely waiting
for new stuff on fd */

  }

Basically the above code snippet blocks forever whenever the ioctl
detects 0 bytes ready for reading.. even though I *know* my real-time thread
is generating more data on the fifo...

Is this a bug/lacking feature of /dev/rtf or a simple stupid thing i am
overlooking?  I guess I can open up the rtl_fifo.c file and have a gander
at it myself.... but maybe one of you can save me the trouble.. thanks!

And I know.. I could just open the fifo with blocking reads, but I
wanted to see if I could selectively block and not block on demand using
select()...

-Calin

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/

Reply via email to