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.

utsname

c.utsname
pub const utsname = switch (native_os)

File

lib/std/c.zig:7049

Code

pub const utsname = switch (native_os) {
    .linux => linux.utsname,
    .emscripten => emscripten.utsname,
    .wasi => extern struct {
        sysname: [64:0]u8,
        nodename: [64:0]u8,
        release: [64:0]u8,
        version: [64:0]u8,
        machine: [64:0]u8,
        domainname: [64:0]u8,
    },
    .illumos => extern struct {
        sysname: [256:0]u8,
        nodename: [256:0]u8,
        release: [256:0]u8,
        version: [256:0]u8,
        machine: [256:0]u8,
        domainname: [256:0]u8,
    },
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => extern struct {
        sysname: [255:0]u8,
        nodename: [255:0]u8,
        release: [255:0]u8,
        version: [255:0]u8,
        machine: [255:0]u8,
    },
    // https://github.com/SerenityOS/serenity/blob/d794ed1de7a46482272683f8dc4c858806390f29/Kernel/API/POSIX/sys/utsname.h#L17-L23
    .serenity => extern struct {
        sysname: [UTSNAME_ENTRY_LEN:0]u8,
        nodename: [UTSNAME_ENTRY_LEN:0]u8,
        release: [UTSNAME_ENTRY_LEN:0]u8,
        version: [UTSNAME_ENTRY_LEN:0]u8,
        machine: [UTSNAME_ENTRY_LEN:0]u8,

        const UTSNAME_ENTRY_LEN = 64;
    },
    else => void,
}