> > This is a distraction. If the call to select() had been substituted> > with a call to recvmsg(), it would have blocked. Instead, > select() is> > returning 'yes, you can read', and then recvmsg() is blocking. The> > select() lied. The information is all sitting in the kernel packet> > No. A million things might happen between select() and recvmsg(), both> in kernel and application. For a consistent behaviour throughout all> possibilities, you *have* to assume that any read on a blocking fd may> block.

Care to provide a real example?

UDP isn't one. It was done for performance reasons as David admitted and itcould very well be done otherwise: do the checksum before select returns.

David has admitted the only reason Linux chose to do so is performance.

It might be the case that a million things might happen between select andrecvmsg, but none of them, as I can see, *have* to force Linux to work thisway. The only reason as I can see is performance and imlementationconvenience.