delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/03/18/14:21:34

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Mon, 18 Mar 2002 13:46:12 -0500 (EST)
From: David E Euresti <davie AT MIT DOT EDU>
To: <cygwin AT cygwin DOT com>
Subject: sendmsg problems
Message-ID: <Pine.GSO.4.30L.0203181345440.14706-100000@magic-pi-ball.mit.edu>
MIME-Version: 1.0

So I'm trying to work out a way to have socket passing using
DuplicateHandle.  Unfortunately I don't think that sendmsg works
correctly.

I use socketpair to create a pair of connected Unix Domain sockets. Then I
fork. Then I create a socket which I want to pass to the child. But when I
call sendmsg on the original socketpair thing it returns -1, a Bad
Address.  I don't set msg_name in the msghdr because the socket is already
connected.

So I went into the sources and sure enough sendmsg is implemented by
calling sendto using the msg_name that's being passed, and since message
name is null the call dies.

I know that calling sendmsg, on a socketpair after a fork, with no name
works on Unix.  Is there any way around this?

Thanks,
David Euresti



--
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/

- Raw text -


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