On linux, the actual size is bound between SOCK_MIN_RCVBUF
and sysctl_rmem_max
, but the call to setsockopt
will never fail. See here. This includes overhead, among other things, for a struct sk_buff
.
The value of SOCK_MIN_RCVBUF
is:
#define SOCK_MIN_RCVBUF (2048 + sizeof(struct sk_buff))
As to what you want to do: AFAIK, there is no way to clear the receive buffer without reading (or closing the socket).