cvs commit: src/sys/kern uipc_socket.c

Robert Watson rwatson at FreeBSD.org
Wed Oct 8 19:48:44 UTC 2008


On Wed, 8 Oct 2008, John Baldwin wrote:

>>>>   In soreceive_dgram, when a 0-length buffer is passed into recv(2) and
>>>>   no data is ready, return 0 rather than blocking or returning EAGAIN.
>>>>   This is consistent with the behavior of soreceive_generic (soreceive)
>>>>   in earlier versions of FreeBSD, and restores this behavior for UDP.
..
>>
>> Yes, I agree it's odd, and I'm not sure I like it.  I discovered the 
>> problem while writing edge-case regression tests for socket receive to 
>> better exercise soreceive_dgram, at first concluding it was a bug in 
>> soreceive_generic!  My feeling, though, is that I should leave behavior 
>> "compatible" for 7.1, and perhaps we should change it for 7.2.
>
> Ok, so I guess you will revert this from HEAD after the MFC?

That and modify soreceive_generic() to do the same thing in the same 
circumstances -- soreceive_dgram() falls back on soreceive_generic() for any 
non-fast path (complicated) cases, so consistency of semantics is quite 
important.

Robert N M Watson
Computer Laboratory
University of Cambridge


More information about the cvs-src mailing list