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
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to