Re: recv() error in 2.1.116pre1?

Andi Kleen (ak@muc.de)
15 Aug 1998 20:58:50 +0200


In article <199808122134.RAA26583@kenny.chrysalis.com>,
Theo Van Dinter <tvd@chrysalis.com> writes:
> This is a multipart MIME message.
> --==_Exmh_-5069131920
> Content-Type: text/plain; charset=us-ascii

> While researching another problem, I found an issue with a different code
> segment that works fine under 2.0.x. The dumbed down version attached to this
> message will get a socket, and then fork a second process (sender/receiver).
> The processes will connect, send the file "input" to the process (writing to
> "output"), and then exit. Really simple. Works great on the 2.0.35 kernel
> that I wrote it on. With at least 2.1.116pre1 though, I *always* get (through
> perror on the recv() call):

> Resource temporarily unavailable

<grumble> after decoding the bas64 mess, please send readable bug reports
next time </grumble>

The reason is simple.

This is in your program. glibc 2.0 does not define MSG_WAITALL, only
linux/socket.h or glibc 2.1 do, thus this definition is active

#ifndef MSG_WAITALL /* Most Systems don't tend to have this ... */
#define MSG_WAITALL 0x40 /* wait for full request or error */
#endif

but in linux/socket.h there is:

#define MSG_DONTWAIT 0x40 /* Nonblocking io */
...
#define MSG_WAITALL 0x100 /* Wait for a full request */

You're requesting non blocking IO, and EAGAIN is completely correct here.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html