Re: [PATCH 20/40] Windows: A rudimentary poll() emulation.

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

 



On Friday 29 February 2008 22:47, Govind Salinas wrote:
> On 2/29/08, Johannes Sixt <johannes.sixt@xxxxxxxxxx> wrote:
> > On Friday 29 February 2008 05:19, Govind Salinas wrote:
> >  > On Thu, Feb 28, 2008 at 2:49 PM, Johannes Sixt
> >  > <johannes.sixt@xxxxxxxxxx>
> >
> >  wrote:
> >  > > On Thursday 28 February 2008 10:36, Paolo Bonzini wrote:
> > > >  > For the future, would it be better to first use
> > > >  >
> >  > >  > WaitForMultipleObjects, and then use PeekNamedPipe to find which
> >  > >  > handles have data on it? That's how the mingw port of GNU
> >  > >  > Smalltalk does it.
> >  > >
> >  > >  I tried but I failed. If you can show me code where
> >
> >      ^^^^^^^^^^^^^^^^^^^^^
> >
> >  > > WaitForMultipleObjects works on handles that MSVCRT.DLL's open()
> >  > > created, I'll gladly accept it!
> >  >
> >  > I haven't tried it myself, but you can look at _get_osfhandle
> >  >
> >  > http://msdn2.microsoft.com/en-us/library/ks2530z6(VS.71).aspx
> >  >
> >  > of course you would need to keep a mapping from the handle to the fd.
> >  > Or _open_osfhandle might work the other way, I don't know if it will
> >  > necessarily return the same descriptor.
> >  >
> >  > http://msdn2.microsoft.com/en-us/library/bdts1c9x(VS.71).aspx
> >
> > Fscking basics, this. How do you go from here to WaitForMultipleObjects?
>
> Well, I could have sworn that named pipe handles were in the waitable
> list, but after looking again, they are not.
>
> However, I did find
>
> http://msdn2.microsoft.com/en-us/library/aa365603(VS.85).aspx
>
> which suggests you can pass these handles to ReadFile and if you include an
> OVERLAPPED struct in the call, it will return an event handle to wait on
> which you can then use to wait.

I've read the documentation. Try it. Come back when you succeed.

-- Hannes
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux