This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


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

Re: HAVE_POLL is not enough - RFA


Philippe De Muyter writes:
 > Andrew Cagney wrote :
 > > 	if (use_poll)
 > > 	  {
 > > #if HAVE_POLL
 > > 	    ...
 > > #else
 > > 	    internal_error (...);
 > > #endif
 > > 	  }
 > > 	else
 > > 	  {
 > > 	  }
 > I have done that.  OK to commit ?
 > 

The patch would be OK, except that there is a problem on platforms that
don't have poll() at all, like cygwin.

In those cases HAVE_POLL is undefined, not defined as 0.  This is what
the AC_CHECK_FUNCS does, I don't know if there is a way to specify to
autoconf that we would like to have HAVE_POLL == 0 in case the check
fails.

Instead of these 2 lines:

 > +/* Do we use poll or select ? */
 > +static unsigned char use_poll = HAVE_POLL;

We should use:

#ifdef HAVE_POLL
#define USE_POLL 1
#else
#define USE_POLL 0
#endif /* HAVE_POLL */

/* Do we use poll or select ? */
static unsigned char use_poll = USE_POLL;


I am testing with this modification at the moment, on cygwin. I will also 
give a spin to target async.

Elena



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