[PATCH v3] nptl: Fix __futex_clocklock64 return error check [BZ #26964]
Tulio Magno Quites Machado Filho
tuliom@ascii.art.br
Tue Dec 1 23:05:48 GMT 2020
Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org> writes:
> On 30/11/2020 18:37, Lucas A. M. Magalhaes wrote:
>> The earlier implementation of this, __lll_clocklock, calls lll_clockwait
>> that doesn't return the futex syscall error codes. It always tries again
>> if that fails.
>>
>> However in the current implementation, when the futex returns EAGAIN,
>> __futex_clocklock64 will also return EGAIN, even if the futex is taken.
>>
>> This patch fixes the EAGAIN issue and also adds a check for EINTR. As
>> futex syscall can return EINTR if the thread is interrupted by a signal.
>> In this case I'm assuming the function should continue trying to lock as
>> there is no mention to about it on POSIX. Also add a test for both
>> scenarios.
>
> LGTM with the change in comment below (there is no need to send a v4).
>
> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Changed the comments below and pushed as 61855081017dff30c577855cda882740356b5d98.
Thanks!
--
Tulio Magno
More information about the Libc-alpha
mailing list