netdev
[Top] [All Lists]

Re: [PATCH] 2.6 UDP recvmsg vs POSIX

To: Olaf Kirch <okir@xxxxxxx>
Subject: Re: [PATCH] 2.6 UDP recvmsg vs POSIX
From: "David S. Miller" <davem@xxxxxxxxxx>
Date: Mon, 23 Feb 2004 09:42:16 -0800
Cc: netdev@xxxxxxxxxxx
In-reply-to: <20040223094209.GA12663@xxxxxxx>
References: <20040217121726.GD8554@xxxxxxx> <20040221130853.4c98bad6.davem@xxxxxxxxxx> <20040223094209.GA12663@xxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
On Mon, 23 Feb 2004 10:42:10 +0100
Olaf Kirch <okir@xxxxxxx> 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 :-)

<Prev in Thread] Current Thread [Next in Thread>