Re: [PATCH v3 5/6] uapi: futex: Add a futex waitv syscall
From: Arnd Bergmann
Date: Fri Nov 26 2021 - 02:29:35 EST
On Fri, Nov 26, 2021 at 7:00 AM Alistair Francis
<alistair.francis@xxxxxxxxxxxxxxxxxx> wrote:
>
> From: Alistair Francis <alistair.francis@xxxxxxx>
>
> This commit adds a futex waitv syscall wrapper that is exposed to
> userspace.
>
> Neither the kernel or glibc currently expose a futex wrapper, so
> userspace is left performing raw syscalls. As the futex_waitv syscall
> always expects a 64-bit time_t this can be tricky for 32-bit systems to
> get correct.
>
> In order to avoid userspace incorrectly passing the wrong timeouts let's
> expose a public helper function that ensures the kernel is passed the
> correct timeout struct.
>
> Signed-off-by: Alistair Francis <alistair.francis@xxxxxxx>
Reviewed-by: Arnd Bergmann <arnd@xxxxxxxx>
> +/**
> + * futex_waitv - Wait at multiple futexes, wake on any
> + * @waiters: Array of waiters
> + * @nr_waiters: Length of waiters array
> + * @flags: Operation flags
> + * @timo: Optional timeout for operation
> + */
> +static inline int
> +__kernel_futex_syscall_waitv(volatile struct futex_waitv *waiters, unsigned long nr_waiters,
> + unsigned long flags, struct timespec *timo, clockid_t clockid)
Same thing about the mismatched function name
Arnd