Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

futex2_waitv

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.

linux.futex2_waitv
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

File

lib/std/os/linux.zig:932

Code

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),
        @backingInt(clockid),
    );
}