Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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 standard library. Public Function

futex2_waitv

Public Function
std.os.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

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.

Params

  • futexes: [*]const futex2_waitone
  • nr_futexes: u32

    Length of futexes. Max of FUTEX2_WAITONE_MAX.

  • flags: FUTEX2_FLAGS_WAITV
  • timeout: ?*const kernel_timespec

    Optional absolute timeout. Always 64-bit, even on 32-bit platforms.

  • clockid: clockid_t

    Clock to be used for the timeout, realtime or monotonic.

File

os/linux.zig:933
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
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),
    );
}