Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT cygwin DOT com Delivered-To: mailing list cygwin-developers AT cygwin DOT com Date: Mon, 15 Jul 2002 13:10:19 +0200 From: Corinna Vinschen To: cygwin-developers AT cygwin DOT com Subject: Re: How about this for passing file descriptors? Message-ID: <20020715131019.C17700@cygbert.vinschen.de> Reply-To: cygwin-developers AT cygwin DOT com Mail-Followup-To: cygwin-developers AT cygwin DOT com References: <20020715103127 DOT A6932 AT cygbert DOT vinschen DOT de> <006b01c22be7$15deadf0$1800a8c0 AT LAPTOP> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <006b01c22be7$15deadf0$1800a8c0@LAPTOP> User-Agent: Mutt/1.3.22.1i On Mon, Jul 15, 2002 at 08:05:01PM +1000, Robert Collins wrote: > > ----- Original Message ----- > From: "Corinna Vinschen" > To: > Sent: Monday, July 15, 2002 6:31 PM > > ... Each of them needs some different > > strategy so I wonder if it makes sense to create a new virtual fhandler > > method to do the job. Anyway, what I'm implementing is the following: > > I think it does. Just off the cuff, we need a struct that has transfer > information - > struct transfer { void *buffer; int buflen; HANDLE *handles; int > handlecount;}; and a couple of virtual functions for the fd class - > > transfer prep_transfer () const; > void complete_transfer (transfer const &); 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(). 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... Ah yes, I didn't take a closer look but if some of these methods expect to be called in a fhandler inside of the fdtab, that expectation would have to be corrected, too. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:cygwin AT cygwin DOT com Red Hat, Inc.