This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: HAVE_POLL is not enough - RFA
- To: "Philippe De Muyter" <phdm at macqel dot be>
- Subject: Re: HAVE_POLL is not enough - RFA
- From: Elena Zannoni <ezannoni at cygnus dot com>
- Date: Wed, 22 Mar 2000 20:05:59 -0500 (EST)
- Cc: ac131313 at cygnus dot com (Andrew Cagney), ezannoni at cygnus dot com, gdb-patches at sourceware dot cygnus dot com
- References: <38D5BE1D.7BB02C99@cygnus.com><200003211559.QAA16996@mail.macqel.be>
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