Re: Is psSocketPoll doing the right thing? - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Is psSocketPoll doing the right thing?
Date
Msg-id a710116d-870a-3788-0de0-f94c755272af@oss.nttdata.com
Whole thread Raw
In response to Is psSocketPoll doing the right thing?  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: Is psSocketPoll doing the right thing?
List pgsql-hackers

On 2023/02/09 11:50, Kyotaro Horiguchi wrote:
> Hello.
> 
> While looking a patch, I found that pqSocketPoll passes through the
> result from poll(2) to the caller and throws away revents. If I
> understand it correctly, poll() *doesn't* return -1 nor errno by the
> reason it has set POLLERR, POLLHUP, POLLNVAL, and POLLRDHUP for some
> of the target sockets, and returns 0 unless poll() itself failed to
> work.

As far as I understand correctly, poll() returns >0 if "revents"
has either of those bits, not 0 nor -1.

You're thinking that pqSocketPoll() should check "revents" and
return -1 if either of those bits is set?

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: Can we do something to help stop users mistakenly using force_parallel_mode?
Next
From: Peter Eisentraut
Date:
Subject: Re: Consolidate ItemPointer to Datum conversion functions