From f23929fbc5e70dafd8fe04eabc9a195f4522d850 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Sun, 23 Jul 2006 20:06:45 +0000 Subject: [PATCH] Add additional comments to the top of the UNIX domain socket implementation providing some high level pointers regarding the implementation. --- sys/kern/uipc_usrreq.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index b569618a3d27..65e12ad62ac7 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -31,6 +31,24 @@ * From: @(#)uipc_usrreq.c 8.3 (Berkeley) 1/4/94 */ +/* + * UNIX Domain (Local) Sockets + * + * This is an implementation of UNIX (local) domain sockets. Each socket has + * an associated struct unpcb (UNIX protocol control block). Stream sockets + * may be connected to 0 or 1 other socket. Datagram sockets may be + * connected to 0, 1, or many other sockets. Sockets may be created and + * connected in pairs (socketpair(2)), or bound/connected to using the file + * system name space. For most purposes, only the receive socket buffer is + * used, as sending on one socket delivers directly to the receive socket + * buffer of a second socket. The implementation is substantially + * complicated by the fact that "ancillary data", such as file descriptors or + * or credentials, may be passed across UNIX domain sockets. The potential + * for passing UNIX domain sockets over other UNIX domain sockets requires + * the implementation of a simple garbage collector to find and tear down + * cycles of disconnected sockets. + */ + #include __FBSDID("$FreeBSD$");