Vijay,
AFAIK, select can't tell if the file is added to unless the file is a
named pipe (fifo) or /dev/... For regular files, select will keep on
FD_ISSETing until the end of the file, where it repeatedly give you
zero-length reads until you close the file.
Maybe the easiest way is to use a (non-rtl) fifo to synchronise the two
tasks. Create a fifo (mkfifo) and read it from task to be notified.
The task will be blocked until the other task writes data to the fifo.
That way you can do something like this...
Task 1 - Opens fifo for writing
Task 2 - Opens fifo for reading, reads fifo (os puts task to sleep)
...
Task 1 - Saves some data to fs, finishes write, writes a character to
fifo
Task 2 - Task woken by os. Read data from fs. Read fifo (os puts to
sleep).
Task 1 - Saves some data to fs, finishes write, writes a character to
fifo
Task 2 - Task woken by os. Read data from fs. Read fifo (os puts to
sleep).
etc...
cheers,
Stuart Warren
-----Original Message-----
From: vijay patel [mailto:[EMAIL PROTECTED]]
Sent: Friday, 11 May 2001 6:48
To: [EMAIL PROTECTED]
Subject: [rtl] query regarding select system call
Hello ,
This is a general quest. not specific to RT- linux.
I have created a ramdisk drive, Now can I creat a task
that should be notify of data to be written on ramdisk
by another task.
Can u suggest the techniques to achieve to this.
I tried it with select system call,but it is not working.
Can we use select for any file ( residing on floppy or harddisk)
The doubt is that once the data is written on the media, it
will available immediately & will remain there .
Thanking you
-Vijay Patel
-- [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/rtlinux/
-- [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/rtlinux/