Matthew Dillon wrote:
: (2) new system call entry points for non-blocking read and write, then : libc_r can completely ignore FNONBLOCK and just use the new entry : points. : : Otherwise this little problem is going to bite us over and over again : as time passes. : : I'm thinking (2) might be the only real solution.Something like this: nbpread(int d, void *buf, size_t nbytes, off_t offset) nbpread(int d, const void *buf, size_t nbytes, off_t offset) (same arguments as pread/pwrite). offset can be -1, indicating that the current offset should be used and updated. The function would perform the operation non-blocking regardless of the non blocking setting on the file pointer. libc_r would then use the new entry points and would not mess with the non-blocking flag on the FP at all.
That would be fantastic. I've banged my head with this problem often enough. And I'm not the only one, of course: http://cr.yp.to/unix/nonblock.html Cedric
