On 16/08/18 11:58, Hans Verkuil wrote:
>>> +On success :c:func:`poll() <request-func-poll>` returns the number of file
>>> +descriptors that have been selected (that is, file descriptors for which
>>> the +``revents`` field of the respective struct :c:type:`pollfd`
>>> +is non-zero). Request file descriptor set the ``POLLPRI`` flag in
>>> ``revents`` +when the request was completed.  When the function times out
>>> it returns +a value of zero, on failure it returns -1 and the ``errno``
>>> variable is +set appropriately.
>>> +
>>> +Attempting to poll for a request that is completed or not yet queued will
>>> +set the ``POLLERR`` flag in ``revents``.
>>
>> Why should a completed request set POLLERR, given that the purpose of poll() 
>> is to poll for completion ?
> 
> I think you are right. We should just always set POLLPRI for completed 
> requests.
> I'll change that.

I checked the code, and this is actually what happens already. So the text 
should
read:

"Attempting to poll for a request that is not yet queued will set the 
``POLLERR``
flag in ``revents``."

I'll update this.

Regards,

        Hans

Reply via email to