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: eliz at is dot elta dot co dot il
- Subject: Re: HAVE_POLL is not enough - RFA
- From: "Philippe De Muyter" <phdm at macqel dot be>
- Date: Sun, 19 Mar 100 00:00:20 +0100 (CET)
- Cc: ezannoni at cygnus dot com, ac131313 at cygnus dot com, gdb-patches at sourceware dot cygnus dot com
Eli Zaretskii wrote :
> * event-loop.c (top-level) [NO_FD_SET]: Deprecate this branch.
> Print an error at compile time if we are to use select, but FD_SET
> is not available.
> (SELECT_MASK, NBBY, FD_SETSIZE, NFDBITS, MASK_SIZE): Define only
> if HAVE_POLL is not defined and NO_FD_SET *is* defined.
> (create_file_handler) [!HAVE_POLL]: Use FD_SET and FD_CLR.
> (delete_file_handler) [!HAVE_POLL]: Use FD_CLR and FD_ISSET.
> (gdb_wait_for_event) [!HAVE_POLL]: Copy fd_set sets directly
> instead of using memcpy and memset. Use FD_ISSET.
>
> +#ifdef NO_FD_SET
> +/* All this stuff below is not required if select is used as God(tm)
> + intended, with the FD_* macros. Are there any implementations of
> + select which don't have FD_SET and other standard FD_* macros? I
> + don't think there are, but if I'm wrong, we need to catch them. */
> +#error FD_SET must be defined if select function is to be used!
I agree completely that your change is the right thing, but it misses
the following sequence :
#if HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
that is needed a.o. on AIX (See e.g. the sources of bash, screen, mc, uucp,
ncurses, inetutils, cvs or emacs)
Philippe