From owner-freebsd-hackers Mon Aug 31 15:22:29 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA15955 for freebsd-hackers-outgoing; Mon, 31 Aug 1998 15:22:29 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from awfulhak.org (awfulhak.force9.co.uk [195.166.136.63]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA15940 for ; Mon, 31 Aug 1998 15:22:19 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from gate.lan.awfulhak.org (brian@localhost [127.0.0.1]) by awfulhak.org (8.8.8/8.8.8) with ESMTP id XAA06366; Mon, 31 Aug 1998 23:14:07 +0100 (BST) (envelope-from brian@Awfulhak.org) Message-Id: <199808312214.XAA06366@awfulhak.org> X-Mailer: exmh version 2.0.2 2/24/98 To: freebsd-hackers@FreeBSD.ORG cc: luigi@labinfo.iet.unipi.it (Luigi Rizzo) Subject: Re: Help with passing fd on FreeBSD Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 31 Aug 1998 23:14:07 +0100 From: Brian Somers Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG : > Oops, I turned the page and the BSD4.3+ example looks like the FreeBSD : > struct. The Stevens book appears to have a good example. : > : > > Can someone give me pointers on passing open file descriptors on FreeBSD? : : still, this looks to me one of the most obscure interfaces in the OS. : Does any real application use that ? User-ppp in -current does. When it negotiates multi-link with a peer, it creates a local domain socket based on that peers id. If the socket already exists, it passes the link to the other ppp invocation that's already running multi-link with the same peer. Effectively, it allows a machine to open up several connections to us and we bundle the links up into one logical link. This of course can be extremely confusing if you aren't in -direct mode - I ``dial'' the peer, connect successfully, do the LCP stuff, get the auth stuff right and then all of a sudden I get my shell prompt back. Reading the log reveals that the link was passed to another ppp instance. A word of caution - be *very* careful when passing a descriptor for your ctty. If you subsequently close the ctty, the descriptor that's been passed to the other process gets revoked ! This is why ppp must sometimes leave pause()d ``session leader'' processes lying around ;-I : cheers : luigi : -----------------------------+-------------------------------------- : Luigi Rizzo | Dip. di Ingegneria dell'Informazione : email: luigi@iet.unipi.it | Universita' di Pisa : tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) : fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ : _____________________________|______________________________________ -- Brian , , Don't _EVER_ lose your sense of humour.... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message