diff options
Diffstat (limited to 'usr/src/man/man7m')
-rw-r--r-- | usr/src/man/man7m/Makefile | 2 | ||||
-rw-r--r-- | usr/src/man/man7m/datafilt.7m | 46 |
2 files changed, 48 insertions, 0 deletions
diff --git a/usr/src/man/man7m/Makefile b/usr/src/man/man7m/Makefile index bb44184ba7..36eb293fc3 100644 --- a/usr/src/man/man7m/Makefile +++ b/usr/src/man/man7m/Makefile @@ -12,6 +12,7 @@ # # Copyright 2011, Richard Lowe # Copyright 2013 Nexenta Systems, Inc. All rights reserved. +# Copyright 2015 Joyent, Inc. # include $(SRC)/Makefile.master @@ -20,6 +21,7 @@ MANSECT= 7m _MANFILES = bufmod.7m \ connld.7m \ + datafilt.7m \ ldterm.7m \ pckt.7m \ pfmod.7m \ diff --git a/usr/src/man/man7m/datafilt.7m b/usr/src/man/man7m/datafilt.7m new file mode 100644 index 0000000000..f74ac0b103 --- /dev/null +++ b/usr/src/man/man7m/datafilt.7m @@ -0,0 +1,46 @@ +.\" +.\" This file and its contents are supplied under the terms of the +.\" Common Development and Distribution License ("CDDL"), version 1.0. +.\" You may only use this file in accordance with the terms of version +.\" 1.0 of the CDDL. +.\" +.\" A full copy of the text of the CDDL should have accompanied this +.\" source. A copy of the CDDL is also available via the Internet at +.\" http://www.illumos.org/license/CDDL. +.\" +.\" +.\" Copyright 2014 Ryan Zezeski +.\" Copyright 2015 Joyent, Inc. +.\" +.Dd Apr 21, 2015 +.Dt DATAFILT 7M +.Os +.Sh NAME +.Nm datafilt +.Nd socket filter module for deferred TCP connections +.Sh DESCRIPTION +The +.Nm datafilt +socket filter provides deferment of +.Xr accept 3SOCKET +for TCP connections. The accept call will not return until at least +one byte has been buffered by the kernel. Deferment assures the +application that the first call to +.Xr read 2 or +.Xr recv 3SOCKET +will not block. It reduces unnecessary switching between user and +kernel. +.Sh EXAMPLES +.Ss Example 1 +Enable deferment on the listening socket. +.Bd -literal + setsockopt(lsock, SOL_FILTER, FIL_ATTACH, "datafilt", 8); +.Ed +.Ss Example 2 +Disable deferment on the listening socket. +.Bd -literal + char filt[] = "datafilt"; + setsockopt(lsock, SOL_FILTER, FIL_DETACH, filt, strlen(filt) + 1); +.Ed +.Sh SEE ALSO +.Xr setsockopt 3SOCKET |