Subject: Re: #define Win32_Winsock fails in 1.1.8
From: [email-masked]
To: "Larry Hall (RFK Partners, Inc)" <[email-masked]>
Cc: [email-masked]
Date: Wed, 7 Mar 2001 08:44:00 -0500

The reason I am attempting to use the WinSock API via Cygwin is that my
application is integrating with a commercial application (HP OpenView) and
the APIs on the windows version return WinSock sockets that I need to do a
WinSock select on in order to tell when there is data to read.  This has
not been a problem in the past because the #define Win32_Winsock enables
this feature.  It just appears that in the latest version some header file
changes has broken this feature.  I have currently worked around to problem
by removing the #include <sys/reent.h> from string.h and tolerating the
"struct _reent declared inside parameter list" warning that occurs.  I was
hoping know from this list if anyone was aware of this problem to ensure it
got fixed in a future release.

Matt Brozowski

                                                                                                            
                    "Larry Hall                                                                             
                    (RFK                 To:     [email-masked], [email-masked]                
                    Partners,            cc:                                                                
                    Inc)"                Subject:     Re: #define Win32_Winsock fails in 1.1.8              
                    <[email-masked]                                                                           
                    m>                                                                                      
                                                                                                            
                    03/06/01                                                                                
                    03:58 PM                                                                                

At 10:00 AM 3/6/2001, [email-masked] wrote:
>I hope this is the right mailing list for this.
>
>I am in the process of trying to migrate my application from Cygwin 1.0 to
>Cygwin 1.1.8.  My application uses Windows sockets and select and uses
>#define Win32_Winsock and #include <windows.h> at the top of the source
>file as mentioned in the FAQ.  This works fine in Cygwin 1.0 but I notice
I
>get select errors when recompiling and then running it with Cygwin 1.1.8.
>After debugging it I found that 1.1.8 is failing to use the Windows style
>fd_set defined in winsock.h but rather is using the one from sys/types.h
>which it shouldn't be.  (This can be easily seen in the debugger.)
>
>After doing a little investigation I determined that the bug was
introduced
>when #include <sys/reent.h> was added to /usr/include/string.h.  This
>causes string.h to recursively cause sys/types.h to be included before
>winsock.h has a chance to be included.  Therefore the wrong fd_set is
used.
>The unfortunate ting about this bug is that everything compiles fine it is
>only a runtime that this bug appears.
>
>It's not really clear to me what an appropriate fix would be other than
>removing sys/reent.h from string.h.  Does anyone have any ideas and can it
>be put on the fixes to do list.

Does your program actually want to use Winsock with select or does it
just do so because UNIX socket semantics were missing in Cygwin 1.0?
The reason I ask is because I'm left with the distinct impression that
you're trying to meld Win32 and UNIX semantics for sockets, which is
going to be difficult at least.  Perhaps, if this is the case, you might
consider reviewing your socket code in light of changes in 1.1.8.  If
things aren't quite right yet, perhaps the proper fix is to extend Cygwin's
socket implementation to properly support the UNIX semantics.  I'm just
thinking out loud here, since I don't have socket programming experience.
I'm just left with particular impressions of things, after reading this
list for years...

Larry Hall                              [email-masked]
RFK Partners, Inc.                      http://www.rfk.com
118 Washington Street                   (508) 893-9779 - RFK Office
Holliston, MA 01746                     (508) 893-9889 - FAX

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple