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_lseek

mipsn32.syscall_lseek
pub fn syscall_lseek(
    fd: std.os.linux.fd_t,
    offset: std.os.linux.off_t,
    whence: u32,
) u64

File

lib/std/os/linux/mipsn32.zig:166

Code

pub fn syscall_lseek(
    fd: std.os.linux.fd_t,
    offset: std.os.linux.off_t,
    whence: u32,
) u64 {
    return asm volatile (
        \\ syscall
        \\ beq $a3, $zero, 1f
        \\ blez $v0, 1f
        \\ dsubu $v0, $zero, $v0
        \\1:
        : [ret] "={$2}" (-> u64),
        : [number] "{$2}" (@backingInt(SYS.lseek)),
          [fd] "{$4}" (@as(u32, @bitCast(fd))),
          [offset] "{$5}" (@as(u64, @bitCast(offset))),
          [whence] "{$6}" (whence),
        : .{ .r1 = true, .r3 = true, .r7 = true, .r8 = true, .r9 = true, .r10 = true, .r11 = true, .r12 = true, .r13 = true, .r14 = true, .r15 = true, .r24 = true, .r25 = true, .hi = true, .lo = true, .memory = true });
}