Web lists-archives.com

Re: Hangs on connect to UNIX socket being listened on in the same process (was: Cygwin hanging in pselect)




On Jan 12 16:54, Michael Enright wrote:
> On Thu, Jan 12, 2017 at 2:13 PM, Corinna Vinschen
> <corinna-cygwin@xxxxxxxxxx> wrote:
> > Step 3:
> >
> >   If we did it really intelligent, maybe we finally also have a method
> >   to implement descriptor passing.  Finally.  After all these years.
> >
> > And maybe, we should not actually use the socket itself to exchange
> > the information but rather create some kind of side-channle for that.
> >
> > Especially in terms of step 3, I'm mulling over this for years now
> > and always something else got in the way and had to be done first.
> >
> >
> 
> I made a program that needed to pass windows HANDLEs between processes
> and so that receiving process could access the shared memory
> represented by the HANDLEs. I was emulating facilities many programs
> implement using send_msg, but I was using Windows (named?) pipes. It
> felt a lot like what you need for send_msg, and it required newer
> Windows APIs. So by doing the crazy thing of completely rewriting your
> AF_UNIX sockets you could "easily" add descriptor passing.

/me spilled her coffee reading the word "easily".

I'm aware that named pipes have a facility to switch the user context,
which helps to handle the descriptor duplication.  I thought about this,
too, but it's really a lot of work since it doesn't fit well into the
current fhandler layout.

I'm not generally opposed to split off AF_LOCAL sockets from the generic
socket fhandler and rewrite it completely, but it took a long time
getting sockets to behave mostly POSIXy and I fear we introduce a
completely new set of POSIX incompatibilies which take another long time
to iron out.  That's why I suggested to use an additional named pipe
per AF_LOCAL socket as a side-channel.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: signature.asc
Description: PGP signature