On 3/2/06, Per Jessen
Steve Graegert wrote:
Since what you're saying is impossible (blocking streams don't return EAGAIN) I would suggest making sure you haven't introduced O_NONBLOCK somewhere, and after that making an entry in a bugzilla somewhere
I know it's _supposed_ to be impossible, but it's happening nonetheless. I even tried checking the flags of the stream just before trying to write to it, and although it is clearly blocking, it will occasionally respond with EAGAIN. Some googling led me to one or two postings referring to a similar problem.
I suppose, Per refers to a system call that supports blocking /and/ non-blocking operations on a stream but is not sure how it has been invoked.
It's a TCP socket on which I have opened a stream. For reading, it is nonblocking, for writing it's blocking. I use e.g. fputs() or fprintf() and will occasionally get a return of EOF with errno=EAGAIN.
Oh, and of course I've actually got two identical file-descriptors, one for reading (nonblocking) and one for writing (blocking).
We could go to suse-programming and take a look at the code if you don't mind. \Steve