pub fn futex2_waitv(
futexes: [*]const futex2_waitone,
/// Length of `futexes`. Max of FUTEX2_WAITONE_MAX.
nr_futexes: u32,
flags: FUTEX2_FLAGS_WAITV,
/// Optional absolute timeout. Always 64-bit, even on 32-bit platforms.
timeout: ?*const kernel_timespec,
/// Clock to be used for the timeout, realtime or monotonic.
clockid: clockid_t,
) usize futexes: [*]const futex2_waitonenr_futexes: u32Length of futexes. Max of FUTEX2_WAITONE_MAX.
flags: FUTEX2_FLAGS_WAITVtimeout: ?*const kernel_timespecOptional absolute timeout. Always 64-bit, even on 32-bit platforms.
clockid: clockid_tClock to be used for the timeout, realtime or monotonic.
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951pub fn futex2_waitv(
futexes: [*]const futex2_waitone,
/// Length of `futexes`. Max of FUTEX2_WAITONE_MAX.
nr_futexes: u32,
flags: FUTEX2_FLAGS_WAITV,
/// Optional absolute timeout. Always 64-bit, even on 32-bit platforms.
timeout: ?*const kernel_timespec,
/// Clock to be used for the timeout, realtime or monotonic.
clockid: clockid_t,
) usize {
return syscall5(
.futex_waitv,
@intFromPtr(futexes),
nr_futexes,
@as(u32, @bitCast(flags)),
@intFromPtr(timeout),
@backingInt(clockid),
);
}
Given an array of
futex2_waitone, wait on each uaddr. The thread wakes if a futex_wake() is performed at any uaddr. The syscall returns immediately if any futex has *uaddr != val. timeout is an optional, absolute timeout value for the operation. Theflagsargument is for future use and currently should be.{}. Flags for private futexes, sizes, etc. should be set on the individual flags of eachfutex2_waitone.Returns the array index of one of the woken futexes. No further information is provided: any number of other futexes may also have been woken by the same event, and if more than one futex was woken, the returned index may refer to any one of them. (It is not necessaryily the futex with the smallest index, nor the one most recently woken, nor...)
Requires at least kernel v5.16.