1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Futex2 library addons for futex tests
4  *
5  * Copyright 2021 Collabora Ltd.
6  */
7 #include <stdint.h>
8 
9 #define u64_to_ptr(x) ((void *)(uintptr_t)(x))
10 
11 /**
12  * futex_waitv - Wait at multiple futexes, wake on any
13  * @waiters:    Array of waiters
14  * @nr_waiters: Length of waiters array
15  * @flags: Operation flags
16  * @timo:  Optional timeout for operation
17  */
18 static inline int futex_waitv(volatile struct futex_waitv *waiters, unsigned long nr_waiters,
19 			      unsigned long flags, struct timespec *timo, clockid_t clockid)
20 {
21 	return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, timo, clockid);
22 }
23