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.

syscall2

x86_64.syscall2
pub fn syscall2(sys: plan9.SYS, arg0: usize, arg1: usize) usize

File

lib/std/os/plan9/x86_64.zig:16

Code

pub fn syscall2(sys: plan9.SYS, arg0: usize, arg1: usize) usize {
    return asm volatile (
        \\push %%r9
        \\push %%r8
        \\push $0
        \\syscall
        \\pop %%r11
        \\pop %%r11
        \\pop %%r11
        : [ret] "={rax}" (-> usize),
        : [arg0] "{r8}" (arg0),
          [arg1] "{r9}" (arg1),
          [syscall_number] "{rbp}" (@backingInt(sys)),
        : .{ .rcx = true, .rax = true, .rbp = true, .r11 = true, .memory = true });
}