From owner-freebsd-hackers Mon Nov 25 01:32:15 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id BAA20558 for hackers-outgoing; Mon, 25 Nov 1996 01:32:15 -0800 (PST) Received: from ns.pa-consulting.com (ns.pa-consulting.com [193.118.224.1]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id BAA20510 for ; Mon, 25 Nov 1996 01:32:02 -0800 (PST) Received: from SMTPGATE.PA-CONSULTING.COM by ns.pa-consulting.com (8.6.4) id JAA12356; Mon, 25 Nov 1996 09:42:51 GMT Received: by SMTPGATE.PA-CONSULTING.COM with Microsoft Mail id <3299D84C@SMTPGATE.PA-CONSULTING.COM>; Mon, 25 Nov 96 09:33:00 PST From: Duncan Barclay To: freebsd-hackers Subject: RE: descriptors and sockets and pipes, oh my Date: Mon, 25 Nov 96 09:16:00 PST Message-ID: <3299D84C@SMTPGATE.PA-CONSULTING.COM> Encoding: 43 TEXT X-Mailer: Microsoft Mail V3.0 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Probably the best place to look is in the source code for the portal FS. Have a look at the example "file" portal system and also the ineraction between the kernal and the mount_portalfs code. The kernal passes the filename into the VFS layers which communicates with a user process down a socket pair. The server (ie. mount_portalfs) then returns opened file descriptors back up the sockets. Duncan ---------- From: owner-freebsd-hackers To: hackers Subject: descriptors and sockets and pipes, oh my Date: 23 November 1996 13:02 Does anyone have a source code example handy of passing a file descriptor from one process to anyther via an AF_UNIX socket? _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? 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. -Bill -- ============================================================================= -Bill Paul (212) 854-6020 | System Manager, Master of Unix-Fu Work: wpaul@ctr.columbia.edu | Center for Telecommunications Research Home: wpaul@skynet.ctr.columbia.edu | Columbia University, New York City ============================================================================= "If you're ever in trouble, go to the CTR. Ask for Bill. He will help you." =============================================================================