From owner-freebsd-questions Mon Jan 10 12: 1: 9 2000 Delivered-To: freebsd-questions@freebsd.org Received: from news-ma.rhein-neckar.de (news-ma.rhein-neckar.de [193.197.90.3]) by hub.freebsd.org (Postfix) with ESMTP id 1E84B151C9 for ; Mon, 10 Jan 2000 12:01:06 -0800 (PST) (envelope-from daemon@bigeye.rhein-neckar.de) Received: from bigeye.rhein-neckar.de (uucp@localhost) by news-ma.rhein-neckar.de (8.8.8/8.8.8) with bsmtp id VAA10110 for freebsd-questions@freebsd.org; Mon, 10 Jan 2000 21:01:04 +0100 (CET) (envelope-from daemon@bigeye.rhein-neckar.de) Received: (from daemon@localhost) by bigeye.rhein-neckar.de (8.9.3/8.9.3) id UAA10306 for freebsd-questions@freebsd.org; Mon, 10 Jan 2000 20:26:21 +0100 (CET) (envelope-from daemon) From: naddy@mips.rhein-neckar.de (Christian Weisgerber) Subject: Re: /usr/src: example of file handle passing across socket? Date: 10 Jan 2000 20:26:20 +0100 Message-ID: <85dbos$a1k$1@bigeye.rhein-neckar.de> References: <854sui$1dss$1@bigeye.rhein-neckar.de> <57542.947512578@axl.noc.iafrica.com> To: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Sheldon Hearn wrote: > > Do we have an example in the source tree of how to pass an open > > file descriptor across a socket? > > I've seen something close to what you want done in inetd (see the > handling of signalpipe). You'd want to read and write something other > than a char, obviously, but I don't see that being too much of a > problem. I don't see anything applicable in src/usr.sbin/inetd/inetd.c. signalpipe is just a normal pipe where the child sends character data to the parent. Passing an open file descriptor is necessarily more involved. I mean, I can pass the integer value, but that is meaningless in itself. Stevens describes a somewhat clumsy scheme; the API is rather ugly. Grepping over /usr/src for some key words, I found examples in mount_portal (activate.c) and ppp (bundle.c). No significant simplifications there. -- Christian "naddy" Weisgerber naddy@mips.rhein-neckar.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message