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.

syscall_pipe

sparc64.syscall_pipe
pub fn syscall_pipe(
    fd: *[2]std.os.linux.fd_t,
) u64

File

lib/std/os/linux/sparc64.zig:147

Code

pub fn syscall_pipe(
    fd: *[2]std.os.linux.fd_t,
) u64 {
    return asm volatile (
        \\ mov %[arg], %%g3
        \\ t 0x6d
        \\ bcc,pt %%xcc, 1f
        \\  nop
        \\ # Return the error code
        \\ ba 2f
        \\  neg %%o0
        \\1:
        \\ st %%o0, [%%g3+0]
        \\ st %%o1, [%%g3+4]
        \\ clr %%o0
        \\2:
        : [ret] "={o0}" (-> u64),
        : [number] "{g1}" (@backingInt(SYS.pipe)),
          [arg] "r" (fd),
        : .{ .memory = true, .g3 = true });
}