This is the mail archive of the cygwin@cygwin.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: Cygwin 1.3.3: Win2K: select() returning EBADF (causes thrashing in Boa)


Hi Phil,

your first mail contains the following snippet from boa:

       if (select(OPEN_MAX, &block_read_fdset,

Check if the actual value of OPEN_MAX is larger than
fdset can hold, which may well be platform dependent.
Most efficient would be to use highest_used_fd+1,
if this is handy, or else I'll cite Richard Stevens' famous book
"Advanced Programming in the Unix Environment" (must have IMHO):
	"We could just set the first argument to FD_SETSIZE ..."
at the bottom of p398 in the 7th printing 1994.

Bye, Heribert (heribert_dahms@icon-gmbh.de)

> -----Original Message-----
> From:	Phil Dempster [SMTP:dempster@lsil.com]
> Sent:	Friday, September 21, 2001 09:55
> To:	cygwin@cygwin.com
> Subject:	Re: Cygwin 1.3.3: Win2K: select() returning EBADF (causes
> thrashing in Boa)
> 
> > The obvious question is why is boa sending a bad fd to select?
> 
> My apologies; I omitted to mention that the behaviour differs from the
> same
> code compiled under Linux, where select() correctly blocks.
> 
> As far as I can determine, there is nothing wrong with the file
> descriptor.
> Both block_read_fdset and block_write_fdset are zeroed at initialisation
> (using the FD_ZERO macro).  The server's listening socket is set (using
> FD_SET) in block_read_fdset.  select() does not block and returns
> immediately with errno==EBADF.
> 
> > What thoughts were you expecting?  You obviously need to debug the code.
> 
> I was wondering if there any known issues with the Cygwin implementation
> of
> select(), given that the underlying Microsoft Winsock  function does not
> map
> entirely cleanly to the Berkley implementation.  Your response indicates
> that there are no known issues ;-)
> 
> Cheers,
> Phil.
> 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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