Subject: Re: First fix for b19 available :-)
From: [email-masked] (Tim Newsham)

19 Apr 1998 23:20:30 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
To: [email-masked] (Christopher Hylands)
Cc: [email-masked], [email-masked]

> 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
> [email-masked] 			      US Mail: 558 Cory Hall #1770

                                         Tim N.
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".