]> git.baikalelectronics.ru Git - kernel.git/commit
sock: Introduce the SO_PEEK_OFF sock option
authorPavel Emelyanov <xemul@parallels.com>
Tue, 21 Feb 2012 07:31:34 +0000 (07:31 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Feb 2012 20:03:48 +0000 (15:03 -0500)
commita02053c83c116bea59d18c638a40714d494f53a7
treebd7adba8d802aff2aaec0f5f2a9e2ba5431cafcc
parentbcba17d137dcf49c57065e3458ddedaa12a4fe16
sock: Introduce the SO_PEEK_OFF sock option

This one specifies where to start MSG_PEEK-ing queue data from. When
set to negative value means that MSG_PEEK works as ususally -- peeks
from the head of the queue always.

When some bytes are peeked from queue and the peeking offset is non
negative it is moved forward so that the next peek will return next
portion of data.

When non-peeking recvmsg occurs and the peeking offset is non negative
is is moved backward so that the next peek will still peek the proper
data (i.e. the one that would have been picked if there were no non
peeking recv in between).

The offset is set using per-proto opteration to let the protocol handle
the locking issues and to check whether the peeking offset feature is
supported by the protocol the socket belongs to.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
20 files changed:
arch/alpha/include/asm/socket.h
arch/arm/include/asm/socket.h
arch/avr32/include/asm/socket.h
arch/cris/include/asm/socket.h
arch/frv/include/asm/socket.h
arch/h8300/include/asm/socket.h
arch/ia64/include/asm/socket.h
arch/m32r/include/asm/socket.h
arch/m68k/include/asm/socket.h
arch/mips/include/asm/socket.h
arch/mn10300/include/asm/socket.h
arch/parisc/include/asm/socket.h
arch/powerpc/include/asm/socket.h
arch/s390/include/asm/socket.h
arch/sparc/include/asm/socket.h
arch/xtensa/include/asm/socket.h
include/asm-generic/socket.h
include/linux/net.h
include/net/sock.h
net/core/sock.c