Date: Mon, 25 Nov 96 09:16:00 PST From: Duncan Barclay <Duncan.Barclay@pa-consulting.com> To: freebsd-hackers <freebsd-hackers@freebsd.org> Subject: RE: descriptors and sockets and pipes, oh my Message-ID: <3299D84C@SMTPGATE.PA-CONSULTING.COM>
next in thread | raw e-mail | index | archive | help
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." =============================================================================
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3299D84C>