From owner-freebsd-hackers Sat Nov 23 10:42:30 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id KAA07301 for hackers-outgoing; Sat, 23 Nov 1996 10:42:30 -0800 (PST) Received: from mickey.umiacs.umd.edu (12222@mickey.umiacs.umd.edu [128.8.120.49]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id KAA07296 for ; Sat, 23 Nov 1996 10:42:28 -0800 (PST) Received: (smpatel@localhost) by mickey.umiacs.umd.edu (8.8.3/UMIACS-0.9/04-05-88) id NAA10452; Sat, 23 Nov 1996 13:42:10 -0500 (EST) Date: Sat, 23 Nov 1996 13:42:09 -0500 (EST) From: Sujal Patel To: Bill Paul cc: hackers@freebsd.org Subject: Re: descriptors and sockets and pipes, oh my In-Reply-To: <199611231802.NAA05597@skynet.ctr.columbia.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Sat, 23 Nov 1996, Bill Paul wrote: > _UNIX Network Programming_ only provides an example for 4.3BSD; in > 4.4BSD, the msghdr structure has changed. Also, is it possible to > pass descriptors between totally unrelated processes, or must > they be parent and child? The example in UNP can be adapted to 4.4 pretty easily. The man page should be enough to get you up and running. You can also use a AF_UNIX named filesystem socket, to pass descriptors between unrelated processes. > Lastly, is it still possible to exchange file descriptors with the > new pipe code in 2.2.x? The example in the book uses pipe(), but > that's because pipes were really AF_UNIX sockets in disguise; this > isn't true in FreeBSD 2.2.x anymore. The only way to pass file descriptors in BSD is to use AF_UNIX sockets. SYSV does provide an ioctl for passing file descriptors over pipes (I think). sujal