David Shaw wrote:
> > BSD compatibility. BSD does not account internal metadata, Linux assumes
> > half of the buffer will be taken up for it. If the real value was used
> > BSD applications would only get half the buffer they need.
> 
> Sounds reasonable.  The only thing is, why doesn't getsockopt return
> the "right" (i.e. internal value divided by 2) answer.  After all,
> from the program's perspective that IS what the value is.  Principle
> of least surprise, and all that.
> 
> This exposes internal kernel stuff to the user and may make them do
> the wrong thing.  For example, if a program tried to base internal
> functionality on the buffer size it would do the wrong thing under
> linux 2.2.

In particular, you can't save and restore the values with the current
mechanism.  (Well you can but you need some Linux specific kernel
version checking cruft).

I'm not sure there's much use for that, but still some symmetry between
the get & set methods seems reasonable.  You could always have a new
SO_"return actual buffer size" method so the information is available.

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to