PATCH: Support Windows in event-loop.c

Daniel Jacobowitz drow@false.org
Thu Apr 21 20:56:00 GMT 2005


On Thu, Apr 21, 2005 at 11:27:59PM +0300, Eli Zaretskii wrote:
> > Date: Thu, 21 Apr 2005 11:56:02 -0700
> > From: Mark Mitchell <mark@codesourcery.com>
> > CC: gdb-patches@sources.redhat.com
> > 
> > Eli Zaretskii wrote:
> > 
> > > Is it perhaps possible to write an emulation of `select' that would
> > > handle file handles as well
> > 
> > Well, Cygwin has select, so it is *possible*.  But, it's not easy, and 
> > it doesn't really map terribly well onto what Windows provides.
> 
> Perhaps you could look at w32proc.c:sys_select in the Emacs
> distribution, and copy its code with minimal changes.
> 
> > As Daniel says, this is very much analogous to poll/select; different 
> > systems provide different low-level mechanisms for waiting for input.
> 
> It isn't analogous: HAVE_POLL tests for a system-independent
> functionality, not unlike HAVE_UNISTD_H, while USE_WIN32API tests for
> an OS-specific misfeature and names an OS-specific macro.

I don't follow this objection:

  - I don't think that we get to call OS-specific interfaces
    "misfeatures".

  - I don't think that answering your objection with an autoconf test for
    WaitForMultipleObjects would make you any happier.  Would it?

How does the fact that only Windows provides WaitForMultipleObjects
make it conceptually different from the fact that a bunch of systems
provide poll, and a bunch don't?

Anyway, if Mark can come up with a select wrapper, then maybe we can
drop the question entirely.

-- 
Daniel Jacobowitz
CodeSourcery, LLC



More information about the Gdb-patches mailing list