Function futex2_waitv [src]
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.
The flags argument is for future use and currently should be .{}.
Flags for private futexes, sizes, etc. should be set on the
individual flags of each futex2_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.
Prototype
pub fn futex2_waitv( futexes: [*]const futex2_waitone, nr_futexes: u32, flags: FUTEX2_FLAGS_WAITV, timeout: ?*const kernel_timespec, clockid: clockid_t, ) usize
Parameters
futexes: [*]const futex2_waitone
nr_futexes: u32Length of futexes. Max of FUTEX2_WAITONE_MAX.
flags: FUTEX2_FLAGS_WAITV
timeout: ?*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.
Source
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 {
return syscall5(
.futex_waitv,
@intFromPtr(futexes),
nr_futexes,
@as(u32, @bitCast(flags)),
@intFromPtr(timeout),
@intFromEnum(clockid),
);
}