Per Jessen wrote:
Hmm. Any suggestion on how to do nonblocking reads and blokcing writes on one socket?
A few ideas spring to mind, such as changing the flag right before the write, or implementing your own write that blocks inside your own program even if the stream doesn't.
At what point do you do the GET_FL? I don't see it in the code you sent
I think I removed it again. I basically did a check just before fputs(). Something like this:
fcntl( fd, F_GETFL, &flag ); if ( flag & O_NONBLOCK ) log_error("nonblocking when it shudnt be");
and you're saying you never saw this error message in the log? That is strange, that would definitely be worth a bug report. If you could write a minimal program that exhibits the problem, and include the glibc version and kernel you use, I don't think it would take the developers long to fix