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
|