[haiku-gsoc] Re: Swift port compiler hangs on poll()

  • From: Hamish Morrison <hamishm53@xxxxxxxxx>
  • To: haiku-gsoc@xxxxxxxxxxxxx
  • Date: Tue, 27 Jun 2017 10:30:10 +0100

On Fri, Jun 23, 2017 at 9:29 PM, Adrien Destugues
<pulkomandy@xxxxxxxxxxxxx> wrote:

It's hard to tell with just the strace, but it looks like poll is
telling that some file descriptor is readable (or at least, Swift thinks
so), but then when trying to read, there are 0 bytes read.

From the code around these lines, I assume that the file descriptor here
are pipes with the input in other processes. Possibly we do something
unusual when the remote end of a pipe is closed?

I'm pretty certain this is correct. Poll should return POLLIN whenever
a read can be completed without blocking (including when read() will
return 0).

Other related posts: