diff options
Diffstat (limited to 'usr/src/man/man4m')
-rw-r--r-- | usr/src/man/man4m/Makefile | 2 | ||||
-rw-r--r-- | usr/src/man/man4m/datafilt.4m | 48 |
2 files changed, 50 insertions, 0 deletions
diff --git a/usr/src/man/man4m/Makefile b/usr/src/man/man4m/Makefile index 4fc26d5bb9..a32665e699 100644 --- a/usr/src/man/man4m/Makefile +++ b/usr/src/man/man4m/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= 4m _MANFILES = bufmod.4m \ connld.4m \ + datafilt.4m \ ldterm.4m \ pckt.4m \ pfmod.4m \ diff --git a/usr/src/man/man4m/datafilt.4m b/usr/src/man/man4m/datafilt.4m new file mode 100644 index 0000000000..ab35965eeb --- /dev/null +++ b/usr/src/man/man4m/datafilt.4m @@ -0,0 +1,48 @@ +.\" +.\" 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 4M +.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 |