On Tue, 16 Jul 2002, Nadav Har'El wrote: [snip] > Well, you want your driver to give the user two features: a way to sleep > until data in in the buffer, and then a way to know which part of the > buffer is new data (offset+length). Obviously, you can have the sleeping > part done with select() and then the fetching-offset-and-length part done > with ioctl(), but you called this "yuck". > > If the "yucky" part is that you need two system calls, well, you can put > current offset in the buffer inside the buffer itself, in a fixed position. > But I'm not sure how you'd protect this offset from concurrent access (if > you at all need such protection). Some drivers (e.g., /dev/epoll) don't > need such protection, and only use a double-buffer to protect the kernel > and the user-space from reading and writing at the same spot concurrently.
a few more words about the double buffer? [snip] -- Orna. | http://tx.technion.ac.il/~agmon There are only 10 types of people in the world- Those who understand binary, and those who do not. ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
