delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/04/19/23:20:30

From: newsham AT lava DOT net (Tim Newsham)
Subject: Re: First fix for b19 available :-)
19 Apr 1998 23:20:30 -0700 :
Message-ID: <m0yR0GG-0011BnC.cygnus.gnu-win32@malasada.lava.net>
References: <199804181836 DOT LAA07651 AT carson DOT eecs DOT berkeley DOT edu>
Mime-Version: 1.0
To: cxh AT EECS DOT Berkeley DOT EDU (Christopher Hylands)
Cc: sos AT buggy DOT prospect DOT com DOT ru, gnu-win32 AT cygnus DOT com

> I'm porting software that uses sockets to communicate between two
> processes.  Currently, the stumbling block is that under Cygwin32,
> fdopen() fails with EBADF. 

You are mixing winsock calls with cygwin calls.  The two are
not compatible.  Winsock uses winsock handles to identify opened
sockets.  Cygwin uses unix-like file descriptors.  You should
use the cygwin provided socket functions (and not the winsock
version) if you wish to use file-descriptor functions like fdopen().

> Ideally, cygwin fdopen() should 'just work' like the regular Unix
> fdopen(), and I should not be fooling with _open_osfhandle.  I'm
> hoping that the fdopen() patch above fixes this.

It does "just work" if you pass it a file descriptor (which is what
it's documented to require).  It does not "just work" if you pass
it a Winsock handle.  If they didn't both happen to be integers,
your compiler would have screamed at you :)

> Christopher Hylands, Ptolemy Project Manager  University of California
> cxh AT eecs DOT berkeley DOT edu 			      US Mail: 558 Cory Hall #1770

                                         Tim N.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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