[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4E02328A.80305@genband.com>
Date: Wed, 22 Jun 2011 12:20:58 -0600
From: Chris Friesen <chris.friesen@...band.com>
To: Nemo Publius <nemo@...f-evident.org>
CC: linux-kernel@...r.kernel.org
Subject: Re: Does Linux select() violate POSIX?
On 06/18/2011 11:06 AM, Nemo Publius wrote:
> Suppose I have a file descriptor referencing a TCP/IP socket in blocking mode.
>
> Suppose select() reports that the descriptor is ready for reading.
>
> If I then call recv() on that descriptor, can it _ever_ block?
There was a long discussion about this back in 2004.
http://lkml.org/lkml/2004/10/6/117
Based on that discussion and the need to deal with legacy apps,
udp_poll() has special-case code to handle blocking sockets--it
validates the checksum before declaring the socket readable. This costs
some performance, so for non-blocking sockets the checksum validation is
deferred until later when it will be hot in the cache due to the copy to
userspace.
Other protocols may not handle this and so the warning is still valid in
general.
Chris
--
Chris Friesen
Software Developer
GENBAND
chris.friesen@...band.com
www.genband.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists