Re: Is psSocketPoll doing the right thing?

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Is psSocketPoll doing the right thing?
Date: 2023-02-09 08:32:08
Message-ID: a710116d-870a-3788-0de0-f94c755272af@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2023-02-09 08:33:16 Re: Consolidate ItemPointer to Datum conversion functions
Previous Message John Naylor 2023-02-09 08:20:17 Re: Can we do something to help stop users mistakenly using force_parallel_mode?