Subject: Re: [PATCH] 2.6 UDP recvmsg vs POSIX

From: "David S. Miller" <[email-masked]>
Date: Mon, 23 Feb 2004 09:42:16 -0800

On Mon, 23 Feb 2004 10:42:10 +0100
Olaf Kirch <[email-masked]> wrote:

> But that breaks poll/recvmsg on a blocking socket, because poll with
> assert POLLIN, but the recvmsg call with block.

There is nothing wrong with that, I even pinged Linus about this and he
agreed with me.

What stops another thread from pulling a packet from the
receive queue and thus emptying it?  Nothing.  POLLIN does not guarentee
a read will give you data right now, it never has and it never will.

Therefore, the only bug was returning -EAGAIN unconditionally and that's
what is fixed by the correct half of your changes.

TCP does the same thing Olaf, and there is no way I'm adding the gross poll
hacks there :-)