Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Delivered-To: mailing list cygwin@cygwin.com Message-ID: From: Heribert Dahms To: cygwin@cygwin.com Subject: RE: More on passing file descriptors Date: Wed, 12 Jun 2002 23:43:11 +0200 MIME-Version: 1.0 Content-Type: text/plain Hi, I have an application developped under HP-UX according to APUE, but I just send FDs (no other data). Are there important existing apps needing to feed both down the same socket? (sorry can't try it under cygwin in the near future due to ressources) [resent since somebody managed to get me blacklisted] Bye, Heribert (heribert_dahms@icon-scm.com) -----Original Message----- From: David E Euresti [SMTP:davie@MIT.EDU] Sent: Tuesday, June 11, 2002 17:29 To: cygwin@cygwin.com Subject: RE: More on passing file descriptors [Heribert] [snip] Yes the second process will need to query the cygserver for the FD. And actually the cygserver will also want to Duplicate the handle, because process 1 will probably close the handle after it sends it. Process 2 however can only call the cygserver inside calls to recvmsg. so pretend this happens. Process 1 - sends a 1 byte packet with an FD. Process 1 - sends another 1 byte packet with an FD Process 2 - reads a 2 byte message, and gets the FD from the cygserver, it never calls recvmsg again because there's no more data. And we're left with one FD floating in the air. I suggest reading the semantics of passing file descriptors in Unix in "Advanced Programming in the Unix environment". This is assuming that we want this to look like Unix. [Heribert] [snip] -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/