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.

SCM

c.SCM
pub const SCM = switch (native_os)

File

lib/std/c.zig:6912

Code

pub const SCM = switch (native_os) {
    .linux, .emscripten => linux.SCM,
    // https://github.com/illumos/illumos-gate/blob/489f6310fe8952e87fc1dce8af87990fcfd90f18/usr/src/uts/common/sys/socket.h#L196
    .illumos => struct {
        pub const RIGHTS = 0x1010;
        pub const UCRED = 0x1012;
        pub const TIMESTAMP = SO.TIMESTAMP;
    },
    // https://github.com/haiku/haiku/blob/e3d01e53a25446d5ba4999d0ff6dff29a2418657/headers/posix/sys/socket.h#L156
    .haiku => struct {
        pub const RIGHTS = 1;
    },
    // https://github.com/SerenityOS/serenity/blob/c6618f36bf0949bd76177f202659b1f3079e0792/Kernel/API/POSIX/sys/socket.h#L171
    .serenity => struct {
        pub const TIMESTAMP = 0;
        pub const RIGHTS = 1;
    },
    // https://github.com/freebsd/freebsd-src/blob/614e9b33bf5594d9d09b5d296afa4f3aa6971823/sys/sys/socket.h#L593
    .freebsd => struct {
        pub const RIGHTS = 1;
        pub const TIMESTAMP = 2;
        pub const CREDS = 3;
        pub const BINTIME = 4;
        pub const REALTIME = 5;
        pub const MONOTONIC = 6;
        pub const TIME_INFO = 7;
        pub const CREDS2 = 8;
    },
    // https://github.com/DragonFlyBSD/DragonFlyBSD/blob/6098912863ed4c7b3f70d7483910ce2956cf4ed3/sys/sys/socket.h#L520
    .dragonfly => struct {
        pub const RIGHTS = 1;
        pub const TIMESTAMP = 2;
        pub const CREDS = 3;
    },
    // https://github.com/NetBSD/src/blob/3311177ea898ab8322292ba0e48faa9b2e834cb6/sys/sys/socket.h#L578
    .netbsd => struct {
        pub const RIGHTS = 0x01;
        pub const TIMESTAMP = 0x08;
        pub const CREDS = 0x10;
    },
    // https://github.com/openbsd/src/blob/1b1dd04c9634112eb763374379af99a68ace4328/sys/sys/socket.h#L566
    .openbsd => struct {
        pub const RIGHTS = 0x01;
        pub const TIMESTAMP = 0x04;
    },
    // https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/sys/socket.h#L1114
    .driverkit, .ios, .maccatalyst, .macos, .tvos, .visionos, .watchos => struct {
        pub const RIGHTS = 1;
        pub const TIMESTAMP = 2;
        pub const CREDS = 3;
        pub const TIMESTAMP_MONOTONIC = 4;
    },
    else => void,
}