LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Poll with nonblocking file descriptors (https://www.linuxquestions.org/questions/programming-9/poll-with-nonblocking-file-descriptors-250836/)

bstark 11-03-2004 08:08 PM

Poll with nonblocking file descriptors
 
I would like to use poll on regular file descriptors to achieve some asynchronous behavior in file IO. I use poll to detect whether or not a file may be written to or read from without blocking. Taking the write example, what happens if only a subset of the data may be written without blocking. I would assume the write function would return the number of bytes actually written, but I have not found any documentation to confirm that. I was also told that there was a problem with this method because of the behavior of non blocking file descriptors on regular files, but the "problem" given was vague, something to the effect that poll always returns that IO may be performed on non-blocking regular file descriptors even when it is not the case?

Brian

Dave Kelly 11-03-2004 08:27 PM

If you're using C, consult your K&R book, section 8.2 Low Level I/O - Read and Write.


All times are GMT -5. The time now is 04:19 AM.