delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2002/07/15/08:10:41

Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT cygwin DOT com>
List-Help: <mailto:cygwin-developers-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT cygwin DOT com
Delivered-To: mailing list cygwin-developers AT cygwin DOT com
Date: Mon, 15 Jul 2002 14:10:34 +0200
From: Corinna Vinschen <vinschen AT redhat DOT com>
To: cygwin-developers AT cygwin DOT com
Subject: Re: How about this for passing file descriptors?
Message-ID: <20020715141034.G6932@cygbert.vinschen.de>
Reply-To: cygwin-developers AT cygwin DOT com
Mail-Followup-To: cygwin-developers AT cygwin DOT com
References: <Pine DOT LNX DOT 4 DOT 33 DOT 0207131534200 DOT 3194-100000 AT this> <20020715103127 DOT A6932 AT cygbert DOT vinschen DOT de> <006b01c22be7$15deadf0$1800a8c0 AT LAPTOP> <20020715131019 DOT C17700 AT cygbert DOT vinschen DOT de> <01b701c22bf1$d08e88f0$1800a8c0 AT LAPTOP>
Mime-Version: 1.0
In-Reply-To: <01b701c22bf1$d08e88f0$1800a8c0@LAPTOP>
User-Agent: Mutt/1.3.22.1i

On Mon, Jul 15, 2002 at 09:21:50PM +1000, Robert Collins wrote:
> 
> ----- Original Message -----
> From: "Corinna Vinschen" <vinschen AT redhat DOT com>
> To: <cygwin-developers AT cygwin DOT com>
> Sent: Monday, July 15, 2002 9:10 PM
> 
> > Perhaps that's not even needed.  We already have a couple of methods
> > which are involved when duplicating handles between processes, namely
> > dup(), fixup_before_fork(), fixup_after_fork(), fixup_after_exec().
> 
> Hmm, the difference being that these methods are all synchronous. generic
> passing of file descriptors is not synchronous.
> 
> > Basically they are only restricted in their functionality since they
> > only get the *parent* process handle.  If we generalize this stuff
> > to get a *source* and a *destination* process handle instead, the
> > whole stuff would be available for situations besides fork/exec...
> 
> Remember that we don't know the destination process handle for this
> scenario, all we know is that we need to prepare the fd for *some* process
> to recieve.

That's not entirly true.  The sendmsg/recvmsg code needs to send the
pid to the other process and one of the processes has to open the
other process anyway so the handles are always known before the
duplication takes place.  It's just not possible otherwise.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019