Skip site navigation (1)Skip section navigation (2)
Date:      10 Jan 2000 20:26:20 +0100
From:      naddy@mips.rhein-neckar.de (Christian Weisgerber)
To:        freebsd-questions@freebsd.org
Subject:   Re: /usr/src: example of file handle passing across socket?
Message-ID:  <85dbos$a1k$1@bigeye.rhein-neckar.de>
References:  <854sui$1dss$1@bigeye.rhein-neckar.de> <57542.947512578@axl.noc.iafrica.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Sheldon Hearn <sheldonh@uunet.co.za> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?85dbos$a1k$1>