From: newsham@lava.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.LAA07651@carson.eecs.berkeley.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
To: cxh@EECS.Berkeley.EDU (Christopher Hylands)
Cc: sos@buggy.prospect.com.ru, gnu-win32@cygnus.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@eecs.berkeley.edu 			      US Mail: 558 Cory Hall #1770

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