Anders Johansson wrote:
No, see "man dup". The file status flags are shared between the two, so a change to one means both are affected. The file descriptor flags are not.
Hmm. Any suggestion on how to do nonblocking reads and blokcing writes on one socket?
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");
Anyway, yours and Steves comments, particularly about fputs() and fprintf() not setting errno in case of error, has made me think.
/Per Jessen, Zürich