This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: First fix for b19 available :-)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]