[PATCH v2 25/25] linux: Add futex_waitv

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Wed Nov 11 14:03:29 GMT 2026



On 11/11/26 07:25, Yury Khrustalev wrote:
> On Tue, Nov 10, 2026 at 12:10:09PM -0300, Adhemerval Zanella wrote:
>> Add a wrapper for the futex_waitv system call to <sys/futex.h>:
>>
>>   struct futex_waiter
>>   {
>>     uint64_t val;
>>     uint64_t uaddr;
>>     uint32_t flags;
>>     uint32_t __reserved;
>>   };
>>
>>   int futex_waitv (const struct futex_waiter *waiters,
>>                    unsigned int nwaiters, unsigned int flags,
>>                    const struct timespec *abstime, clockid_t clockid);
>>
>> It blocks on up to FUTEX_WAITV_MAX (128) futexes at the same time
>> until any of them is woken.  On success it returns the array index of
>> the woken futex; on failure it returns -1 and sets errno.  The timeout
>> is absolute, measured against CLOCK_REALTIME or CLOCK_MONOTONIC.
>>
>> The struct futex_waiter has the same layout as the kernel struct
>> futex_waitv and each entry carries the kernel FUTEX2_* flags. The only
>> extra handling is the negative absolute timeout, which the kernel
>> rejects with EINVAL and the wrapper reports as ETIMEDOUT.
>>
>> The underlying system call only supports 64-bit time_t and so does the
>> wrapper.
>>
>> Checked on x86_64-linux-gnu and i686-linux-gnu.
>>
>> Co-authored-by: Andr� Almeida <andrealmeid@igalia.com>
> 
> Patchwork shows regressions on arm32 but I cannot reproduce them.
> Tests run successfully on armhf-linux-gnu. Also I see no regressions
> on i686-linux-gnu. Might be another false positive.
Indeed, I tried to mimic the CI environment but some tests seems to required some
extra care due the kernel version (I only tests on Linux 7.4-rc1).

The tst-membarrier issue is how it tries to parse the nohz_full support. Before
Linux 6.19, when the nohz_full CPU mask was never allocated, the file prints
(null) padded with leading spaces to the number of possible CPUs. The fix should
simple, skip spaces, and treats an empty file or (null) as "no nohz_full CPUs".

The tst-statmount and tst-xattrat are most likely due EEPERM from the container's
seccomp filter. I added a fix and returned unsupported in these cases.


More information about the Libc-alpha mailing list