delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/05/13/07:08: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
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Mon, 13 May 2002 13:08:13 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Socket Handles duplicated twice after fork
Message-ID: <20020513130813.C6264@cygbert.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Pine DOT GSO DOT 4 DOT 30L DOT 0205081131450 DOT 10599-100000 AT department-of-alchemy DOT mit DOT edu>
Mime-Version: 1.0
In-Reply-To: <Pine.GSO.4.30L.0205081131450.10599-100000@department-of-alchemy.mit.edu>
User-Agent: Mutt/1.3.22.1i

On Wed, May 08, 2002 at 11:42:54AM -0400, David E Euresti wrote:
> #include <unistd.h>
> #include <io.h>
> #include <sys/socket.h>
> #include <stdio.h>
> 
> int main() {
>   int fds[2];
>   int pid;
> 
>   socketpair (AF_UNIX, SOCK_STREAM, 0, fds);
> 
>   pid = fork ();
>   if (pid == 0) {
>     printf("Child: Sockets are 0x%x 0x%x\n",
> 	   get_osfhandle(fds[0]), get_osfhandle(fds[1]));
>     sleep(300);
>   }
>   else {
>     printf("Parent: Sockets are 0x%x 0x%x\n",
> 	   get_osfhandle(fds[0]), get_osfhandle(fds[1]));
>     sleep(300);
>   }
> }

Could you please send an `strace -f' output running the above
code to the list?

Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

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