This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: Patch to pass file descriptors
- From: David Euresti <davie at MIT dot EDU>
- To: <cygwin-patches at cygwin dot com>
- Date: Sat, 29 Jun 2002 12:22:04 -0400 (EDT)
- Subject: Re: Patch to pass file descriptors
So here are three reasons to use the cygserver to pass file descriptors.
#1 Security - as has been mentioned. Althought currently the patch has no
security it can easily be added.
#2 My application is not allowed to block on anything. I
can't send a file descriptor and then block this changes the whole
semantics of sendmsg. I call select and it tells me I can write but then
my call to sendmsg blocks? That is really bad.
As an example of this problem look at the test application I sent. The
two processes both send a descriptor first, then try to read it. This
would cause the two processes to block while the other waits.
#3 The cygserver provides temporary storage for the handle. The sender
can close the handle after it sends it, and the handle is still happy.
In Unix the file descriptor is stored in the kernel when this happens so
there's no problem in unix to close the handle. I thought the cygserver
was supposed to provide a pseudo kernel, and that's exactly what I'm using
it for.
Basically I think this has to be done with the cygserver, or we'll lose
the semantics.
David