bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mingw: test-poll pipe part fails


From: Matthias Bolte
Subject: Re: mingw: test-poll pipe part fails
Date: Sat, 4 Jun 2011 00:37:17 +0200

2011/5/25 Matthias Bolte <address@hidden>:
> Output from a test run on mingw
>
> Unconnected socket test... passed
> Connected sockets test... passed
> General socket test with fork... passed
> Pipe test... failed (expecting POLLHUP after shutdown)
> FAIL: test-poll.exe
>
> This affects the attempt to make libvirtd working on Windows. libvirtd
> relies on poll blocking on a pipe until an event occurs when calling
> poll with a timeout of -1. But poll doesn't behave that way under
> mingw.

After testing a while and reading MSDN docs the problem seems to be
that MsgWaitForMultipleObjects doesn't work on pipes. It doesn't
actually wait but just returns immediately. Digging MSDN and googling
about this suggest that there is no simple solution to this.

Eric Blake suggested some approaches to this problem on IRC:

<eblake> it should be possible to wrap an event object around pipe
fds, such that WaitForMultipleObjects wakes if the event fires, while
the event fires if the pipe changes state

<eblake> maybe another approach would be to get the gnulib emulation
of anonymous socketpair() working on mingw by using IPv4 loopback
sockets
<eblake> and use sockets to emulate pipes
<eblake> that is, mingw pipe() could wrap socketpair(), at which poll
on "pipe" fds works
<eblake> again, not trivial, but certainly worth raising as an idea on
the gnulib list

Anyone else an idea or suggestion on this problem?

Matthias



reply via email to

[Prev in Thread] Current Thread [Next in Thread]