svn commit: r198781 - head/lib/libc/sys

Robert N. M. Watson rwatson at FreeBSD.org
Mon Nov 2 18:29:16 UTC 2009


On 2 Nov 2009, at 18:20, Colin Percival wrote:

>> I think a more general caution for accept(2) might instead be:
>>
>> BUGS
>>    The inheritence of socket options from a listen socket to a newly
>>    accepted socket is inconsistent across protocols, and non- 
>> portable.
>
> I was originally going to write it that way, but when I looked at the
> existing text I saw that it only mentioned inheriting O_NONBLOCK and  
> said
> nothing about other options -- so I figured that it was appropriate to
> follow suit and only mention O_NONBLOCK in saying what was non- 
> portable.

We preserve a number of socket options and other properties across  
accept(2), but not all. For example, we do preserve most socket-level  
options, linger state, routing fib number, and socket buffer sizing/ 
watermarks, as well as many connection properties such as TCP_NODELAY.  
However, if history is anything to go by, we also fail to preserve  
quite a few properties, and we've had a number of bug fixes over the  
years topping up the list of things inherited over accept.

Robert


More information about the svn-src-all mailing list