Noted the Linux-specific feature whereby setsockopt() doubles

the value given for SO_SNDBUF and SO_RCVBUF.

Noted kernel imposed minimum values for SO_SNDBUF and SO_RCVBUF.
This commit is contained in:
Michael Kerrisk 2005-12-15 12:36:08 +00:00
parent 69c4c18902
commit 17805f5b31
1 changed files with 14 additions and 0 deletions

View File

@ -371,19 +371,33 @@ This option has no effect on stream-oriented sockets.
.TP
.B SO_SNDBUF
Sets or gets the maximum socket send buffer in bytes.
The kernel doubles this value (to allow space for bookkeeping overhead)
when it is set using
.\" Most (all?) other implementations do not do this -- MTK, Dec 05
.BR setsockopt (),
and this doubled value is returned by
.BR getsockopt ().
The default value is set by the
.B wmem_default
sysctl and the maximum allowed value is set by the
.B wmem_max
sysctl.
The minimum (doubled) value for this option is 2048.
.TP
.B SO_RCVBUF
Sets or gets the maximum socket receive buffer in bytes.
The kernel doubles this value (to allow space for bookkeeping overhead)
when it is set using
.\" Most (all?) other implementations do not do this -- MTK, Dec 05
.BR setsockopt (),
and this doubled value is returned by
.BR getsockopt ().
The default value is set by the
.B rmem_default
sysctl and the maximum allowed value is set by the
.B rmem_max
sysctl.
The minimum (doubled) value for this option is 256.
.TP
.B SO_LINGER
Sets or gets the