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 standard library.
std › os › linux › futex Public Function futex Doc Source Public Function std.os.linux.futex
pub fn futex (uaddr : *const anyopaque , futex_op : FUTEX_OP , val : u32 , val2timeout : futex_param4 , uaddr2 : ?*const anyopaque , val3 : u32 ) usize Params uaddr : *const anyopaque futex_op : FUTEX_OP val : u32 val2timeout : futex_param4 uaddr2 : ?*const anyopaque val3 : u32 File os/linux.zig: 882
882
883
884
885
886
887
888
889
890
891
892 pub fn futex (uaddr : *const anyopaque , futex_op : FUTEX_OP , val : u32 , val2timeout : futex_param4 , uaddr2 : ?*const anyopaque , val3 : u32 ) usize {
return syscall6 (
if (@hasField (SYS , "futex" ) and native_arch != .hexagon ) .futex else .futex_time64 ,
@intFromPtr (uaddr ),
@as (u32 , @bitCast (futex_op )),
val ,
@intFromPtr (val2timeout .timeout ),
@intFromPtr (uaddr2 ),
val3 ,
);
}
The futex v1 syscall, see also the newer the futex2_{wait,wakeup,requeue,waitv} syscalls.
The futex_op parameter is a sub-command and flags. The sub-command defines which of the subsequent paramters are relevant.