delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/09/21/06:20:35

From: cgf AT cygnus DOT com (Christopher Faylor)
Subject: Re: Problem with select()
21 Sep 1998 06:20:35 -0700 :
Message-ID: <19980921085624.A16682.cygnus.cygwin32.developers@cygnus.com>
References: <01BDE4DF DOT 5CA30770 AT sos>
Mime-Version: 1.0
To: Sergey Okhapkin <sos AT prospect DOT com DOT ru>,
"'cygwin32-developers AT cygnus DOT com'" <cygwin32-developers AT cygnus DOT com>

On Sun, Sep 20, 1998 at 09:41:00PM +0400, Sergey Okhapkin wrote:
>Sergey Okhapkin wrote:
>> > -#define WINSOCK_FD_ZERO(set) ((set)->fd_count=0)
>> > +#define WINSOCK_FD_ZERO(set) memset ((set), 0, sizeof (*(set)))
>> 
>> Hmmm... That works for me too! What is default structure members alignment for 
>
>
>I've found the bug...
>
>--- /winsup/select.h    Fri Sep 11 05:21:45 1998
>+++ select.h    Sun Sep 20 20:37:17 1998
>@@ -16,7 +16,7 @@
>  */
> typedef struct winsock_fd_set
> {
>-  unsigned short fd_count;
>+  unsigned int fd_count;
>   HANDLE fd_array[1024]; /* Dynamically allocated. */
> } winsock_fd_set;

That would do it.  I've made this change and backed out my
(expensive) memset change.

Thanks.
-- 
cgf AT cygnus DOT com
http://www.cygnus.com/

- Raw text -


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