futex2test.h 654 B

12345678910111213141516171819202122
  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. #define u64_to_ptr(x) ((void *)(uintptr_t)(x))
  9. /**
  10. * futex_waitv - Wait at multiple futexes, wake on any
  11. * @waiters: Array of waiters
  12. * @nr_waiters: Length of waiters array
  13. * @flags: Operation flags
  14. * @timo: Optional timeout for operation
  15. */
  16. static inline int futex_waitv(volatile struct futex_waitv *waiters, unsigned long nr_waiters,
  17. unsigned long flags, struct timespec *timo, clockid_t clockid)
  18. {
  19. return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, timo, clockid);
  20. }