structstd.c[src]

Types

Typeino_t[src]

Source Code

Source code
pub const ino_t = switch (native_os) {
    .linux => linux.ino_t,
    .emscripten => emscripten.ino_t,
    .wasi => wasi.inode_t,
    .windows => windows.LARGE_INTEGER,
    .haiku => i64,
    else => u64,
}

Typeoff_t[src]

Source Code

Source code
pub const off_t = switch (native_os) {
    .linux => linux.off_t,
    .emscripten => emscripten.off_t,
    else => i64,
}

Typetimespec[src]

Functions

FunctionfromTimestamp[src]

pub fn fromTimestamp(tm: wasi.timestamp_t) timespec

Parameters

Source Code

Source code
pub fn fromTimestamp(tm: wasi.timestamp_t) timespec {
    const sec: wasi.timestamp_t = tm / 1_000_000_000;
    const nsec = tm - sec * 1_000_000_000;
    return .{
        .sec = @as(time_t, @intCast(sec)),
        .nsec = @as(isize, @intCast(nsec)),
    };
}

FunctiontoTimestamp[src]

pub fn toTimestamp(ts: timespec) wasi.timestamp_t

Parameters

Source Code

Source code
pub fn toTimestamp(ts: timespec) wasi.timestamp_t {
    return @as(wasi.timestamp_t, @intCast(ts.sec * 1_000_000_000)) +
        @as(wasi.timestamp_t, @intCast(ts.nsec));
}

Source Code

Source code
pub const timespec = switch (native_os) {
    .linux => linux.timespec,
    .emscripten => emscripten.timespec,
    .wasi => extern struct {
        sec: time_t,
        nsec: isize,

        pub fn fromTimestamp(tm: wasi.timestamp_t) timespec {
            const sec: wasi.timestamp_t = tm / 1_000_000_000;
            const nsec = tm - sec * 1_000_000_000;
            return .{
                .sec = @as(time_t, @intCast(sec)),
                .nsec = @as(isize, @intCast(nsec)),
            };
        }

        pub fn toTimestamp(ts: timespec) wasi.timestamp_t {
            return @as(wasi.timestamp_t, @intCast(ts.sec * 1_000_000_000)) +
                @as(wasi.timestamp_t, @intCast(ts.nsec));
        }
    },
    .windows => extern struct {
        sec: time_t,
        nsec: c_long,
    },
    .dragonfly, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        sec: isize,
        nsec: isize,
    },
    .netbsd, .solaris, .illumos => extern struct {
        sec: i64,
        nsec: isize,
    },
    .openbsd, .haiku => extern struct {
        sec: time_t,
        nsec: isize,
    },
    else => void,
}

Typedev_t[src]

Source Code

Source code
pub const dev_t = switch (native_os) {
    .linux => linux.dev_t,
    .emscripten => emscripten.dev_t,
    .wasi => wasi.device_t,
    .openbsd, .haiku, .solaris, .illumos, .macos, .ios, .tvos, .watchos, .visionos => i32,
    .netbsd, .freebsd => u64,
    else => void,
}

Typemode_t[src]

Source Code

Source code
pub const mode_t = switch (native_os) {
    .linux => linux.mode_t,
    .emscripten => emscripten.mode_t,
    .openbsd, .haiku, .netbsd, .solaris, .illumos, .wasi, .windows => u32,
    .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .dragonfly => u16,
    else => u0,
}
Source code
pub const nlink_t = switch (native_os) {
    .linux => linux.nlink_t,
    .emscripten => emscripten.nlink_t,
    .wasi => c_ulonglong,
    .freebsd => u64,
    .openbsd, .netbsd, .solaris, .illumos => u32,
    .haiku => i32,
    else => void,
}

Typeuid_t[src]

Source Code

Source code
pub const uid_t = switch (native_os) {
    .linux => linux.uid_t,
    .emscripten => emscripten.uid_t,
    else => u32,
}

Typegid_t[src]

Source Code

Source code
pub const gid_t = switch (native_os) {
    .linux => linux.gid_t,
    .emscripten => emscripten.gid_t,
    else => u32,
}

Typeblksize_t[src]

Source Code

Source code
pub const blksize_t = switch (native_os) {
    .linux => linux.blksize_t,
    .emscripten => emscripten.blksize_t,
    .wasi => c_long,
    else => i32,
}

Typepasswd[src]

Source Code

Source code
pub const passwd = switch (native_os) {
    .linux => extern struct {
        name: ?[*:0]const u8, // username
        passwd: ?[*:0]const u8, // user password
        uid: uid_t, // user ID
        gid: gid_t, // group ID
        gecos: ?[*:0]const u8, // user information
        dir: ?[*:0]const u8, // home directory
        shell: ?[*:0]const u8, // shell program
    },
    .netbsd, .openbsd, .macos => extern struct {
        name: ?[*:0]const u8, // user name
        passwd: ?[*:0]const u8, // encrypted password
        uid: uid_t, // user uid
        gid: gid_t, // user gid
        change: time_t, // password change time
        class: ?[*:0]const u8, // user access class
        gecos: ?[*:0]const u8, // Honeywell login info
        dir: ?[*:0]const u8, // home directory
        shell: ?[*:0]const u8, // default shell
        expire: time_t, // account expiration
    },
    else => void,
}

Typeblkcnt_t[src]

Source Code

Source code
pub const blkcnt_t = switch (native_os) {
    .linux => linux.blkcnt_t,
    .emscripten => emscripten.blkcnt_t,
    .wasi => c_longlong,
    else => i64,
}

Typefd_t[src]

Source Code

Source code
pub const fd_t = switch (native_os) {
    .linux => linux.fd_t,
    .wasi => wasi.fd_t,
    .windows => windows.HANDLE,
    else => i32,
}

TypeARCH[src]

Source Code

Source code
pub const ARCH = switch (native_os) {
    .linux => linux.ARCH,
    else => void,
}

Typetimerfd_clockid_t[src]

Source Code

Source code
pub const timerfd_clockid_t = switch (native_os) {
    .freebsd => enum(u32) {
        REALTIME = 0,
        MONOTONIC = 4,
        _,
    },
    .linux => linux.timerfd_clockid_t,
    else => clockid_t,
}

Typetimerfd_clockid_t[src]

Source Code

Source code
pub const timerfd_clockid_t = switch (native_os) {
    .freebsd => enum(u32) {
        REALTIME = 0,
        MONOTONIC = 4,
        _,
    },
    .linux => linux.timerfd_clockid_t,
    else => clockid_t,
}

Typeclockid_t[src]

Source Code

Source code
pub const clockid_t = switch (native_os) {
    .linux, .emscripten => linux.clockid_t,
    .wasi => wasi.clockid_t,
    .macos, .ios, .tvos, .watchos, .visionos => enum(u32) {
        REALTIME = 0,
        MONOTONIC = 6,
        MONOTONIC_RAW = 4,
        MONOTONIC_RAW_APPROX = 5,
        UPTIME_RAW = 8,
        UPTIME_RAW_APPROX = 9,
        PROCESS_CPUTIME_ID = 12,
        THREAD_CPUTIME_ID = 16,
        _,
    },
    .haiku => enum(i32) {
        /// system-wide monotonic clock (aka system time)
        MONOTONIC = 0,
        /// system-wide real time clock
        REALTIME = -1,
        /// clock measuring the used CPU time of the current process
        PROCESS_CPUTIME_ID = -2,
        /// clock measuring the used CPU time of the current thread
        THREAD_CPUTIME_ID = -3,
    },
    .freebsd => enum(u32) {
        REALTIME = 0,
        VIRTUAL = 1,
        PROF = 2,
        MONOTONIC = 4,
        UPTIME = 5,
        UPTIME_PRECISE = 7,
        UPTIME_FAST = 8,
        REALTIME_PRECISE = 9,
        REALTIME_FAST = 10,
        MONOTONIC_PRECISE = 11,
        MONOTONIC_FAST = 12,
        SECOND = 13,
        THREAD_CPUTIME_ID = 14,
        PROCESS_CPUTIME_ID = 15,
    },
    .solaris, .illumos => enum(u32) {
        VIRTUAL = 1,
        THREAD_CPUTIME_ID = 2,
        REALTIME = 3,
        MONOTONIC = 4,
        PROCESS_CPUTIME_ID = 5,
    },
    .netbsd => enum(u32) {
        REALTIME = 0,
        VIRTUAL = 1,
        PROF = 2,
        MONOTONIC = 3,
        THREAD_CPUTIME_ID = 0x20000000,
        PROCESS_CPUTIME_ID = 0x40000000,
    },
    .dragonfly => enum(u32) {
        REALTIME = 0,
        VIRTUAL = 1,
        PROF = 2,
        MONOTONIC = 4,
        UPTIME = 5,
        UPTIME_PRECISE = 7,
        UPTIME_FAST = 8,
        REALTIME_PRECISE = 9,
        REALTIME_FAST = 10,
        MONOTONIC_PRECISE = 11,
        MONOTONIC_FAST = 12,
        SECOND = 13,
        THREAD_CPUTIME_ID = 14,
        PROCESS_CPUTIME_ID = 15,
    },
    .openbsd => enum(u32) {
        REALTIME = 0,
        PROCESS_CPUTIME_ID = 2,
        MONOTONIC = 3,
        THREAD_CPUTIME_ID = 4,
    },
    else => void,
}

Typeclockid_t[src]

Source Code

Source code
pub const clockid_t = switch (native_os) {
    .linux, .emscripten => linux.clockid_t,
    .wasi => wasi.clockid_t,
    .macos, .ios, .tvos, .watchos, .visionos => enum(u32) {
        REALTIME = 0,
        MONOTONIC = 6,
        MONOTONIC_RAW = 4,
        MONOTONIC_RAW_APPROX = 5,
        UPTIME_RAW = 8,
        UPTIME_RAW_APPROX = 9,
        PROCESS_CPUTIME_ID = 12,
        THREAD_CPUTIME_ID = 16,
        _,
    },
    .haiku => enum(i32) {
        /// system-wide monotonic clock (aka system time)
        MONOTONIC = 0,
        /// system-wide real time clock
        REALTIME = -1,
        /// clock measuring the used CPU time of the current process
        PROCESS_CPUTIME_ID = -2,
        /// clock measuring the used CPU time of the current thread
        THREAD_CPUTIME_ID = -3,
    },
    .freebsd => enum(u32) {
        REALTIME = 0,
        VIRTUAL = 1,
        PROF = 2,
        MONOTONIC = 4,
        UPTIME = 5,
        UPTIME_PRECISE = 7,
        UPTIME_FAST = 8,
        REALTIME_PRECISE = 9,
        REALTIME_FAST = 10,
        MONOTONIC_PRECISE = 11,
        MONOTONIC_FAST = 12,
        SECOND = 13,
        THREAD_CPUTIME_ID = 14,
        PROCESS_CPUTIME_ID = 15,
    },
    .solaris, .illumos => enum(u32) {
        VIRTUAL = 1,
        THREAD_CPUTIME_ID = 2,
        REALTIME = 3,
        MONOTONIC = 4,
        PROCESS_CPUTIME_ID = 5,
    },
    .netbsd => enum(u32) {
        REALTIME = 0,
        VIRTUAL = 1,
        PROF = 2,
        MONOTONIC = 3,
        THREAD_CPUTIME_ID = 0x20000000,
        PROCESS_CPUTIME_ID = 0x40000000,
    },
    .dragonfly => enum(u32) {
        REALTIME = 0,
        VIRTUAL = 1,
        PROF = 2,
        MONOTONIC = 4,
        UPTIME = 5,
        UPTIME_PRECISE = 7,
        UPTIME_FAST = 8,
        REALTIME_PRECISE = 9,
        REALTIME_FAST = 10,
        MONOTONIC_PRECISE = 11,
        MONOTONIC_FAST = 12,
        SECOND = 13,
        THREAD_CPUTIME_ID = 14,
        PROCESS_CPUTIME_ID = 15,
    },
    .openbsd => enum(u32) {
        REALTIME = 0,
        PROCESS_CPUTIME_ID = 2,
        MONOTONIC = 3,
        THREAD_CPUTIME_ID = 4,
    },
    else => void,
}

TypeCPU_COUNT[src]

Source Code

Source code
pub const CPU_COUNT = switch (native_os) {
    .linux => linux.CPU_COUNT,
    .emscripten => emscripten.CPU_COUNT,
    else => void,
}

TypeE[src]

Source Code

Source code
pub const E = switch (native_os) {
    .linux => linux.E,
    .emscripten => emscripten.E,
    .wasi => wasi.errno_t,
    .windows => enum(u16) {
        /// No error occurred.
        SUCCESS = 0,
        PERM = 1,
        NOENT = 2,
        SRCH = 3,
        INTR = 4,
        IO = 5,
        NXIO = 6,
        @"2BIG" = 7,
        NOEXEC = 8,
        BADF = 9,
        CHILD = 10,
        AGAIN = 11,
        NOMEM = 12,
        ACCES = 13,
        FAULT = 14,
        BUSY = 16,
        EXIST = 17,
        XDEV = 18,
        NODEV = 19,
        NOTDIR = 20,
        ISDIR = 21,
        NFILE = 23,
        MFILE = 24,
        NOTTY = 25,
        FBIG = 27,
        NOSPC = 28,
        SPIPE = 29,
        ROFS = 30,
        MLINK = 31,
        PIPE = 32,
        DOM = 33,
        /// Also means `DEADLOCK`.
        DEADLK = 36,
        NAMETOOLONG = 38,
        NOLCK = 39,
        NOSYS = 40,
        NOTEMPTY = 41,

        INVAL = 22,
        RANGE = 34,
        ILSEQ = 42,

        // POSIX Supplement
        ADDRINUSE = 100,
        ADDRNOTAVAIL = 101,
        AFNOSUPPORT = 102,
        ALREADY = 103,
        BADMSG = 104,
        CANCELED = 105,
        CONNABORTED = 106,
        CONNREFUSED = 107,
        CONNRESET = 108,
        DESTADDRREQ = 109,
        HOSTUNREACH = 110,
        IDRM = 111,
        INPROGRESS = 112,
        ISCONN = 113,
        LOOP = 114,
        MSGSIZE = 115,
        NETDOWN = 116,
        NETRESET = 117,
        NETUNREACH = 118,
        NOBUFS = 119,
        NODATA = 120,
        NOLINK = 121,
        NOMSG = 122,
        NOPROTOOPT = 123,
        NOSR = 124,
        NOSTR = 125,
        NOTCONN = 126,
        NOTRECOVERABLE = 127,
        NOTSOCK = 128,
        NOTSUP = 129,
        OPNOTSUPP = 130,
        OTHER = 131,
        OVERFLOW = 132,
        OWNERDEAD = 133,
        PROTO = 134,
        PROTONOSUPPORT = 135,
        PROTOTYPE = 136,
        TIME = 137,
        TIMEDOUT = 138,
        TXTBSY = 139,
        WOULDBLOCK = 140,
        DQUOT = 10069,
        _,
    },
    .macos, .ios, .tvos, .watchos, .visionos => darwin.E,
    .freebsd => freebsd.E,
    .solaris, .illumos => enum(u16) {
        /// No error occurred.
        SUCCESS = 0,
        /// Not super-user
        PERM = 1,
        /// No such file or directory
        NOENT = 2,
        /// No such process
        SRCH = 3,
        /// interrupted system call
        INTR = 4,
        /// I/O error
        IO = 5,
        /// No such device or address
        NXIO = 6,
        /// Arg list too long
        @"2BIG" = 7,
        /// Exec format error
        NOEXEC = 8,
        /// Bad file number
        BADF = 9,
        /// No children
        CHILD = 10,
        /// Resource temporarily unavailable.
        /// also: WOULDBLOCK: Operation would block.
        AGAIN = 11,
        /// Not enough core
        NOMEM = 12,
        /// Permission denied
        ACCES = 13,
        /// Bad address
        FAULT = 14,
        /// Block device required
        NOTBLK = 15,
        /// Mount device busy
        BUSY = 16,
        /// File exists
        EXIST = 17,
        /// Cross-device link
        XDEV = 18,
        /// No such device
        NODEV = 19,
        /// Not a directory
        NOTDIR = 20,
        /// Is a directory
        ISDIR = 21,
        /// Invalid argument
        INVAL = 22,
        /// File table overflow
        NFILE = 23,
        /// Too many open files
        MFILE = 24,
        /// Inappropriate ioctl for device
        NOTTY = 25,
        /// Text file busy
        TXTBSY = 26,
        /// File too large
        FBIG = 27,
        /// No space left on device
        NOSPC = 28,
        /// Illegal seek
        SPIPE = 29,
        /// Read only file system
        ROFS = 30,
        /// Too many links
        MLINK = 31,
        /// Broken pipe
        PIPE = 32,
        /// Math arg out of domain of func
        DOM = 33,
        /// Math result not representable
        RANGE = 34,
        /// No message of desired type
        NOMSG = 35,
        /// Identifier removed
        IDRM = 36,
        /// Channel number out of range
        CHRNG = 37,
        /// Level 2 not synchronized
        L2NSYNC = 38,
        /// Level 3 halted
        L3HLT = 39,
        /// Level 3 reset
        L3RST = 40,
        /// Link number out of range
        LNRNG = 41,
        /// Protocol driver not attached
        UNATCH = 42,
        /// No CSI structure available
        NOCSI = 43,
        /// Level 2 halted
        L2HLT = 44,
        /// Deadlock condition.
        DEADLK = 45,
        /// No record locks available.
        NOLCK = 46,
        /// Operation canceled
        CANCELED = 47,
        /// Operation not supported
        NOTSUP = 48,

        // Filesystem Quotas
        /// Disc quota exceeded
        DQUOT = 49,

        // Convergent Error Returns
        /// invalid exchange
        BADE = 50,
        /// invalid request descriptor
        BADR = 51,
        /// exchange full
        XFULL = 52,
        /// no anode
        NOANO = 53,
        /// invalid request code
        BADRQC = 54,
        /// invalid slot
        BADSLT = 55,
        /// file locking deadlock error
        DEADLOCK = 56,
        /// bad font file fmt
        BFONT = 57,

        // Interprocess Robust Locks
        /// process died with the lock
        OWNERDEAD = 58,
        /// lock is not recoverable
        NOTRECOVERABLE = 59,
        /// locked lock was unmapped
        LOCKUNMAPPED = 72,
        /// Facility is not active
        NOTACTIVE = 73,
        /// multihop attempted
        MULTIHOP = 74,
        /// trying to read unreadable message
        BADMSG = 77,
        /// path name is too long
        NAMETOOLONG = 78,
        /// value too large to be stored in data type
        OVERFLOW = 79,
        /// given log. name not unique
        NOTUNIQ = 80,
        /// f.d. invalid for this operation
        BADFD = 81,
        /// Remote address changed
        REMCHG = 82,

        // Stream Problems
        /// Device not a stream
        NOSTR = 60,
        /// no data (for no delay io)
        NODATA = 61,
        /// timer expired
        TIME = 62,
        /// out of streams resources
        NOSR = 63,
        /// Machine is not on the network
        NONET = 64,
        /// Package not installed
        NOPKG = 65,
        /// The object is remote
        REMOTE = 66,
        /// the link has been severed
        NOLINK = 67,
        /// advertise error
        ADV = 68,
        /// srmount error
        SRMNT = 69,
        /// Communication error on send
        COMM = 70,
        /// Protocol error
        PROTO = 71,

        // Shared Library Problems
        /// Can't access a needed shared lib.
        LIBACC = 83,
        /// Accessing a corrupted shared lib.
        LIBBAD = 84,
        /// .lib section in a.out corrupted.
        LIBSCN = 85,
        /// Attempting to link in too many libs.
        LIBMAX = 86,
        /// Attempting to exec a shared library.
        LIBEXEC = 87,
        /// Illegal byte sequence.
        ILSEQ = 88,
        /// Unsupported file system operation
        NOSYS = 89,
        /// Symbolic link loop
        LOOP = 90,
        /// Restartable system call
        RESTART = 91,
        /// if pipe/FIFO, don't sleep in stream head
        STRPIPE = 92,
        /// directory not empty
        NOTEMPTY = 93,
        /// Too many users (for UFS)
        USERS = 94,

        // BSD Networking Software
        // Argument Errors
        /// Socket operation on non-socket
        NOTSOCK = 95,
        /// Destination address required
        DESTADDRREQ = 96,
        /// Message too long
        MSGSIZE = 97,
        /// Protocol wrong type for socket
        PROTOTYPE = 98,
        /// Protocol not available
        NOPROTOOPT = 99,
        /// Protocol not supported
        PROTONOSUPPORT = 120,
        /// Socket type not supported
        SOCKTNOSUPPORT = 121,
        /// Operation not supported on socket
        OPNOTSUPP = 122,
        /// Protocol family not supported
        PFNOSUPPORT = 123,
        /// Address family not supported by
        AFNOSUPPORT = 124,
        /// Address already in use
        ADDRINUSE = 125,
        /// Can't assign requested address
        ADDRNOTAVAIL = 126,

        // Operational Errors
        /// Network is down
        NETDOWN = 127,
        /// Network is unreachable
        NETUNREACH = 128,
        /// Network dropped connection because
        NETRESET = 129,
        /// Software caused connection abort
        CONNABORTED = 130,
        /// Connection reset by peer
        CONNRESET = 131,
        /// No buffer space available
        NOBUFS = 132,
        /// Socket is already connected
        ISCONN = 133,
        /// Socket is not connected
        NOTCONN = 134,
        /// Can't send after socket shutdown
        SHUTDOWN = 143,
        /// Too many references: can't splice
        TOOMANYREFS = 144,
        /// Connection timed out
        TIMEDOUT = 145,
        /// Connection refused
        CONNREFUSED = 146,
        /// Host is down
        HOSTDOWN = 147,
        /// No route to host
        HOSTUNREACH = 148,
        /// operation already in progress
        ALREADY = 149,
        /// operation now in progress
        INPROGRESS = 150,

        // SUN Network File System
        /// Stale NFS file handle
        STALE = 151,

        _,
    },
    .netbsd => netbsd.E,
    .dragonfly => dragonfly.E,
    .haiku => haiku.E,
    .openbsd => openbsd.E,
    else => void,
}

TypeElf_Symndx[src]

Source Code

Source code
pub const Elf_Symndx = switch (native_os) {
    .linux => linux.Elf_Symndx,
    else => void,
}

TypeF[src]

Command flags for fcntl(2).

Values

ConstantGETFD[src]

Source Code

Source code
pub const GETFD = 1

ConstantSETFD[src]

Source Code

Source code
pub const SETFD = 2

ConstantGETFL[src]

Source Code

Source code
pub const GETFL = 3

ConstantSETFL[src]

Source Code

Source code
pub const SETFL = 4

ConstantDUPFD[src]

duplicate file descriptor

Source Code

Source code
pub const DUPFD = 0

ConstantGETFD[src]

get file descriptor flags

Source Code

Source code
pub const GETFD = 1

ConstantSETFD[src]

set file descriptor flags

Source Code

Source code
pub const SETFD = 2

ConstantGETFL[src]

get file status flags

Source Code

Source code
pub const GETFL = 3

ConstantSETFL[src]

set file status flags

Source Code

Source code
pub const SETFL = 4

ConstantGETOWN[src]

get SIGIO/SIGURG proc/pgrp

Source Code

Source code
pub const GETOWN = 5

ConstantSETOWN[src]

set SIGIO/SIGURG proc/pgrp

Source Code

Source code
pub const SETOWN = 6

ConstantGETLK[src]

get record locking information

Source Code

Source code
pub const GETLK = 7

ConstantSETLK[src]

set record locking information

Source Code

Source code
pub const SETLK = 8

ConstantSETLKW[src]

F.SETLK; wait if blocked

Source Code

Source code
pub const SETLKW = 9

ConstantSETLKWTIMEOUT[src]

F.SETLK; wait if blocked, return on timeout

Source Code

Source code
pub const SETLKWTIMEOUT = 10

ConstantFLUSH_DATA[src]

Source Code

Source code
pub const FLUSH_DATA = 40

ConstantCHKCLEAN[src]

Used for regression test

Source Code

Source code
pub const CHKCLEAN = 41

ConstantPREALLOCATE[src]

Preallocate storage

Source Code

Source code
pub const PREALLOCATE = 42

ConstantSETSIZE[src]

Truncate a file without zeroing space

Source Code

Source code
pub const SETSIZE = 43

ConstantRDADVISE[src]

Issue an advisory read async with no copy to user

Source Code

Source code
pub const RDADVISE = 44

ConstantRDAHEAD[src]

turn read ahead off/on for this fd

Source Code

Source code
pub const RDAHEAD = 45

ConstantNOCACHE[src]

turn data caching off/on for this fd

Source Code

Source code
pub const NOCACHE = 48

ConstantLOG2PHYS[src]

file offset to device offset

Source Code

Source code
pub const LOG2PHYS = 49

ConstantGETPATH[src]

return the full path of the fd

Source Code

Source code
pub const GETPATH = 50

ConstantFULLFSYNC[src]

fsync + ask the drive to flush to the media

Source Code

Source code
pub const FULLFSYNC = 51

ConstantPATHPKG_CHECK[src]

find which component (if any) is a package

Source Code

Source code
pub const PATHPKG_CHECK = 52

ConstantFREEZE_FS[src]

"freeze" all fs operations

Source Code

Source code
pub const FREEZE_FS = 53

ConstantTHAW_FS[src]

"thaw" all fs operations

Source Code

Source code
pub const THAW_FS = 54

ConstantGLOBAL_NOCACHE[src]

turn data caching off/on (globally) for this file

Source Code

Source code
pub const GLOBAL_NOCACHE = 55

ConstantADDSIGS[src]

add detached signatures

Source Code

Source code
pub const ADDSIGS = 59

ConstantADDFILESIGS[src]

add signature from same file (used by dyld for shared libs)

Source Code

Source code
pub const ADDFILESIGS = 61

ConstantNODIRECT[src]

used in conjunction with F.NOCACHE to indicate that DIRECT, synchronous writes should not be used (i.e. its ok to temporarily create cached pages)

Source Code

Source code
pub const NODIRECT = 62

ConstantGETPROTECTIONCLASS[src]

Get the protection class of a file from the EA, returns int

Source Code

Source code
pub const GETPROTECTIONCLASS = 63

ConstantSETPROTECTIONCLASS[src]

Set the protection class of a file for the EA, requires int

Source Code

Source code
pub const SETPROTECTIONCLASS = 64

ConstantLOG2PHYS_EXT[src]

file offset to device offset, extended

Source Code

Source code
pub const LOG2PHYS_EXT = 65

ConstantGETLKPID[src]

get record locking information, per-process

Source Code

Source code
pub const GETLKPID = 66

ConstantSETBACKINGSTORE[src]

Mark the file as being the backing store for another filesystem

Source Code

Source code
pub const SETBACKINGSTORE = 70

ConstantGETPATH_MTMINFO[src]

return the full path of the FD, but error in specific mtmd circumstances

Source Code

Source code
pub const GETPATH_MTMINFO = 71

ConstantGETCODEDIR[src]

Returns the code directory, with associated hashes, to the caller

Source Code

Source code
pub const GETCODEDIR = 72

ConstantSETNOSIGPIPE[src]

No SIGPIPE generated on EPIPE

Source Code

Source code
pub const SETNOSIGPIPE = 73

ConstantGETNOSIGPIPE[src]

Status of SIGPIPE for this fd

Source Code

Source code
pub const GETNOSIGPIPE = 74

ConstantTRANSCODEKEY[src]

For some cases, we need to rewrap the key for AKS/MKB

Source Code

Source code
pub const TRANSCODEKEY = 75

ConstantSINGLE_WRITER[src]

file being written to a by single writer... if throttling enabled, writes may be broken into smaller chunks with throttling in between

Source Code

Source code
pub const SINGLE_WRITER = 76

ConstantGETPROTECTIONLEVEL[src]

Get the protection version number for this filesystem

Source Code

Source code
pub const GETPROTECTIONLEVEL = 77

ConstantFINDSIGS[src]

Add detached code signatures (used by dyld for shared libs)

Source Code

Source code
pub const FINDSIGS = 78

ConstantADDFILESIGS_FOR_DYLD_SIM[src]

Add signature from same file, only if it is signed by Apple (used by dyld for simulator)

Source Code

Source code
pub const ADDFILESIGS_FOR_DYLD_SIM = 83

ConstantBARRIERFSYNC[src]

fsync + issue barrier to drive

Source Code

Source code
pub const BARRIERFSYNC = 85

ConstantADDFILESIGS_RETURN[src]

Add signature from same file, return end offset in structure on success

Source Code

Source code
pub const ADDFILESIGS_RETURN = 97

ConstantCHECK_LV[src]

Check if Library Validation allows this Mach-O file to be mapped into the calling process

Source Code

Source code
pub const CHECK_LV = 98

ConstantPUNCHHOLE[src]

Deallocate a range of the file

Source Code

Source code
pub const PUNCHHOLE = 99

ConstantTRIM_ACTIVE_FILE[src]

Trim an active file

Source Code

Source code
pub const TRIM_ACTIVE_FILE = 100

ConstantDUPFD_CLOEXEC[src]

mark the dup with FD_CLOEXEC

Source Code

Source code
pub const DUPFD_CLOEXEC = 67

ConstantRDLCK[src]

shared or read lock

Source Code

Source code
pub const RDLCK = 1

ConstantUNLCK[src]

unlock

Source Code

Source code
pub const UNLCK = 2

ConstantWRLCK[src]

exclusive or write lock

Source Code

Source code
pub const WRLCK = 3

ConstantDUPFD[src]

Duplicate file descriptor.

Source Code

Source code
pub const DUPFD = 0

ConstantGETFD[src]

Get file descriptor flags.

Source Code

Source code
pub const GETFD = 1

ConstantSETFD[src]

Set file descriptor flags.

Source Code

Source code
pub const SETFD = 2

ConstantGETFL[src]

Get file status flags.

Source Code

Source code
pub const GETFL = 3

ConstantSETFL[src]

Set file status flags.

Source Code

Source code
pub const SETFL = 4

ConstantGETOWN[src]

Get SIGIO/SIGURG proc/pgrrp.

Source Code

Source code
pub const GETOWN = 5

ConstantSETOWN[src]

Set SIGIO/SIGURG proc/pgrrp.

Source Code

Source code
pub const SETOWN = 6

ConstantGETLK[src]

Get record locking information.

Source Code

Source code
pub const GETLK = 11

ConstantSETLK[src]

Set record locking information.

Source Code

Source code
pub const SETLK = 12

ConstantSETLKW[src]

Set record locking information and wait if blocked.

Source Code

Source code
pub const SETLKW = 13

ConstantSETLK_REMOTE[src]

Debugging support for remote locks.

Source Code

Source code
pub const SETLK_REMOTE = 14

ConstantREADAHEAD[src]

Read ahead.

Source Code

Source code
pub const READAHEAD = 15

ConstantDUPFD_CLOEXEC[src]

DUPFD with FD_CLOEXEC set.

Source Code

Source code
pub const DUPFD_CLOEXEC = 17

ConstantDUP2FD_CLOEXEC[src]

DUP2FD with FD_CLOEXEC set.

Source Code

Source code
pub const DUP2FD_CLOEXEC = 18

ConstantADD_SEALS[src]

Source Code

Source code
pub const ADD_SEALS = 19

ConstantGET_SEALS[src]

Source Code

Source code
pub const GET_SEALS = 20

ConstantKINFO[src]

Return kinfo_file for a file descriptor.

Source Code

Source code
pub const KINFO = 22

ConstantSEAL_SEAL[src]

Prevent adding sealings.

Source Code

Source code
pub const SEAL_SEAL = 0x0001

ConstantSEAL_SHRINK[src]

May not shrink

Source Code

Source code
pub const SEAL_SHRINK = 0x0002

ConstantSEAL_GROW[src]

May not grow.

Source Code

Source code
pub const SEAL_GROW = 0x0004

ConstantSEAL_WRITE[src]

May not write.

Source Code

Source code
pub const SEAL_WRITE = 0x0008

ConstantRDLCK[src]

Shared or read lock.

Source Code

Source code
pub const RDLCK = 1

ConstantUNLCK[src]

Unlock.

Source Code

Source code
pub const UNLCK = 2

ConstantWRLCK[src]

Exclusive or write lock.

Source Code

Source code
pub const WRLCK = 3

ConstantUNLCKSYS[src]

Purge locks for a given system ID.

Source Code

Source code
pub const UNLCKSYS = 4

ConstantCANCEL[src]

Cancel an async lock request.

Source Code

Source code
pub const CANCEL = 5

ConstantSETOWN_EX[src]

Source Code

Source code
pub const SETOWN_EX = 15

ConstantGETOWN_EX[src]

Source Code

Source code
pub const GETOWN_EX = 16

ConstantGETOWNER_UIDS[src]

Source Code

Source code
pub const GETOWNER_UIDS = 17

ConstantULOCK[src]

Unlock a previously locked region

Source Code

Source code
pub const ULOCK = 0

ConstantLOCK[src]

Lock a region for exclusive use

Source Code

Source code
pub const LOCK = 1

ConstantTLOCK[src]

Test and lock a region for exclusive use

Source Code

Source code
pub const TLOCK = 2

ConstantTEST[src]

Test a region for other processes locks

Source Code

Source code
pub const TEST = 3

ConstantDUPFD[src]

Duplicate fildes

Source Code

Source code
pub const DUPFD = 0

ConstantGETFD[src]

Get fildes flags

Source Code

Source code
pub const GETFD = 1

ConstantSETFD[src]

Set fildes flags

Source Code

Source code
pub const SETFD = 2

ConstantGETFL[src]

Get file flags

Source Code

Source code
pub const GETFL = 3

ConstantGETXFL[src]

Get file flags including open-only flags

Source Code

Source code
pub const GETXFL = 45

ConstantSETFL[src]

Set file flags

Source Code

Source code
pub const SETFL = 4

ConstantCHKFL[src]

Unused

Source Code

Source code
pub const CHKFL = 8

ConstantDUP2FD[src]

Duplicate fildes at third arg

Source Code

Source code
pub const DUP2FD = 9

ConstantDUP2FD_CLOEXEC[src]

Like DUP2FD with O_CLOEXEC set EINVAL is fildes matches arg1

Source Code

Source code
pub const DUP2FD_CLOEXEC = 36

ConstantDUPFD_CLOEXEC[src]

Like DUPFD with O_CLOEXEC set

Source Code

Source code
pub const DUPFD_CLOEXEC = 37

ConstantISSTREAM[src]

Is the file desc. a stream ?

Source Code

Source code
pub const ISSTREAM = 13

ConstantPRIV[src]

Turn on private access to file

Source Code

Source code
pub const PRIV = 15

ConstantNPRIV[src]

Turn off private access to file

Source Code

Source code
pub const NPRIV = 16

ConstantQUOTACTL[src]

UFS quota call

Source Code

Source code
pub const QUOTACTL = 17

ConstantBLOCKS[src]

Get number of BLKSIZE blocks allocated

Source Code

Source code
pub const BLOCKS = 18

ConstantBLKSIZE[src]

Get optimal I/O block size

Source Code

Source code
pub const BLKSIZE = 19

ConstantGETOWN[src]

Get owner (socket emulation)

Source Code

Source code
pub const GETOWN = 23

ConstantSETOWN[src]

Set owner (socket emulation)

Source Code

Source code
pub const SETOWN = 24

ConstantREVOKE[src]

Object reuse revoke access to file desc.

Source Code

Source code
pub const REVOKE = 25

ConstantHASREMOTELOCKS[src]

Does vp have NFS locks private to lock manager

Source Code

Source code
pub const HASREMOTELOCKS = 26

ConstantSETLK[src]

Set file lock

Source Code

Source code
pub const SETLK = 6

ConstantSETLKW[src]

Set file lock and wait

Source Code

Source code
pub const SETLKW = 7

ConstantALLOCSP[src]

Allocate file space

Source Code

Source code
pub const ALLOCSP = 10

ConstantFREESP[src]

Free file space

Source Code

Source code
pub const FREESP = 11

ConstantGETLK[src]

Get file lock

Source Code

Source code
pub const GETLK = 14

ConstantOFD_GETLK[src]

Get file lock owned by file

Source Code

Source code
pub const OFD_GETLK = 47

ConstantOFD_SETLK[src]

Set file lock owned by file

Source Code

Source code
pub const OFD_SETLK = 48

ConstantOFD_SETLKW[src]

Set file lock owned by file and wait

Source Code

Source code
pub const OFD_SETLKW = 49

ConstantSHARE[src]

Set a file share reservation

Source Code

Source code
pub const SHARE = 40

ConstantUNSHARE[src]

Remove a file share reservation

Source Code

Source code
pub const UNSHARE = 41

ConstantBADFD[src]

Create Poison FD

Source Code

Source code
pub const BADFD = 46

ConstantRDLCK[src]

Read lock

Source Code

Source code
pub const RDLCK = 1

ConstantWRLCK[src]

Write lock

Source Code

Source code
pub const WRLCK = 2

ConstantUNLCK[src]

Remove lock(s)

Source Code

Source code
pub const UNLCK = 3

ConstantUNLKSYS[src]

remove remote locks for a given system

Source Code

Source code
pub const UNLKSYS = 4

ConstantRDACC[src]

Read-only share access

Source Code

Source code
pub const RDACC = 0x1

ConstantWRACC[src]

Write-only share access

Source Code

Source code
pub const WRACC = 0x2

ConstantRWACC[src]

Read-Write share access

Source Code

Source code
pub const RWACC = 0x3

ConstantNODNY[src]

Don't deny others access

Source Code

Source code
pub const NODNY = 0x0

ConstantRDDNY[src]

Deny others read share access

Source Code

Source code
pub const RDDNY = 0x1

ConstantWRDNY[src]

Deny others write share access

Source Code

Source code
pub const WRDNY = 0x2

ConstantRWDNY[src]

Deny others read or write share access

Source Code

Source code
pub const RWDNY = 0x3

ConstantRMDNY[src]

private flag: Deny delete share access

Source Code

Source code
pub const RMDNY = 0x4

ConstantDUPFD[src]

Source Code

Source code
pub const DUPFD = 0

ConstantGETFD[src]

Source Code

Source code
pub const GETFD = 1

ConstantSETFD[src]

Source Code

Source code
pub const SETFD = 2

ConstantGETFL[src]

Source Code

Source code
pub const GETFL = 3

ConstantSETFL[src]

Source Code

Source code
pub const SETFL = 4

ConstantGETOWN[src]

Source Code

Source code
pub const GETOWN = 5

ConstantSETOWN[src]

Source Code

Source code
pub const SETOWN = 6

ConstantGETLK[src]

Source Code

Source code
pub const GETLK = 7

ConstantSETLK[src]

Source Code

Source code
pub const SETLK = 8

ConstantSETLKW[src]

Source Code

Source code
pub const SETLKW = 9

ConstantCLOSEM[src]

Source Code

Source code
pub const CLOSEM = 10

ConstantMAXFD[src]

Source Code

Source code
pub const MAXFD = 11

ConstantDUPFD_CLOEXEC[src]

Source Code

Source code
pub const DUPFD_CLOEXEC = 12

ConstantGETNOSIGPIPE[src]

Source Code

Source code
pub const GETNOSIGPIPE = 13

ConstantSETNOSIGPIPE[src]

Source Code

Source code
pub const SETNOSIGPIPE = 14

ConstantGETPATH[src]

Source Code

Source code
pub const GETPATH = 15

ConstantRDLCK[src]

Source Code

Source code
pub const RDLCK = 1

ConstantWRLCK[src]

Source Code

Source code
pub const WRLCK = 3

ConstantUNLCK[src]

Source Code

Source code
pub const UNLCK = 2

ConstantULOCK[src]

Source Code

Source code
pub const ULOCK = 0

ConstantLOCK[src]

Source Code

Source code
pub const LOCK = 1

ConstantTLOCK[src]

Source Code

Source code
pub const TLOCK = 2

ConstantTEST[src]

Source Code

Source code
pub const TEST = 3

ConstantDUPFD[src]

Source Code

Source code
pub const DUPFD = 0

ConstantGETFD[src]

Source Code

Source code
pub const GETFD = 1

ConstantRDLCK[src]

Source Code

Source code
pub const RDLCK = 1

ConstantSETFD[src]

Source Code

Source code
pub const SETFD = 2

ConstantUNLCK[src]

Source Code

Source code
pub const UNLCK = 2

ConstantWRLCK[src]

Source Code

Source code
pub const WRLCK = 3

ConstantGETFL[src]

Source Code

Source code
pub const GETFL = 3

ConstantSETFL[src]

Source Code

Source code
pub const SETFL = 4

ConstantGETOWN[src]

Source Code

Source code
pub const GETOWN = 5

ConstantSETOWN[src]

Source Code

Source code
pub const SETOWN = 6

ConstantGETLK[src]

Source Code

Source code
pub const GETLK = 7

ConstantSETLK[src]

Source Code

Source code
pub const SETLK = 8

ConstantSETLKW[src]

Source Code

Source code
pub const SETLKW = 9

ConstantDUP2FD[src]

Source Code

Source code
pub const DUP2FD = 10

ConstantDUPFD_CLOEXEC[src]

Source Code

Source code
pub const DUPFD_CLOEXEC = 17

ConstantDUP2FD_CLOEXEC[src]

Source Code

Source code
pub const DUP2FD_CLOEXEC = 18

ConstantGETPATH[src]

Source Code

Source code
pub const GETPATH = 19

ConstantDUPFD[src]

Source Code

Source code
pub const DUPFD = 0x0001

ConstantGETFD[src]

Source Code

Source code
pub const GETFD = 0x0002

ConstantSETFD[src]

Source Code

Source code
pub const SETFD = 0x0004

ConstantGETFL[src]

Source Code

Source code
pub const GETFL = 0x0008

ConstantSETFL[src]

Source Code

Source code
pub const SETFL = 0x0010

ConstantGETLK[src]

Source Code

Source code
pub const GETLK = 0x0020

ConstantSETLK[src]

Source Code

Source code
pub const SETLK = 0x0080

ConstantSETLKW[src]

Source Code

Source code
pub const SETLKW = 0x0100

ConstantDUPFD_CLOEXEC[src]

Source Code

Source code
pub const DUPFD_CLOEXEC = 0x0200

ConstantRDLCK[src]

Source Code

Source code
pub const RDLCK = 0x0040

ConstantUNLCK[src]

Source Code

Source code
pub const UNLCK = 0x0200

ConstantWRLCK[src]

Source Code

Source code
pub const WRLCK = 0x0400

ConstantDUPFD[src]

Source Code

Source code
pub const DUPFD = 0

ConstantGETFD[src]

Source Code

Source code
pub const GETFD = 1

ConstantSETFD[src]

Source Code

Source code
pub const SETFD = 2

ConstantGETFL[src]

Source Code

Source code
pub const GETFL = 3

ConstantSETFL[src]

Source Code

Source code
pub const SETFL = 4

ConstantGETOWN[src]

Source Code

Source code
pub const GETOWN = 5

ConstantSETOWN[src]

Source Code

Source code
pub const SETOWN = 6

ConstantGETLK[src]

Source Code

Source code
pub const GETLK = 7

ConstantSETLK[src]

Source Code

Source code
pub const SETLK = 8

ConstantSETLKW[src]

Source Code

Source code
pub const SETLKW = 9

ConstantRDLCK[src]

Source Code

Source code
pub const RDLCK = 1

ConstantUNLCK[src]

Source Code

Source code
pub const UNLCK = 2

ConstantWRLCK[src]

Source Code

Source code
pub const WRLCK = 3

Source Code

Source code
pub const F = switch (native_os) {
    .linux => linux.F,
    .emscripten => emscripten.F,
    .wasi => struct {
        // Match `F_*` constants from lib/libc/include/wasm-wasi-musl/__header_fcntl.h
        pub const GETFD = 1;
        pub const SETFD = 2;
        pub const GETFL = 3;
        pub const SETFL = 4;
    },
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        /// duplicate file descriptor
        pub const DUPFD = 0;
        /// get file descriptor flags
        pub const GETFD = 1;
        /// set file descriptor flags
        pub const SETFD = 2;
        /// get file status flags
        pub const GETFL = 3;
        /// set file status flags
        pub const SETFL = 4;
        /// get SIGIO/SIGURG proc/pgrp
        pub const GETOWN = 5;
        /// set SIGIO/SIGURG proc/pgrp
        pub const SETOWN = 6;
        /// get record locking information
        pub const GETLK = 7;
        /// set record locking information
        pub const SETLK = 8;
        /// F.SETLK; wait if blocked
        pub const SETLKW = 9;
        /// F.SETLK; wait if blocked, return on timeout
        pub const SETLKWTIMEOUT = 10;
        pub const FLUSH_DATA = 40;
        /// Used for regression test
        pub const CHKCLEAN = 41;
        /// Preallocate storage
        pub const PREALLOCATE = 42;
        /// Truncate a file without zeroing space
        pub const SETSIZE = 43;
        /// Issue an advisory read async with no copy to user
        pub const RDADVISE = 44;
        /// turn read ahead off/on for this fd
        pub const RDAHEAD = 45;
        /// turn data caching off/on for this fd
        pub const NOCACHE = 48;
        /// file offset to device offset
        pub const LOG2PHYS = 49;
        /// return the full path of the fd
        pub const GETPATH = 50;
        /// fsync + ask the drive to flush to the media
        pub const FULLFSYNC = 51;
        /// find which component (if any) is a package
        pub const PATHPKG_CHECK = 52;
        /// "freeze" all fs operations
        pub const FREEZE_FS = 53;
        /// "thaw" all fs operations
        pub const THAW_FS = 54;
        /// turn data caching off/on (globally) for this file
        pub const GLOBAL_NOCACHE = 55;
        /// add detached signatures
        pub const ADDSIGS = 59;
        /// add signature from same file (used by dyld for shared libs)
        pub const ADDFILESIGS = 61;
        /// used in conjunction with F.NOCACHE to indicate that DIRECT, synchronous writes
        /// should not be used (i.e. its ok to temporarily create cached pages)
        pub const NODIRECT = 62;
        /// Get the protection class of a file from the EA, returns int
        pub const GETPROTECTIONCLASS = 63;
        /// Set the protection class of a file for the EA, requires int
        pub const SETPROTECTIONCLASS = 64;
        /// file offset to device offset, extended
        pub const LOG2PHYS_EXT = 65;
        /// get record locking information, per-process
        pub const GETLKPID = 66;
        /// Mark the file as being the backing store for another filesystem
        pub const SETBACKINGSTORE = 70;
        /// return the full path of the FD, but error in specific mtmd circumstances
        pub const GETPATH_MTMINFO = 71;
        /// Returns the code directory, with associated hashes, to the caller
        pub const GETCODEDIR = 72;
        /// No SIGPIPE generated on EPIPE
        pub const SETNOSIGPIPE = 73;
        /// Status of SIGPIPE for this fd
        pub const GETNOSIGPIPE = 74;
        /// For some cases, we need to rewrap the key for AKS/MKB
        pub const TRANSCODEKEY = 75;
        /// file being written to a by single writer... if throttling enabled, writes
        /// may be broken into smaller chunks with throttling in between
        pub const SINGLE_WRITER = 76;
        /// Get the protection version number for this filesystem
        pub const GETPROTECTIONLEVEL = 77;
        /// Add detached code signatures (used by dyld for shared libs)
        pub const FINDSIGS = 78;
        /// Add signature from same file, only if it is signed by Apple (used by dyld for simulator)
        pub const ADDFILESIGS_FOR_DYLD_SIM = 83;
        /// fsync + issue barrier to drive
        pub const BARRIERFSYNC = 85;
        /// Add signature from same file, return end offset in structure on success
        pub const ADDFILESIGS_RETURN = 97;
        /// Check if Library Validation allows this Mach-O file to be mapped into the calling process
        pub const CHECK_LV = 98;
        /// Deallocate a range of the file
        pub const PUNCHHOLE = 99;
        /// Trim an active file
        pub const TRIM_ACTIVE_FILE = 100;
        /// mark the dup with FD_CLOEXEC
        pub const DUPFD_CLOEXEC = 67;
        /// shared or read lock
        pub const RDLCK = 1;
        /// unlock
        pub const UNLCK = 2;
        /// exclusive or write lock
        pub const WRLCK = 3;
    },
    .freebsd => struct {
        /// Duplicate file descriptor.
        pub const DUPFD = 0;
        /// Get file descriptor flags.
        pub const GETFD = 1;
        /// Set file descriptor flags.
        pub const SETFD = 2;
        /// Get file status flags.
        pub const GETFL = 3;
        /// Set file status flags.
        pub const SETFL = 4;

        /// Get SIGIO/SIGURG proc/pgrrp.
        pub const GETOWN = 5;
        /// Set SIGIO/SIGURG proc/pgrrp.
        pub const SETOWN = 6;

        /// Get record locking information.
        pub const GETLK = 11;
        /// Set record locking information.
        pub const SETLK = 12;
        /// Set record locking information and wait if blocked.
        pub const SETLKW = 13;

        /// Debugging support for remote locks.
        pub const SETLK_REMOTE = 14;
        /// Read ahead.
        pub const READAHEAD = 15;

        /// DUPFD with FD_CLOEXEC set.
        pub const DUPFD_CLOEXEC = 17;
        /// DUP2FD with FD_CLOEXEC set.
        pub const DUP2FD_CLOEXEC = 18;

        pub const ADD_SEALS = 19;
        pub const GET_SEALS = 20;
        /// Return `kinfo_file` for a file descriptor.
        pub const KINFO = 22;

        // Seals (ADD_SEALS, GET_SEALS)
        /// Prevent adding sealings.
        pub const SEAL_SEAL = 0x0001;
        /// May not shrink
        pub const SEAL_SHRINK = 0x0002;
        /// May not grow.
        pub const SEAL_GROW = 0x0004;
        /// May not write.
        pub const SEAL_WRITE = 0x0008;

        // Record locking flags (GETLK, SETLK, SETLKW).
        /// Shared or read lock.
        pub const RDLCK = 1;
        /// Unlock.
        pub const UNLCK = 2;
        /// Exclusive or write lock.
        pub const WRLCK = 3;
        /// Purge locks for a given system ID.
        pub const UNLCKSYS = 4;
        /// Cancel an async lock request.
        pub const CANCEL = 5;

        pub const SETOWN_EX = 15;
        pub const GETOWN_EX = 16;

        pub const GETOWNER_UIDS = 17;
    },
    .solaris, .illumos => struct {
        /// Unlock a previously locked region
        pub const ULOCK = 0;
        /// Lock a region for exclusive use
        pub const LOCK = 1;
        /// Test and lock a region for exclusive use
        pub const TLOCK = 2;
        /// Test a region for other processes locks
        pub const TEST = 3;

        /// Duplicate fildes
        pub const DUPFD = 0;
        /// Get fildes flags
        pub const GETFD = 1;
        /// Set fildes flags
        pub const SETFD = 2;
        /// Get file flags
        pub const GETFL = 3;
        /// Get file flags including open-only flags
        pub const GETXFL = 45;
        /// Set file flags
        pub const SETFL = 4;

        /// Unused
        pub const CHKFL = 8;
        /// Duplicate fildes at third arg
        pub const DUP2FD = 9;
        /// Like DUP2FD with O_CLOEXEC set EINVAL is fildes matches arg1
        pub const DUP2FD_CLOEXEC = 36;
        /// Like DUPFD with O_CLOEXEC set
        pub const DUPFD_CLOEXEC = 37;

        /// Is the file desc. a stream ?
        pub const ISSTREAM = 13;
        /// Turn on private access to file
        pub const PRIV = 15;
        /// Turn off private access to file
        pub const NPRIV = 16;
        /// UFS quota call
        pub const QUOTACTL = 17;
        /// Get number of BLKSIZE blocks allocated
        pub const BLOCKS = 18;
        /// Get optimal I/O block size
        pub const BLKSIZE = 19;
        /// Get owner (socket emulation)
        pub const GETOWN = 23;
        /// Set owner (socket emulation)
        pub const SETOWN = 24;
        /// Object reuse revoke access to file desc.
        pub const REVOKE = 25;
        /// Does vp have NFS locks private to lock manager
        pub const HASREMOTELOCKS = 26;

        /// Set file lock
        pub const SETLK = 6;
        /// Set file lock and wait
        pub const SETLKW = 7;
        /// Allocate file space
        pub const ALLOCSP = 10;
        /// Free file space
        pub const FREESP = 11;
        /// Get file lock
        pub const GETLK = 14;
        /// Get file lock owned by file
        pub const OFD_GETLK = 47;
        /// Set file lock owned by file
        pub const OFD_SETLK = 48;
        /// Set file lock owned by file and wait
        pub const OFD_SETLKW = 49;
        /// Set a file share reservation
        pub const SHARE = 40;
        /// Remove a file share reservation
        pub const UNSHARE = 41;
        /// Create Poison FD
        pub const BADFD = 46;

        /// Read lock
        pub const RDLCK = 1;
        /// Write lock
        pub const WRLCK = 2;
        /// Remove lock(s)
        pub const UNLCK = 3;
        /// remove remote locks for a given system
        pub const UNLKSYS = 4;

        // f_access values
        /// Read-only share access
        pub const RDACC = 0x1;
        /// Write-only share access
        pub const WRACC = 0x2;
        /// Read-Write share access
        pub const RWACC = 0x3;

        // f_deny values
        /// Don't deny others access
        pub const NODNY = 0x0;
        /// Deny others read share access
        pub const RDDNY = 0x1;
        /// Deny others write share access
        pub const WRDNY = 0x2;
        /// Deny others read or write share access
        pub const RWDNY = 0x3;
        /// private flag: Deny delete share access
        pub const RMDNY = 0x4;
    },
    .netbsd => struct {
        pub const DUPFD = 0;
        pub const GETFD = 1;
        pub const SETFD = 2;
        pub const GETFL = 3;
        pub const SETFL = 4;
        pub const GETOWN = 5;
        pub const SETOWN = 6;
        pub const GETLK = 7;
        pub const SETLK = 8;
        pub const SETLKW = 9;
        pub const CLOSEM = 10;
        pub const MAXFD = 11;
        pub const DUPFD_CLOEXEC = 12;
        pub const GETNOSIGPIPE = 13;
        pub const SETNOSIGPIPE = 14;
        pub const GETPATH = 15;

        pub const RDLCK = 1;
        pub const WRLCK = 3;
        pub const UNLCK = 2;
    },
    .dragonfly => struct {
        pub const ULOCK = 0;
        pub const LOCK = 1;
        pub const TLOCK = 2;
        pub const TEST = 3;

        pub const DUPFD = 0;
        pub const GETFD = 1;
        pub const RDLCK = 1;
        pub const SETFD = 2;
        pub const UNLCK = 2;
        pub const WRLCK = 3;
        pub const GETFL = 3;
        pub const SETFL = 4;
        pub const GETOWN = 5;
        pub const SETOWN = 6;
        pub const GETLK = 7;
        pub const SETLK = 8;
        pub const SETLKW = 9;
        pub const DUP2FD = 10;
        pub const DUPFD_CLOEXEC = 17;
        pub const DUP2FD_CLOEXEC = 18;
        pub const GETPATH = 19;
    },
    .haiku => struct {
        pub const DUPFD = 0x0001;
        pub const GETFD = 0x0002;
        pub const SETFD = 0x0004;
        pub const GETFL = 0x0008;
        pub const SETFL = 0x0010;

        pub const GETLK = 0x0020;
        pub const SETLK = 0x0080;
        pub const SETLKW = 0x0100;
        pub const DUPFD_CLOEXEC = 0x0200;

        pub const RDLCK = 0x0040;
        pub const UNLCK = 0x0200;
        pub const WRLCK = 0x0400;
    },
    .openbsd => struct {
        pub const DUPFD = 0;
        pub const GETFD = 1;
        pub const SETFD = 2;
        pub const GETFL = 3;
        pub const SETFL = 4;

        pub const GETOWN = 5;
        pub const SETOWN = 6;

        pub const GETLK = 7;
        pub const SETLK = 8;
        pub const SETLKW = 9;

        pub const RDLCK = 1;
        pub const UNLCK = 2;
        pub const WRLCK = 3;
    },
    else => void,
}

TypeFlock[src]

Source Code

Source code
pub const Flock = switch (native_os) {
    .linux => linux.Flock,
    .emscripten => emscripten.Flock,
    .openbsd, .dragonfly, .netbsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        start: off_t,
        len: off_t,
        pid: pid_t,
        type: i16,
        whence: i16,
    },
    .freebsd => extern struct {
        /// Starting offset.
        start: off_t,
        /// Number of consecutive bytes to be locked.
        /// A value of 0 means to the end of the file.
        len: off_t,
        /// Lock owner.
        pid: pid_t,
        /// Lock type.
        type: i16,
        /// Type of the start member.
        whence: i16,
        /// Remote system id or zero for local.
        sysid: i32,
    },
    .solaris, .illumos => extern struct {
        type: c_short,
        whence: c_short,
        start: off_t,
        // len == 0 means until end of file.
        len: off_t,
        sysid: c_int,
        pid: pid_t,
        __pad: [4]c_long,
    },
    .haiku => extern struct {
        type: i16,
        whence: i16,
        start: off_t,
        len: off_t,
        pid: pid_t,
    },
    else => void,
}

TypeCTL[src]

Values

ConstantKERN[src]

Source Code

Source code
pub const KERN = 1

ConstantDEBUG[src]

Source Code

Source code
pub const DEBUG = 5

ConstantKERN[src]

Source Code

Source code
pub const KERN = 1

ConstantDEBUG[src]

Source Code

Source code
pub const DEBUG = 5

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = 0

ConstantKERN[src]

Source Code

Source code
pub const KERN = 1

ConstantVM[src]

Source Code

Source code
pub const VM = 2

ConstantVFS[src]

Source Code

Source code
pub const VFS = 3

ConstantNET[src]

Source Code

Source code
pub const NET = 4

ConstantDEBUG[src]

Source Code

Source code
pub const DEBUG = 5

ConstantHW[src]

Source Code

Source code
pub const HW = 6

ConstantMACHDEP[src]

Source Code

Source code
pub const MACHDEP = 7

ConstantUSER[src]

Source Code

Source code
pub const USER = 8

ConstantLWKT[src]

Source Code

Source code
pub const LWKT = 10

ConstantMAXID[src]

Source Code

Source code
pub const MAXID = 11

ConstantMAXNAME[src]

Source Code

Source code
pub const MAXNAME = 12

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = 0

ConstantKERN[src]

Source Code

Source code
pub const KERN = 1

ConstantVM[src]

Source Code

Source code
pub const VM = 2

ConstantFS[src]

Source Code

Source code
pub const FS = 3

ConstantNET[src]

Source Code

Source code
pub const NET = 4

ConstantDEBUG[src]

Source Code

Source code
pub const DEBUG = 5

ConstantHW[src]

Source Code

Source code
pub const HW = 6

ConstantMACHDEP[src]

Source Code

Source code
pub const MACHDEP = 7

ConstantDDB[src]

Source Code

Source code
pub const DDB = 9

ConstantVFS[src]

Source Code

Source code
pub const VFS = 10

Source Code

Source code
pub const CTL = switch (native_os) {
    .freebsd => struct {
        pub const KERN = 1;
        pub const DEBUG = 5;
    },
    .netbsd => struct {
        pub const KERN = 1;
        pub const DEBUG = 5;
    },
    .dragonfly => struct {
        pub const UNSPEC = 0;
        pub const KERN = 1;
        pub const VM = 2;
        pub const VFS = 3;
        pub const NET = 4;
        pub const DEBUG = 5;
        pub const HW = 6;
        pub const MACHDEP = 7;
        pub const USER = 8;
        pub const LWKT = 10;
        pub const MAXID = 11;
        pub const MAXNAME = 12;
    },
    .openbsd => struct {
        pub const UNSPEC = 0;
        pub const KERN = 1;
        pub const VM = 2;
        pub const FS = 3;
        pub const NET = 4;
        pub const DEBUG = 5;
        pub const HW = 6;
        pub const MACHDEP = 7;

        pub const DDB = 9;
        pub const VFS = 10;
    },
    else => void,
}

TypeKERN[src]

Values

ConstantPROC[src]

struct: process entries

Source Code

Source code
pub const PROC = 14

ConstantPROC_PATHNAME[src]

path to executable

Source Code

Source code
pub const PROC_PATHNAME = 12

ConstantPROC_FILEDESC[src]

file descriptors for process

Source Code

Source code
pub const PROC_FILEDESC = 33

ConstantIOV_MAX[src]

Source Code

Source code
pub const IOV_MAX = 35

ConstantPROC_ARGS[src]

struct: process argv/env

Source Code

Source code
pub const PROC_ARGS = 48

ConstantPROC_PATHNAME[src]

path to executable

Source Code

Source code
pub const PROC_PATHNAME = 5

ConstantIOV_MAX[src]

Source Code

Source code
pub const IOV_MAX = 38

ConstantPROC_ALL[src]

Source Code

Source code
pub const PROC_ALL = 0

ConstantOSTYPE[src]

Source Code

Source code
pub const OSTYPE = 1

ConstantPROC_PID[src]

Source Code

Source code
pub const PROC_PID = 1

ConstantOSRELEASE[src]

Source Code

Source code
pub const OSRELEASE = 2

ConstantPROC_PGRP[src]

Source Code

Source code
pub const PROC_PGRP = 2

ConstantOSREV[src]

Source Code

Source code
pub const OSREV = 3

ConstantPROC_SESSION[src]

Source Code

Source code
pub const PROC_SESSION = 3

ConstantVERSION[src]

Source Code

Source code
pub const VERSION = 4

ConstantPROC_TTY[src]

Source Code

Source code
pub const PROC_TTY = 4

ConstantMAXVNODES[src]

Source Code

Source code
pub const MAXVNODES = 5

ConstantPROC_UID[src]

Source Code

Source code
pub const PROC_UID = 5

ConstantMAXPROC[src]

Source Code

Source code
pub const MAXPROC = 6

ConstantPROC_RUID[src]

Source Code

Source code
pub const PROC_RUID = 6

ConstantMAXFILES[src]

Source Code

Source code
pub const MAXFILES = 7

ConstantPROC_ARGS[src]

Source Code

Source code
pub const PROC_ARGS = 7

ConstantARGMAX[src]

Source Code

Source code
pub const ARGMAX = 8

ConstantPROC_CWD[src]

Source Code

Source code
pub const PROC_CWD = 8

ConstantPROC_PATHNAME[src]

Source Code

Source code
pub const PROC_PATHNAME = 9

ConstantSECURELVL[src]

Source Code

Source code
pub const SECURELVL = 9

ConstantPROC_SIGTRAMP[src]

Source Code

Source code
pub const PROC_SIGTRAMP = 10

ConstantHOSTNAME[src]

Source Code

Source code
pub const HOSTNAME = 10

ConstantHOSTID[src]

Source Code

Source code
pub const HOSTID = 11

ConstantCLOCKRATE[src]

Source Code

Source code
pub const CLOCKRATE = 12

ConstantVNODE[src]

Source Code

Source code
pub const VNODE = 13

ConstantPROC[src]

Source Code

Source code
pub const PROC = 14

ConstantFILE[src]

Source Code

Source code
pub const FILE = 15

ConstantPROC_FLAGMASK[src]

Source Code

Source code
pub const PROC_FLAGMASK = 16

ConstantPROF[src]

Source Code

Source code
pub const PROF = 16

ConstantPROC_FLAG_LWP[src]

Source Code

Source code
pub const PROC_FLAG_LWP = 16

ConstantPOSIX1[src]

Source Code

Source code
pub const POSIX1 = 17

ConstantNGROUPS[src]

Source Code

Source code
pub const NGROUPS = 18

ConstantJOB_CONTROL[src]

Source Code

Source code
pub const JOB_CONTROL = 19

ConstantSAVED_IDS[src]

Source Code

Source code
pub const SAVED_IDS = 20

ConstantBOOTTIME[src]

Source Code

Source code
pub const BOOTTIME = 21

ConstantNISDOMAINNAME[src]

Source Code

Source code
pub const NISDOMAINNAME = 22

ConstantUPDATEINTERVAL[src]

Source Code

Source code
pub const UPDATEINTERVAL = 23

ConstantOSRELDATE[src]

Source Code

Source code
pub const OSRELDATE = 24

ConstantNTP_PLL[src]

Source Code

Source code
pub const NTP_PLL = 25

ConstantBOOTFILE[src]

Source Code

Source code
pub const BOOTFILE = 26

ConstantMAXFILESPERPROC[src]

Source Code

Source code
pub const MAXFILESPERPROC = 27

ConstantMAXPROCPERUID[src]

Source Code

Source code
pub const MAXPROCPERUID = 28

ConstantDUMPDEV[src]

Source Code

Source code
pub const DUMPDEV = 29

ConstantIPC[src]

Source Code

Source code
pub const IPC = 30

ConstantDUMMY[src]

Source Code

Source code
pub const DUMMY = 31

ConstantPS_STRINGS[src]

Source Code

Source code
pub const PS_STRINGS = 32

ConstantUSRSTACK[src]

Source Code

Source code
pub const USRSTACK = 33

ConstantLOGSIGEXIT[src]

Source Code

Source code
pub const LOGSIGEXIT = 34

ConstantIOV_MAX[src]

Source Code

Source code
pub const IOV_MAX = 35

ConstantMAXPOSIXLOCKSPERUID[src]

Source Code

Source code
pub const MAXPOSIXLOCKSPERUID = 36

ConstantMAXID[src]

Source Code

Source code
pub const MAXID = 37

ConstantOSTYPE[src]

Source Code

Source code
pub const OSTYPE = 1

ConstantOSRELEASE[src]

Source Code

Source code
pub const OSRELEASE = 2

ConstantOSREV[src]

Source Code

Source code
pub const OSREV = 3

ConstantVERSION[src]

Source Code

Source code
pub const VERSION = 4

ConstantMAXVNODES[src]

Source Code

Source code
pub const MAXVNODES = 5

ConstantMAXPROC[src]

Source Code

Source code
pub const MAXPROC = 6

ConstantMAXFILES[src]

Source Code

Source code
pub const MAXFILES = 7

ConstantARGMAX[src]

Source Code

Source code
pub const ARGMAX = 8

ConstantSECURELVL[src]

Source Code

Source code
pub const SECURELVL = 9

ConstantHOSTNAME[src]

Source Code

Source code
pub const HOSTNAME = 10

ConstantHOSTID[src]

Source Code

Source code
pub const HOSTID = 11

ConstantCLOCKRATE[src]

Source Code

Source code
pub const CLOCKRATE = 12

ConstantPROF[src]

Source Code

Source code
pub const PROF = 16

ConstantPOSIX1[src]

Source Code

Source code
pub const POSIX1 = 17

ConstantNGROUPS[src]

Source Code

Source code
pub const NGROUPS = 18

ConstantJOB_CONTROL[src]

Source Code

Source code
pub const JOB_CONTROL = 19

ConstantSAVED_IDS[src]

Source Code

Source code
pub const SAVED_IDS = 20

ConstantBOOTTIME[src]

Source Code

Source code
pub const BOOTTIME = 21

ConstantDOMAINNAME[src]

Source Code

Source code
pub const DOMAINNAME = 22

ConstantMAXPARTITIONS[src]

Source Code

Source code
pub const MAXPARTITIONS = 23

ConstantRAWPARTITION[src]

Source Code

Source code
pub const RAWPARTITION = 24

ConstantMAXTHREAD[src]

Source Code

Source code
pub const MAXTHREAD = 25

ConstantNTHREADS[src]

Source Code

Source code
pub const NTHREADS = 26

ConstantOSVERSION[src]

Source Code

Source code
pub const OSVERSION = 27

ConstantSOMAXCONN[src]

Source Code

Source code
pub const SOMAXCONN = 28

ConstantSOMINCONN[src]

Source Code

Source code
pub const SOMINCONN = 29

ConstantNOSUIDCOREDUMP[src]

Source Code

Source code
pub const NOSUIDCOREDUMP = 32

ConstantFSYNC[src]

Source Code

Source code
pub const FSYNC = 33

ConstantSYSVMSG[src]

Source Code

Source code
pub const SYSVMSG = 34

ConstantSYSVSEM[src]

Source Code

Source code
pub const SYSVSEM = 35

ConstantSYSVSHM[src]

Source Code

Source code
pub const SYSVSHM = 36

ConstantMSGBUFSIZE[src]

Source Code

Source code
pub const MSGBUFSIZE = 38

ConstantMALLOCSTATS[src]

Source Code

Source code
pub const MALLOCSTATS = 39

ConstantCPTIME[src]

Source Code

Source code
pub const CPTIME = 40

ConstantNCHSTATS[src]

Source Code

Source code
pub const NCHSTATS = 41

ConstantFORKSTAT[src]

Source Code

Source code
pub const FORKSTAT = 42

ConstantNSELCOLL[src]

Source Code

Source code
pub const NSELCOLL = 43

ConstantTTY[src]

Source Code

Source code
pub const TTY = 44

ConstantCCPU[src]

Source Code

Source code
pub const CCPU = 45

ConstantFSCALE[src]

Source Code

Source code
pub const FSCALE = 46

ConstantNPROCS[src]

Source Code

Source code
pub const NPROCS = 47

ConstantMSGBUF[src]

Source Code

Source code
pub const MSGBUF = 48

ConstantPOOL[src]

Source Code

Source code
pub const POOL = 49

ConstantSTACKGAPRANDOM[src]

Source Code

Source code
pub const STACKGAPRANDOM = 50

ConstantSYSVIPC_INFO[src]

Source Code

Source code
pub const SYSVIPC_INFO = 51

ConstantALLOWKMEM[src]

Source Code

Source code
pub const ALLOWKMEM = 52

ConstantWITNESSWATCH[src]

Source Code

Source code
pub const WITNESSWATCH = 53

ConstantSPLASSERT[src]

Source Code

Source code
pub const SPLASSERT = 54

ConstantPROC_ARGS[src]

Source Code

Source code
pub const PROC_ARGS = 55

ConstantNFILES[src]

Source Code

Source code
pub const NFILES = 56

ConstantTTYCOUNT[src]

Source Code

Source code
pub const TTYCOUNT = 57

ConstantNUMVNODES[src]

Source Code

Source code
pub const NUMVNODES = 58

ConstantMBSTAT[src]

Source Code

Source code
pub const MBSTAT = 59

ConstantWITNESS[src]

Source Code

Source code
pub const WITNESS = 60

ConstantSEMINFO[src]

Source Code

Source code
pub const SEMINFO = 61

ConstantSHMINFO[src]

Source Code

Source code
pub const SHMINFO = 62

ConstantINTRCNT[src]

Source Code

Source code
pub const INTRCNT = 63

ConstantWATCHDOG[src]

Source Code

Source code
pub const WATCHDOG = 64

ConstantALLOWDT[src]

Source Code

Source code
pub const ALLOWDT = 65

ConstantPROC[src]

Source Code

Source code
pub const PROC = 66

ConstantMAXCLUSTERS[src]

Source Code

Source code
pub const MAXCLUSTERS = 67

ConstantEVCOUNT[src]

Source Code

Source code
pub const EVCOUNT = 68

ConstantTIMECOUNTER[src]

Source Code

Source code
pub const TIMECOUNTER = 69

ConstantMAXLOCKSPERUID[src]

Source Code

Source code
pub const MAXLOCKSPERUID = 70

ConstantCPTIME2[src]

Source Code

Source code
pub const CPTIME2 = 71

ConstantCACHEPCT[src]

Source Code

Source code
pub const CACHEPCT = 72

ConstantFILE[src]

Source Code

Source code
pub const FILE = 73

ConstantWXABORT[src]

Source Code

Source code
pub const WXABORT = 74

ConstantCONSDEV[src]

Source Code

Source code
pub const CONSDEV = 75

ConstantNETLIVELOCKS[src]

Source Code

Source code
pub const NETLIVELOCKS = 76

ConstantPOOL_DEBUG[src]

Source Code

Source code
pub const POOL_DEBUG = 77

ConstantPROC_CWD[src]

Source Code

Source code
pub const PROC_CWD = 78

ConstantPROC_NOBROADCASTKILL[src]

Source Code

Source code
pub const PROC_NOBROADCASTKILL = 79

ConstantPROC_VMMAP[src]

Source Code

Source code
pub const PROC_VMMAP = 80

ConstantGLOBAL_PTRACE[src]

Source Code

Source code
pub const GLOBAL_PTRACE = 81

ConstantCONSBUFSIZE[src]

Source Code

Source code
pub const CONSBUFSIZE = 82

ConstantCONSBUF[src]

Source Code

Source code
pub const CONSBUF = 83

ConstantAUDIO[src]

Source Code

Source code
pub const AUDIO = 84

ConstantCPUSTATS[src]

Source Code

Source code
pub const CPUSTATS = 85

ConstantPFSTATUS[src]

Source Code

Source code
pub const PFSTATUS = 86

ConstantTIMEOUT_STATS[src]

Source Code

Source code
pub const TIMEOUT_STATS = 87

ConstantUTC_OFFSET[src]

Source Code

Source code
pub const UTC_OFFSET = 88

ConstantVIDEO[src]

Source Code

Source code
pub const VIDEO = 89

ConstantPROC_ALL[src]

Source Code

Source code
pub const PROC_ALL = 0

ConstantPROC_PID[src]

Source Code

Source code
pub const PROC_PID = 1

ConstantPROC_PGRP[src]

Source Code

Source code
pub const PROC_PGRP = 2

ConstantPROC_SESSION[src]

Source Code

Source code
pub const PROC_SESSION = 3

ConstantPROC_TTY[src]

Source Code

Source code
pub const PROC_TTY = 4

ConstantPROC_UID[src]

Source Code

Source code
pub const PROC_UID = 5

ConstantPROC_RUID[src]

Source Code

Source code
pub const PROC_RUID = 6

ConstantPROC_KTHREAD[src]

Source Code

Source code
pub const PROC_KTHREAD = 7

ConstantPROC_SHOW_THREADS[src]

Source Code

Source code
pub const PROC_SHOW_THREADS = 0x40000000

ConstantPROC_ARGV[src]

Source Code

Source code
pub const PROC_ARGV = 1

ConstantPROC_NARGV[src]

Source Code

Source code
pub const PROC_NARGV = 2

ConstantPROC_ENV[src]

Source Code

Source code
pub const PROC_ENV = 3

ConstantPROC_NENV[src]

Source Code

Source code
pub const PROC_NENV = 4

Source Code

Source code
pub const KERN = switch (native_os) {
    .freebsd => struct {
        /// struct: process entries
        pub const PROC = 14;
        /// path to executable
        pub const PROC_PATHNAME = 12;
        /// file descriptors for process
        pub const PROC_FILEDESC = 33;
        pub const IOV_MAX = 35;
    },
    .netbsd => struct {
        /// struct: process argv/env
        pub const PROC_ARGS = 48;
        /// path to executable
        pub const PROC_PATHNAME = 5;
        pub const IOV_MAX = 38;
    },
    .dragonfly => struct {
        pub const PROC_ALL = 0;
        pub const OSTYPE = 1;
        pub const PROC_PID = 1;
        pub const OSRELEASE = 2;
        pub const PROC_PGRP = 2;
        pub const OSREV = 3;
        pub const PROC_SESSION = 3;
        pub const VERSION = 4;
        pub const PROC_TTY = 4;
        pub const MAXVNODES = 5;
        pub const PROC_UID = 5;
        pub const MAXPROC = 6;
        pub const PROC_RUID = 6;
        pub const MAXFILES = 7;
        pub const PROC_ARGS = 7;
        pub const ARGMAX = 8;
        pub const PROC_CWD = 8;
        pub const PROC_PATHNAME = 9;
        pub const SECURELVL = 9;
        pub const PROC_SIGTRAMP = 10;
        pub const HOSTNAME = 10;
        pub const HOSTID = 11;
        pub const CLOCKRATE = 12;
        pub const VNODE = 13;
        pub const PROC = 14;
        pub const FILE = 15;
        pub const PROC_FLAGMASK = 16;
        pub const PROF = 16;
        pub const PROC_FLAG_LWP = 16;
        pub const POSIX1 = 17;
        pub const NGROUPS = 18;
        pub const JOB_CONTROL = 19;
        pub const SAVED_IDS = 20;
        pub const BOOTTIME = 21;
        pub const NISDOMAINNAME = 22;
        pub const UPDATEINTERVAL = 23;
        pub const OSRELDATE = 24;
        pub const NTP_PLL = 25;
        pub const BOOTFILE = 26;
        pub const MAXFILESPERPROC = 27;
        pub const MAXPROCPERUID = 28;
        pub const DUMPDEV = 29;
        pub const IPC = 30;
        pub const DUMMY = 31;
        pub const PS_STRINGS = 32;
        pub const USRSTACK = 33;
        pub const LOGSIGEXIT = 34;
        pub const IOV_MAX = 35;
        pub const MAXPOSIXLOCKSPERUID = 36;
        pub const MAXID = 37;
    },
    .openbsd => struct {
        pub const OSTYPE = 1;
        pub const OSRELEASE = 2;
        pub const OSREV = 3;
        pub const VERSION = 4;
        pub const MAXVNODES = 5;
        pub const MAXPROC = 6;
        pub const MAXFILES = 7;
        pub const ARGMAX = 8;
        pub const SECURELVL = 9;
        pub const HOSTNAME = 10;
        pub const HOSTID = 11;
        pub const CLOCKRATE = 12;

        pub const PROF = 16;
        pub const POSIX1 = 17;
        pub const NGROUPS = 18;
        pub const JOB_CONTROL = 19;
        pub const SAVED_IDS = 20;
        pub const BOOTTIME = 21;
        pub const DOMAINNAME = 22;
        pub const MAXPARTITIONS = 23;
        pub const RAWPARTITION = 24;
        pub const MAXTHREAD = 25;
        pub const NTHREADS = 26;
        pub const OSVERSION = 27;
        pub const SOMAXCONN = 28;
        pub const SOMINCONN = 29;

        pub const NOSUIDCOREDUMP = 32;
        pub const FSYNC = 33;
        pub const SYSVMSG = 34;
        pub const SYSVSEM = 35;
        pub const SYSVSHM = 36;

        pub const MSGBUFSIZE = 38;
        pub const MALLOCSTATS = 39;
        pub const CPTIME = 40;
        pub const NCHSTATS = 41;
        pub const FORKSTAT = 42;
        pub const NSELCOLL = 43;
        pub const TTY = 44;
        pub const CCPU = 45;
        pub const FSCALE = 46;
        pub const NPROCS = 47;
        pub const MSGBUF = 48;
        pub const POOL = 49;
        pub const STACKGAPRANDOM = 50;
        pub const SYSVIPC_INFO = 51;
        pub const ALLOWKMEM = 52;
        pub const WITNESSWATCH = 53;
        pub const SPLASSERT = 54;
        pub const PROC_ARGS = 55;
        pub const NFILES = 56;
        pub const TTYCOUNT = 57;
        pub const NUMVNODES = 58;
        pub const MBSTAT = 59;
        pub const WITNESS = 60;
        pub const SEMINFO = 61;
        pub const SHMINFO = 62;
        pub const INTRCNT = 63;
        pub const WATCHDOG = 64;
        pub const ALLOWDT = 65;
        pub const PROC = 66;
        pub const MAXCLUSTERS = 67;
        pub const EVCOUNT = 68;
        pub const TIMECOUNTER = 69;
        pub const MAXLOCKSPERUID = 70;
        pub const CPTIME2 = 71;
        pub const CACHEPCT = 72;
        pub const FILE = 73;
        pub const WXABORT = 74;
        pub const CONSDEV = 75;
        pub const NETLIVELOCKS = 76;
        pub const POOL_DEBUG = 77;
        pub const PROC_CWD = 78;
        pub const PROC_NOBROADCASTKILL = 79;
        pub const PROC_VMMAP = 80;
        pub const GLOBAL_PTRACE = 81;
        pub const CONSBUFSIZE = 82;
        pub const CONSBUF = 83;
        pub const AUDIO = 84;
        pub const CPUSTATS = 85;
        pub const PFSTATUS = 86;
        pub const TIMEOUT_STATS = 87;
        pub const UTC_OFFSET = 88;
        pub const VIDEO = 89;

        pub const PROC_ALL = 0;
        pub const PROC_PID = 1;
        pub const PROC_PGRP = 2;
        pub const PROC_SESSION = 3;
        pub const PROC_TTY = 4;
        pub const PROC_UID = 5;
        pub const PROC_RUID = 6;
        pub const PROC_KTHREAD = 7;
        pub const PROC_SHOW_THREADS = 0x40000000;

        pub const PROC_ARGV = 1;
        pub const PROC_NARGV = 2;
        pub const PROC_ENV = 3;
        pub const PROC_NENV = 4;
    },
    else => void,
}

TypeMADV[src]

Values

ConstantNORMAL[src]

Source Code

Source code
pub const NORMAL = 0

ConstantRANDOM[src]

Source Code

Source code
pub const RANDOM = 1

ConstantSEQUENTIAL[src]

Source Code

Source code
pub const SEQUENTIAL = 2

ConstantWILLNEED[src]

Source Code

Source code
pub const WILLNEED = 3

ConstantDONTNEED[src]

Source Code

Source code
pub const DONTNEED = 4

ConstantFREE[src]

Source Code

Source code
pub const FREE = 5

ConstantZERO_WIRED_PAGES[src]

Source Code

Source code
pub const ZERO_WIRED_PAGES = 6

ConstantFREE_REUSABLE[src]

Source Code

Source code
pub const FREE_REUSABLE = 7

ConstantFREE_REUSE[src]

Source Code

Source code
pub const FREE_REUSE = 8

ConstantCAN_REUSE[src]

Source Code

Source code
pub const CAN_REUSE = 9

ConstantPAGEOUT[src]

Source Code

Source code
pub const PAGEOUT = 10

ConstantZERO[src]

Source Code

Source code
pub const ZERO = 11

ConstantNORMAL[src]

Source Code

Source code
pub const NORMAL = 0

ConstantRANDOM[src]

Source Code

Source code
pub const RANDOM = 1

ConstantSEQUENTIAL[src]

Source Code

Source code
pub const SEQUENTIAL = 2

ConstantWILLNEED[src]

Source Code

Source code
pub const WILLNEED = 3

ConstantDONTNEED[src]

Source Code

Source code
pub const DONTNEED = 4

ConstantFREE[src]

Source Code

Source code
pub const FREE = 5

ConstantNOSYNC[src]

Source Code

Source code
pub const NOSYNC = 6

ConstantAUTOSYNC[src]

Source Code

Source code
pub const AUTOSYNC = 7

ConstantNOCORE[src]

Source Code

Source code
pub const NOCORE = 8

ConstantCORE[src]

Source Code

Source code
pub const CORE = 9

ConstantPROTECT[src]

Source Code

Source code
pub const PROTECT = 10

ConstantNORMAL[src]

no further special treatment

Source Code

Source code
pub const NORMAL = 0

ConstantRANDOM[src]

expect random page references

Source Code

Source code
pub const RANDOM = 1

ConstantSEQUENTIAL[src]

expect sequential page references

Source Code

Source code
pub const SEQUENTIAL = 2

ConstantWILLNEED[src]

will need these pages

Source Code

Source code
pub const WILLNEED = 3

ConstantDONTNEED[src]

don't need these pages

Source Code

Source code
pub const DONTNEED = 4

ConstantFREE[src]

contents can be freed

Source Code

Source code
pub const FREE = 5

ConstantACCESS_DEFAULT[src]

default access

Source Code

Source code
pub const ACCESS_DEFAULT = 6

ConstantACCESS_LWP[src]

next LWP to access heavily

Source Code

Source code
pub const ACCESS_LWP = 7

ConstantACCESS_MANY[src]

many processes to access heavily

Source Code

Source code
pub const ACCESS_MANY = 8

ConstantPURGE[src]

contents will be purged

Source Code

Source code
pub const PURGE = 9

ConstantSEQUENTIAL[src]

Source Code

Source code
pub const SEQUENTIAL = 2

ConstantSETMAP[src]

Source Code

Source code
pub const SETMAP = 11

ConstantDONTNEED[src]

Source Code

Source code
pub const DONTNEED = 4

ConstantRANDOM[src]

Source Code

Source code
pub const RANDOM = 1

ConstantWILLNEED[src]

Source Code

Source code
pub const WILLNEED = 3

ConstantNORMAL[src]

Source Code

Source code
pub const NORMAL = 0

ConstantINVAL[src]

Source Code

Source code
pub const INVAL = 10

ConstantFREE[src]

Source Code

Source code
pub const FREE = 5

ConstantNOSYNC[src]

Source Code

Source code
pub const NOSYNC = 6

ConstantAUTOSYNC[src]

Source Code

Source code
pub const AUTOSYNC = 7

ConstantNOCORE[src]

Source Code

Source code
pub const NOCORE = 8

ConstantCORE[src]

Source Code

Source code
pub const CORE = 9

ConstantINVAL[src]

Source Code

Source code
pub const INVAL = 10

ConstantSETMAP[src]

Source Code

Source code
pub const SETMAP = 11

Source Code

Source code
pub const MADV = switch (native_os) {
    .linux => linux.MADV,
    .emscripten => emscripten.MADV,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const NORMAL = 0;
        pub const RANDOM = 1;
        pub const SEQUENTIAL = 2;
        pub const WILLNEED = 3;
        pub const DONTNEED = 4;
        pub const FREE = 5;
        pub const ZERO_WIRED_PAGES = 6;
        pub const FREE_REUSABLE = 7;
        pub const FREE_REUSE = 8;
        pub const CAN_REUSE = 9;
        pub const PAGEOUT = 10;
        pub const ZERO = 11;
    },
    .freebsd => struct {
        pub const NORMAL = 0;
        pub const RANDOM = 1;
        pub const SEQUENTIAL = 2;
        pub const WILLNEED = 3;
        pub const DONTNEED = 4;
        pub const FREE = 5;
        pub const NOSYNC = 6;
        pub const AUTOSYNC = 7;
        pub const NOCORE = 8;
        pub const CORE = 9;
        pub const PROTECT = 10;
    },
    .solaris, .illumos => struct {
        /// no further special treatment
        pub const NORMAL = 0;
        /// expect random page references
        pub const RANDOM = 1;
        /// expect sequential page references
        pub const SEQUENTIAL = 2;
        /// will need these pages
        pub const WILLNEED = 3;
        /// don't need these pages
        pub const DONTNEED = 4;
        /// contents can be freed
        pub const FREE = 5;
        /// default access
        pub const ACCESS_DEFAULT = 6;
        /// next LWP to access heavily
        pub const ACCESS_LWP = 7;
        /// many processes to access heavily
        pub const ACCESS_MANY = 8;
        /// contents will be purged
        pub const PURGE = 9;
    },
    .dragonfly => struct {
        pub const SEQUENTIAL = 2;
        pub const CONTROL_END = SETMAP;
        pub const DONTNEED = 4;
        pub const RANDOM = 1;
        pub const WILLNEED = 3;
        pub const NORMAL = 0;
        pub const CONTROL_START = INVAL;
        pub const FREE = 5;
        pub const NOSYNC = 6;
        pub const AUTOSYNC = 7;
        pub const NOCORE = 8;
        pub const CORE = 9;
        pub const INVAL = 10;
        pub const SETMAP = 11;
    },
    else => void,
}

TypeMSF[src]

Values

ConstantASYNC[src]

Source Code

Source code
pub const ASYNC = 0x1

ConstantINVALIDATE[src]

Source Code

Source code
pub const INVALIDATE = 0x2

ConstantKILLPAGES[src]

invalidate, leave mapped

Source Code

Source code
pub const KILLPAGES = 0x4

ConstantDEACTIVATE[src]

deactivate, leave mapped

Source Code

Source code
pub const DEACTIVATE = 0x8

ConstantSYNC[src]

Source Code

Source code
pub const SYNC = 0x10

ConstantASYNC[src]

Source Code

Source code
pub const ASYNC = 1

ConstantINVALIDATE[src]

Source Code

Source code
pub const INVALIDATE = 2

ConstantSYNC[src]

Source Code

Source code
pub const SYNC = 4

Source Code

Source code
pub const MSF = switch (native_os) {
    .linux => linux.MSF,
    .emscripten => emscripten.MSF,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const ASYNC = 0x1;
        pub const INVALIDATE = 0x2;
        /// invalidate, leave mapped
        pub const KILLPAGES = 0x4;
        /// deactivate, leave mapped
        pub const DEACTIVATE = 0x8;
        pub const SYNC = 0x10;
    },
    .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd => struct {
        pub const ASYNC = 1;
        pub const INVALIDATE = 2;
        pub const SYNC = 4;
    },
    else => void,
}

TypeMMAP2_UNIT[src]

Source Code

Source code
pub const MMAP2_UNIT = switch (native_os) {
    .linux => linux.MMAP2_UNIT,
    else => void,
}

TypePOLL[src]

Values

ConstantRDNORM[src]

Source Code

Source code
pub const RDNORM = 0x1

ConstantWRNORM[src]

Source Code

Source code
pub const WRNORM = 0x2

ConstantRDNORM[src]

Source Code

Source code
pub const RDNORM = 0x1

ConstantWRNORM[src]

Source Code

Source code
pub const WRNORM = 0x2

ConstantERR[src]

Source Code

Source code
pub const ERR = 0x1000

ConstantHUP[src]

Source Code

Source code
pub const HUP = 0x2000

ConstantNVAL[src]

Source Code

Source code
pub const NVAL = 0x4000

ConstantIN[src]

Source Code

Source code
pub const IN = 0x001

ConstantPRI[src]

Source Code

Source code
pub const PRI = 0x002

ConstantOUT[src]

Source Code

Source code
pub const OUT = 0x004

ConstantRDNORM[src]

Source Code

Source code
pub const RDNORM = 0x040

ConstantOUT[src]

Source Code

Source code
pub const OUT = 0x004

ConstantRDBAND[src]

Source Code

Source code
pub const RDBAND = 0x080

ConstantWRBAND[src]

Source Code

Source code
pub const WRBAND = 0x100

ConstantEXTEND[src]

Source Code

Source code
pub const EXTEND = 0x0200

ConstantATTRIB[src]

Source Code

Source code
pub const ATTRIB = 0x0400
Source code
pub const NLINK = 0x0800

ConstantWRITE[src]

Source Code

Source code
pub const WRITE = 0x1000

ConstantERR[src]

Source Code

Source code
pub const ERR = 0x008

ConstantHUP[src]

Source Code

Source code
pub const HUP = 0x010

ConstantNVAL[src]

Source Code

Source code
pub const NVAL = 0x020

ConstantSTANDARD[src]

Source Code

Source code
pub const STANDARD = IN | PRI | OUT | RDNORM | RDBAND | WRBAND | ERR | HUP | NVAL

ConstantIN[src]

any readable data available.

Source Code

Source code
pub const IN = 0x0001

ConstantPRI[src]

OOB/Urgent readable data.

Source Code

Source code
pub const PRI = 0x0002

ConstantOUT[src]

file descriptor is writeable.

Source Code

Source code
pub const OUT = 0x0004

ConstantRDNORM[src]

non-OOB/URG data available.

Source Code

Source code
pub const RDNORM = 0x0040

ConstantOUT[src]

file descriptor is writeable.

Source Code

Source code
pub const OUT = 0x0004

ConstantRDBAND[src]

OOB/Urgent readable data.

Source Code

Source code
pub const RDBAND = 0x0080

ConstantWRBAND[src]

OOB/Urgent data can be written.

Source Code

Source code
pub const WRBAND = 0x0100

ConstantINIGNEOF[src]

like IN, except ignore EOF.

Source Code

Source code
pub const INIGNEOF = 0x2000

ConstantERR[src]

some poll error occurred.

Source Code

Source code
pub const ERR = 0x0008

ConstantHUP[src]

file descriptor was "hung up".

Source Code

Source code
pub const HUP = 0x0010

ConstantNVAL[src]

requested events "invalid".

Source Code

Source code
pub const NVAL = 0x0020

ConstantSTANDARD[src]

Source Code

Source code
pub const STANDARD = IN | PRI | OUT | RDNORM | RDBAND | WRBAND | ERR | HUP | NVAL

ConstantIN[src]

Source Code

Source code
pub const IN = 0x0001

ConstantPRI[src]

Source Code

Source code
pub const PRI = 0x0002

ConstantOUT[src]

Source Code

Source code
pub const OUT = 0x0004

ConstantRDNORM[src]

Source Code

Source code
pub const RDNORM = 0x0040

ConstantWRNORM[src]

Source Code

Source code
pub const WRNORM = .OUT

ConstantRDBAND[src]

Source Code

Source code
pub const RDBAND = 0x0080

ConstantWRBAND[src]

Source Code

Source code
pub const WRBAND = 0x0100

ConstantRDHUP[src]

Read-side hangup.

Source Code

Source code
pub const RDHUP = 0x4000

ConstantERR[src]

Non-testable events (may not be specified in events).

Source Code

Source code
pub const ERR = 0x0008

ConstantHUP[src]

Source Code

Source code
pub const HUP = 0x0010

ConstantNVAL[src]

Source Code

Source code
pub const NVAL = 0x0020

ConstantREMOVE[src]

Events to control /dev/poll (not specified in revents)

Source Code

Source code
pub const REMOVE = 0x0800

ConstantONESHOT[src]

Source Code

Source code
pub const ONESHOT = 0x1000

ConstantET[src]

Source Code

Source code
pub const ET = 0x2000

ConstantIN[src]

Testable events (may be specified in events field).

Source Code

Source code
pub const IN = 0x0001

ConstantPRI[src]

Source Code

Source code
pub const PRI = 0x0002

ConstantOUT[src]

Source Code

Source code
pub const OUT = 0x0004

ConstantRDNORM[src]

Source Code

Source code
pub const RDNORM = 0x0040

ConstantOUT[src]

Source Code

Source code
pub const OUT = 0x0004

ConstantRDBAND[src]

Source Code

Source code
pub const RDBAND = 0x0080

ConstantWRBAND[src]

Source Code

Source code
pub const WRBAND = 0x0100

ConstantERR[src]

Non-testable events (may not be specified in events field).

Source Code

Source code
pub const ERR = 0x0008

ConstantHUP[src]

Source Code

Source code
pub const HUP = 0x0010

ConstantNVAL[src]

Source Code

Source code
pub const NVAL = 0x0020

ConstantIN[src]

any readable data available

Source Code

Source code
pub const IN = 0x0001

ConstantOUT[src]

file descriptor is writeable

Source Code

Source code
pub const OUT = 0x0002

ConstantIN[src]

any readable data available

Source Code

Source code
pub const IN = 0x0001

ConstantOUT[src]

file descriptor is writeable

Source Code

Source code
pub const OUT = 0x0002

ConstantRDBAND[src]

priority readable data

Source Code

Source code
pub const RDBAND = 0x0008

ConstantWRBAND[src]

priority data can be written

Source Code

Source code
pub const WRBAND = 0x0010

ConstantPRI[src]

high priority readable data

Source Code

Source code
pub const PRI = 0x0020

ConstantERR[src]

errors pending

Source Code

Source code
pub const ERR = 0x0004

ConstantHUP[src]

disconnected

Source Code

Source code
pub const HUP = 0x0080

ConstantNVAL[src]

invalid file descriptor

Source Code

Source code
pub const NVAL = 0x1000

ConstantIN[src]

Source Code

Source code
pub const IN = 0x0001

ConstantPRI[src]

Source Code

Source code
pub const PRI = 0x0002

ConstantOUT[src]

Source Code

Source code
pub const OUT = 0x0004

ConstantERR[src]

Source Code

Source code
pub const ERR = 0x0008

ConstantHUP[src]

Source Code

Source code
pub const HUP = 0x0010

ConstantNVAL[src]

Source Code

Source code
pub const NVAL = 0x0020

ConstantRDNORM[src]

Source Code

Source code
pub const RDNORM = 0x0040

ConstantRDNORM[src]

Source Code

Source code
pub const RDNORM = 0x0040

ConstantOUT[src]

Source Code

Source code
pub const OUT = 0x0004

ConstantRDBAND[src]

Source Code

Source code
pub const RDBAND = 0x0080

ConstantWRBAND[src]

Source Code

Source code
pub const WRBAND = 0x0100

Source Code

Source code
pub const POLL = switch (native_os) {
    .linux => linux.POLL,
    .emscripten => emscripten.POLL,
    .wasi => struct {
        pub const RDNORM = 0x1;
        pub const WRNORM = 0x2;
        pub const IN = RDNORM;
        pub const OUT = WRNORM;
        pub const ERR = 0x1000;
        pub const HUP = 0x2000;
        pub const NVAL = 0x4000;
    },
    .windows => ws2_32.POLL,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const IN = 0x001;
        pub const PRI = 0x002;
        pub const OUT = 0x004;
        pub const RDNORM = 0x040;
        pub const WRNORM = OUT;
        pub const RDBAND = 0x080;
        pub const WRBAND = 0x100;

        pub const EXTEND = 0x0200;
        pub const ATTRIB = 0x0400;
        pub const NLINK = 0x0800;
        pub const WRITE = 0x1000;

        pub const ERR = 0x008;
        pub const HUP = 0x010;
        pub const NVAL = 0x020;

        pub const STANDARD = IN | PRI | OUT | RDNORM | RDBAND | WRBAND | ERR | HUP | NVAL;
    },
    .freebsd => struct {
        /// any readable data available.
        pub const IN = 0x0001;
        /// OOB/Urgent readable data.
        pub const PRI = 0x0002;
        /// file descriptor is writeable.
        pub const OUT = 0x0004;
        /// non-OOB/URG data available.
        pub const RDNORM = 0x0040;
        /// no write type differentiation.
        pub const WRNORM = OUT;
        /// OOB/Urgent readable data.
        pub const RDBAND = 0x0080;
        /// OOB/Urgent data can be written.
        pub const WRBAND = 0x0100;
        /// like IN, except ignore EOF.
        pub const INIGNEOF = 0x2000;
        /// some poll error occurred.
        pub const ERR = 0x0008;
        /// file descriptor was "hung up".
        pub const HUP = 0x0010;
        /// requested events "invalid".
        pub const NVAL = 0x0020;

        pub const STANDARD = IN | PRI | OUT | RDNORM | RDBAND | WRBAND | ERR | HUP | NVAL;
    },
    .solaris, .illumos => struct {
        pub const IN = 0x0001;
        pub const PRI = 0x0002;
        pub const OUT = 0x0004;
        pub const RDNORM = 0x0040;
        pub const WRNORM = .OUT;
        pub const RDBAND = 0x0080;
        pub const WRBAND = 0x0100;
        /// Read-side hangup.
        pub const RDHUP = 0x4000;

        /// Non-testable events (may not be specified in events).
        pub const ERR = 0x0008;
        pub const HUP = 0x0010;
        pub const NVAL = 0x0020;

        /// Events to control `/dev/poll` (not specified in revents)
        pub const REMOVE = 0x0800;
        pub const ONESHOT = 0x1000;
        pub const ET = 0x2000;
    },
    .dragonfly, .netbsd => struct {
        /// Testable events (may be specified in events field).
        pub const IN = 0x0001;
        pub const PRI = 0x0002;
        pub const OUT = 0x0004;
        pub const RDNORM = 0x0040;
        pub const WRNORM = OUT;
        pub const RDBAND = 0x0080;
        pub const WRBAND = 0x0100;

        /// Non-testable events (may not be specified in events field).
        pub const ERR = 0x0008;
        pub const HUP = 0x0010;
        pub const NVAL = 0x0020;
    },
    .haiku => struct {
        /// any readable data available
        pub const IN = 0x0001;
        /// file descriptor is writeable
        pub const OUT = 0x0002;
        pub const RDNORM = IN;
        pub const WRNORM = OUT;
        /// priority readable data
        pub const RDBAND = 0x0008;
        /// priority data can be written
        pub const WRBAND = 0x0010;
        /// high priority readable data
        pub const PRI = 0x0020;

        /// errors pending
        pub const ERR = 0x0004;
        /// disconnected
        pub const HUP = 0x0080;
        /// invalid file descriptor
        pub const NVAL = 0x1000;
    },
    .openbsd => struct {
        pub const IN = 0x0001;
        pub const PRI = 0x0002;
        pub const OUT = 0x0004;
        pub const ERR = 0x0008;
        pub const HUP = 0x0010;
        pub const NVAL = 0x0020;
        pub const RDNORM = 0x0040;
        pub const NORM = RDNORM;
        pub const WRNORM = OUT;
        pub const RDBAND = 0x0080;
        pub const WRBAND = 0x0100;
    },
    else => void,
}

TypePROT[src]

Basic memory protection flags

Values

ConstantNONE[src]

page can not be accessed

Source Code

Source code
pub const NONE = 0x0

ConstantREAD[src]

page can be read

Source Code

Source code
pub const READ = 0x1

ConstantWRITE[src]

page can be written

Source Code

Source code
pub const WRITE = 0x2

ConstantEXEC[src]

page can be executed

Source Code

Source code
pub const EXEC = 0x4

ConstantNONE[src]

[MC2] no permissions

Source Code

Source code
pub const NONE: vm_prot_t = 0x00

ConstantREAD[src]

[MC2] pages can be read

Source Code

Source code
pub const READ: vm_prot_t = 0x01

ConstantWRITE[src]

[MC2] pages can be written

Source Code

Source code
pub const WRITE: vm_prot_t = 0x02

ConstantEXEC[src]

[MC2] pages can be executed

Source Code

Source code
pub const EXEC: vm_prot_t = 0x04

ConstantCOPY[src]

When a caller finds that they cannot obtain write permission on a mapped entry, the following flag can be used. The entry will be made "needs copy" effectively copying the object (using COW), and write permission will be added to the maximum protections for the associated entry.

Source Code

Source code
pub const COPY: vm_prot_t = 0x10

Source Code

Source code
pub const PROT = switch (native_os) {
    .linux => linux.PROT,
    .emscripten => emscripten.PROT,
    .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .windows => struct {
        /// page can not be accessed
        pub const NONE = 0x0;
        /// page can be read
        pub const READ = 0x1;
        /// page can be written
        pub const WRITE = 0x2;
        /// page can be executed
        pub const EXEC = 0x4;
    },
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        /// [MC2] no permissions
        pub const NONE: vm_prot_t = 0x00;
        /// [MC2] pages can be read
        pub const READ: vm_prot_t = 0x01;
        /// [MC2] pages can be written
        pub const WRITE: vm_prot_t = 0x02;
        /// [MC2] pages can be executed
        pub const EXEC: vm_prot_t = 0x04;
        /// When a caller finds that they cannot obtain write permission on a
        /// mapped entry, the following flag can be used. The entry will be
        /// made "needs copy" effectively copying the object (using COW),
        /// and write permission will be added to the maximum protections for
        /// the associated entry.
        pub const COPY: vm_prot_t = 0x10;
    },
    else => void,
}

TypeREG[src]

Values

ConstantFP[src]

Source Code

Source code
pub const FP = 29

ConstantSP[src]

Source Code

Source code
pub const SP = 31

ConstantPC[src]

Source Code

Source code
pub const PC = 32

ConstantFP[src]

Source Code

Source code
pub const FP = 11

ConstantSP[src]

Source Code

Source code
pub const SP = 13

ConstantPC[src]

Source Code

Source code
pub const PC = 15

ConstantRBP[src]

Source Code

Source code
pub const RBP = 12

ConstantRIP[src]

Source Code

Source code
pub const RIP = 21

ConstantRSP[src]

Source Code

Source code
pub const RSP = 24

ConstantR15[src]

Source Code

Source code
pub const R15 = 0

ConstantR14[src]

Source Code

Source code
pub const R14 = 1

ConstantR13[src]

Source Code

Source code
pub const R13 = 2

ConstantR12[src]

Source Code

Source code
pub const R12 = 3

ConstantR11[src]

Source Code

Source code
pub const R11 = 4

ConstantR10[src]

Source Code

Source code
pub const R10 = 5

ConstantR9[src]

Source Code

Source code
pub const R9 = 6

ConstantR8[src]

Source Code

Source code
pub const R8 = 7

ConstantRDI[src]

Source Code

Source code
pub const RDI = 8

ConstantRSI[src]

Source Code

Source code
pub const RSI = 9

ConstantRBP[src]

Source Code

Source code
pub const RBP = 10

ConstantRBX[src]

Source Code

Source code
pub const RBX = 11

ConstantRDX[src]

Source Code

Source code
pub const RDX = 12

ConstantRCX[src]

Source Code

Source code
pub const RCX = 13

ConstantRAX[src]

Source Code

Source code
pub const RAX = 14

ConstantRIP[src]

Source Code

Source code
pub const RIP = 17

ConstantRSP[src]

Source Code

Source code
pub const RSP = 20

ConstantFP[src]

Source Code

Source code
pub const FP = 29

ConstantSP[src]

Source Code

Source code
pub const SP = 31

ConstantPC[src]

Source Code

Source code
pub const PC = 32

ConstantFP[src]

Source Code

Source code
pub const FP = 11

ConstantSP[src]

Source Code

Source code
pub const SP = 13

ConstantPC[src]

Source Code

Source code
pub const PC = 15

ConstantRDI[src]

Source Code

Source code
pub const RDI = 0

ConstantRSI[src]

Source Code

Source code
pub const RSI = 1

ConstantRDX[src]

Source Code

Source code
pub const RDX = 2

ConstantRCX[src]

Source Code

Source code
pub const RCX = 3

ConstantR8[src]

Source Code

Source code
pub const R8 = 4

ConstantR9[src]

Source Code

Source code
pub const R9 = 5

ConstantR10[src]

Source Code

Source code
pub const R10 = 6

ConstantR11[src]

Source Code

Source code
pub const R11 = 7

ConstantR12[src]

Source Code

Source code
pub const R12 = 8

ConstantR13[src]

Source Code

Source code
pub const R13 = 9

ConstantR14[src]

Source Code

Source code
pub const R14 = 10

ConstantR15[src]

Source Code

Source code
pub const R15 = 11

ConstantRBP[src]

Source Code

Source code
pub const RBP = 12

ConstantRBX[src]

Source Code

Source code
pub const RBX = 13

ConstantRAX[src]

Source Code

Source code
pub const RAX = 14

ConstantGS[src]

Source Code

Source code
pub const GS = 15

ConstantFS[src]

Source Code

Source code
pub const FS = 16

ConstantES[src]

Source Code

Source code
pub const ES = 17

ConstantDS[src]

Source Code

Source code
pub const DS = 18

ConstantTRAPNO[src]

Source Code

Source code
pub const TRAPNO = 19

ConstantERR[src]

Source Code

Source code
pub const ERR = 20

ConstantRIP[src]

Source Code

Source code
pub const RIP = 21

ConstantCS[src]

Source Code

Source code
pub const CS = 22

ConstantRFLAGS[src]

Source Code

Source code
pub const RFLAGS = 23

ConstantRSP[src]

Source Code

Source code
pub const RSP = 24

ConstantSS[src]

Source Code

Source code
pub const SS = 25

Source Code

Source code
pub const REG = switch (native_os) {
    .linux => linux.REG,
    .emscripten => emscripten.REG,
    .freebsd => switch (builtin.cpu.arch) {
        .aarch64 => struct {
            pub const FP = 29;
            pub const SP = 31;
            pub const PC = 32;
        },
        .arm => struct {
            pub const FP = 11;
            pub const SP = 13;
            pub const PC = 15;
        },
        .x86_64 => struct {
            pub const RBP = 12;
            pub const RIP = 21;
            pub const RSP = 24;
        },
        else => struct {},
    },
    .solaris, .illumos => struct {
        pub const R15 = 0;
        pub const R14 = 1;
        pub const R13 = 2;
        pub const R12 = 3;
        pub const R11 = 4;
        pub const R10 = 5;
        pub const R9 = 6;
        pub const R8 = 7;
        pub const RDI = 8;
        pub const RSI = 9;
        pub const RBP = 10;
        pub const RBX = 11;
        pub const RDX = 12;
        pub const RCX = 13;
        pub const RAX = 14;
        pub const RIP = 17;
        pub const RSP = 20;
    },
    .netbsd => switch (builtin.cpu.arch) {
        .aarch64 => struct {
            pub const FP = 29;
            pub const SP = 31;
            pub const PC = 32;
        },
        .arm => struct {
            pub const FP = 11;
            pub const SP = 13;
            pub const PC = 15;
        },
        .x86_64 => struct {
            pub const RDI = 0;
            pub const RSI = 1;
            pub const RDX = 2;
            pub const RCX = 3;
            pub const R8 = 4;
            pub const R9 = 5;
            pub const R10 = 6;
            pub const R11 = 7;
            pub const R12 = 8;
            pub const R13 = 9;
            pub const R14 = 10;
            pub const R15 = 11;
            pub const RBP = 12;
            pub const RBX = 13;
            pub const RAX = 14;
            pub const GS = 15;
            pub const FS = 16;
            pub const ES = 17;
            pub const DS = 18;
            pub const TRAPNO = 19;
            pub const ERR = 20;
            pub const RIP = 21;
            pub const CS = 22;
            pub const RFLAGS = 23;
            pub const RSP = 24;
            pub const SS = 25;
        },
        else => struct {},
    },
    else => struct {},
}

TypeRLIM[src]

Values

ConstantINFINITY[src]

No limit

Source Code

Source code
pub const INFINITY: rlim_t = (1 << 63) - 1

ConstantINFINITY[src]

No limit

Source Code

Source code
pub const INFINITY: rlim_t = (1 << 63) - 1

ConstantINFINITY[src]

No limit

Source Code

Source code
pub const INFINITY: rlim_t = (1 << 63) - 1

ConstantINFINITY[src]

No limit

Source Code

Source code
pub const INFINITY: rlim_t = (1 << 63) - 3

ConstantSAVED_MAX[src]

Source Code

Source code
pub const SAVED_MAX: rlim_t = (1 << 63) - 2

ConstantSAVED_CUR[src]

Source Code

Source code
pub const SAVED_CUR: rlim_t = (1 << 63) - 1

Source Code

Source code
pub const RLIM = switch (native_os) {
    .linux => linux.RLIM,
    .emscripten => emscripten.RLIM,
    .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => struct {
        /// No limit
        pub const INFINITY: rlim_t = (1 << 63) - 1;

        pub const SAVED_MAX = INFINITY;
        pub const SAVED_CUR = INFINITY;
    },
    .solaris, .illumos => struct {
        /// No limit
        pub const INFINITY: rlim_t = (1 << 63) - 3;
        pub const SAVED_MAX: rlim_t = (1 << 63) - 2;
        pub const SAVED_CUR: rlim_t = (1 << 63) - 1;
    },
    else => void,
}

TypeS[src]

Values

ConstantIFBLK[src]

Source Code

Source code
pub const IFBLK = 0x6000

ConstantIFCHR[src]

Source Code

Source code
pub const IFCHR = 0x2000

ConstantIFDIR[src]

Source Code

Source code
pub const IFDIR = 0x4000

ConstantIFIFO[src]

Source Code

Source code
pub const IFIFO = 0x1000

ConstantIFLNK[src]

Source Code

Source code
pub const IFLNK = 0xa000

ConstantIFMT[src]

Source Code

Source code
pub const IFMT = IFBLK | IFCHR | IFDIR | IFIFO | IFLNK | IFREG | IFSOCK

ConstantIFREG[src]

Source Code

Source code
pub const IFREG = 0x8000

ConstantIFSOCK[src]

Source Code

Source code
pub const IFSOCK = 0xc000

ConstantIFMT[src]

Source Code

Source code
pub const IFMT = 0o170000

ConstantIFIFO[src]

Source Code

Source code
pub const IFIFO = 0o010000

ConstantIFCHR[src]

Source Code

Source code
pub const IFCHR = 0o020000

ConstantIFDIR[src]

Source Code

Source code
pub const IFDIR = 0o040000

ConstantIFBLK[src]

Source Code

Source code
pub const IFBLK = 0o060000

ConstantIFREG[src]

Source Code

Source code
pub const IFREG = 0o100000

ConstantIFLNK[src]

Source Code

Source code
pub const IFLNK = 0o120000

ConstantIFSOCK[src]

Source Code

Source code
pub const IFSOCK = 0o140000

ConstantIFWHT[src]

Source Code

Source code
pub const IFWHT = 0o160000

ConstantISUID[src]

Source Code

Source code
pub const ISUID = 0o4000

ConstantISGID[src]

Source Code

Source code
pub const ISGID = 0o2000

ConstantISVTX[src]

Source Code

Source code
pub const ISVTX = 0o1000

ConstantIRWXU[src]

Source Code

Source code
pub const IRWXU = 0o700

ConstantIRUSR[src]

Source Code

Source code
pub const IRUSR = 0o400

ConstantIWUSR[src]

Source Code

Source code
pub const IWUSR = 0o200

ConstantIXUSR[src]

Source Code

Source code
pub const IXUSR = 0o100

ConstantIRWXG[src]

Source Code

Source code
pub const IRWXG = 0o070

ConstantIRGRP[src]

Source Code

Source code
pub const IRGRP = 0o040

ConstantIWGRP[src]

Source Code

Source code
pub const IWGRP = 0o020

ConstantIXGRP[src]

Source Code

Source code
pub const IXGRP = 0o010

ConstantIRWXO[src]

Source Code

Source code
pub const IRWXO = 0o007

ConstantIROTH[src]

Source Code

Source code
pub const IROTH = 0o004

ConstantIWOTH[src]

Source Code

Source code
pub const IWOTH = 0o002

ConstantIXOTH[src]

Source Code

Source code
pub const IXOTH = 0o001

ConstantIFMT[src]

Source Code

Source code
pub const IFMT = 0o170000

ConstantIFIFO[src]

Source Code

Source code
pub const IFIFO = 0o010000

ConstantIFCHR[src]

Source Code

Source code
pub const IFCHR = 0o020000

ConstantIFDIR[src]

Source Code

Source code
pub const IFDIR = 0o040000

ConstantIFBLK[src]

Source Code

Source code
pub const IFBLK = 0o060000

ConstantIFREG[src]

Source Code

Source code
pub const IFREG = 0o100000

ConstantIFLNK[src]

Source Code

Source code
pub const IFLNK = 0o120000

ConstantIFSOCK[src]

Source Code

Source code
pub const IFSOCK = 0o140000

ConstantIFWHT[src]

Source Code

Source code
pub const IFWHT = 0o160000

ConstantISUID[src]

Source Code

Source code
pub const ISUID = 0o4000

ConstantISGID[src]

Source Code

Source code
pub const ISGID = 0o2000

ConstantISVTX[src]

Source Code

Source code
pub const ISVTX = 0o1000

ConstantIRWXU[src]

Source Code

Source code
pub const IRWXU = 0o700

ConstantIRUSR[src]

Source Code

Source code
pub const IRUSR = 0o400

ConstantIWUSR[src]

Source Code

Source code
pub const IWUSR = 0o200

ConstantIXUSR[src]

Source Code

Source code
pub const IXUSR = 0o100

ConstantIRWXG[src]

Source Code

Source code
pub const IRWXG = 0o070

ConstantIRGRP[src]

Source Code

Source code
pub const IRGRP = 0o040

ConstantIWGRP[src]

Source Code

Source code
pub const IWGRP = 0o020

ConstantIXGRP[src]

Source Code

Source code
pub const IXGRP = 0o010

ConstantIRWXO[src]

Source Code

Source code
pub const IRWXO = 0o007

ConstantIROTH[src]

Source Code

Source code
pub const IROTH = 0o004

ConstantIWOTH[src]

Source Code

Source code
pub const IWOTH = 0o002

ConstantIXOTH[src]

Source Code

Source code
pub const IXOTH = 0o001

ConstantIFMT[src]

Source Code

Source code
pub const IFMT = 0o170000

ConstantIFIFO[src]

Source Code

Source code
pub const IFIFO = 0o010000

ConstantIFCHR[src]

Source Code

Source code
pub const IFCHR = 0o020000

ConstantIFDIR[src]

Source Code

Source code
pub const IFDIR = 0o040000

ConstantIFBLK[src]

Source Code

Source code
pub const IFBLK = 0o060000

ConstantIFREG[src]

Source Code

Source code
pub const IFREG = 0o100000

ConstantIFLNK[src]

Source Code

Source code
pub const IFLNK = 0o120000

ConstantIFSOCK[src]

Source Code

Source code
pub const IFSOCK = 0o140000

ConstantIFDOOR[src]

SunOS 2.6 Door

Source Code

Source code
pub const IFDOOR = 0o150000

ConstantIFPORT[src]

Solaris 10 Event Port

Source Code

Source code
pub const IFPORT = 0o160000

ConstantISUID[src]

Source Code

Source code
pub const ISUID = 0o4000

ConstantISGID[src]

Source Code

Source code
pub const ISGID = 0o2000

ConstantISVTX[src]

Source Code

Source code
pub const ISVTX = 0o1000

ConstantIRWXU[src]

Source Code

Source code
pub const IRWXU = 0o700

ConstantIRUSR[src]

Source Code

Source code
pub const IRUSR = 0o400

ConstantIWUSR[src]

Source Code

Source code
pub const IWUSR = 0o200

ConstantIXUSR[src]

Source Code

Source code
pub const IXUSR = 0o100

ConstantIRWXG[src]

Source Code

Source code
pub const IRWXG = 0o070

ConstantIRGRP[src]

Source Code

Source code
pub const IRGRP = 0o040

ConstantIWGRP[src]

Source Code

Source code
pub const IWGRP = 0o020

ConstantIXGRP[src]

Source Code

Source code
pub const IXGRP = 0o010

ConstantIRWXO[src]

Source Code

Source code
pub const IRWXO = 0o007

ConstantIROTH[src]

Source Code

Source code
pub const IROTH = 0o004

ConstantIWOTH[src]

Source Code

Source code
pub const IWOTH = 0o002

ConstantIXOTH[src]

Source Code

Source code
pub const IXOTH = 0o001

ConstantIFMT[src]

Source Code

Source code
pub const IFMT = 0o170000

ConstantIFIFO[src]

Source Code

Source code
pub const IFIFO = 0o010000

ConstantIFCHR[src]

Source Code

Source code
pub const IFCHR = 0o020000

ConstantIFDIR[src]

Source Code

Source code
pub const IFDIR = 0o040000

ConstantIFBLK[src]

Source Code

Source code
pub const IFBLK = 0o060000

ConstantIFREG[src]

Source Code

Source code
pub const IFREG = 0o100000

ConstantIFLNK[src]

Source Code

Source code
pub const IFLNK = 0o120000

ConstantIFSOCK[src]

Source Code

Source code
pub const IFSOCK = 0o140000

ConstantIFWHT[src]

Source Code

Source code
pub const IFWHT = 0o160000

ConstantISUID[src]

Source Code

Source code
pub const ISUID = 0o4000

ConstantISGID[src]

Source Code

Source code
pub const ISGID = 0o2000

ConstantISVTX[src]

Source Code

Source code
pub const ISVTX = 0o1000

ConstantIRWXU[src]

Source Code

Source code
pub const IRWXU = 0o700

ConstantIRUSR[src]

Source Code

Source code
pub const IRUSR = 0o400

ConstantIWUSR[src]

Source Code

Source code
pub const IWUSR = 0o200

ConstantIXUSR[src]

Source Code

Source code
pub const IXUSR = 0o100

ConstantIRWXG[src]

Source Code

Source code
pub const IRWXG = 0o070

ConstantIRGRP[src]

Source Code

Source code
pub const IRGRP = 0o040

ConstantIWGRP[src]

Source Code

Source code
pub const IWGRP = 0o020

ConstantIXGRP[src]

Source Code

Source code
pub const IXGRP = 0o010

ConstantIRWXO[src]

Source Code

Source code
pub const IRWXO = 0o007

ConstantIROTH[src]

Source Code

Source code
pub const IROTH = 0o004

ConstantIWOTH[src]

Source Code

Source code
pub const IWOTH = 0o002

ConstantIXOTH[src]

Source Code

Source code
pub const IXOTH = 0o001

ConstantIRUSR[src]

Source Code

Source code
pub const IRUSR = 256

ConstantIXUSR[src]

Source Code

Source code
pub const IXUSR = 64

ConstantIWUSR[src]

Source Code

Source code
pub const IWUSR = 128

ConstantIXOTH[src]

Source Code

Source code
pub const IXOTH = 1

ConstantIWOTH[src]

Source Code

Source code
pub const IWOTH = 2

ConstantIROTH[src]

Source Code

Source code
pub const IROTH = 4

ConstantIRWXO[src]

Source Code

Source code
pub const IRWXO = 7

ConstantIXGRP[src]

Source Code

Source code
pub const IXGRP = 8

ConstantIWGRP[src]

Source Code

Source code
pub const IWGRP = 16

ConstantIRGRP[src]

Source Code

Source code
pub const IRGRP = 32

ConstantIRWXG[src]

Source Code

Source code
pub const IRWXG = 56

ConstantIXUSR[src]

Source Code

Source code
pub const IXUSR = 64

ConstantIWUSR[src]

Source Code

Source code
pub const IWUSR = 128

ConstantIRUSR[src]

Source Code

Source code
pub const IRUSR = 256

ConstantIRWXU[src]

Source Code

Source code
pub const IRWXU = 448

ConstantISTXT[src]

Source Code

Source code
pub const ISTXT = 512

ConstantBLKSIZE[src]

Source Code

Source code
pub const BLKSIZE = 512

ConstantISVTX[src]

Source Code

Source code
pub const ISVTX = 512

ConstantISGID[src]

Source Code

Source code
pub const ISGID = 1024

ConstantISUID[src]

Source Code

Source code
pub const ISUID = 2048

ConstantIFIFO[src]

Source Code

Source code
pub const IFIFO = 4096

ConstantIFCHR[src]

Source Code

Source code
pub const IFCHR = 8192

ConstantIFDIR[src]

Source Code

Source code
pub const IFDIR = 16384

ConstantIFBLK[src]

Source Code

Source code
pub const IFBLK = 24576

ConstantIFREG[src]

Source Code

Source code
pub const IFREG = 32768

ConstantIFDB[src]

Source Code

Source code
pub const IFDB = 36864

ConstantIFLNK[src]

Source Code

Source code
pub const IFLNK = 40960

ConstantIFSOCK[src]

Source Code

Source code
pub const IFSOCK = 49152

ConstantIFWHT[src]

Source Code

Source code
pub const IFWHT = 57344

ConstantIFMT[src]

Source Code

Source code
pub const IFMT = 61440

ConstantIFMT[src]

Source Code

Source code
pub const IFMT = 0o170000

ConstantIFSOCK[src]

Source Code

Source code
pub const IFSOCK = 0o140000

ConstantIFLNK[src]

Source Code

Source code
pub const IFLNK = 0o120000

ConstantIFREG[src]

Source Code

Source code
pub const IFREG = 0o100000

ConstantIFBLK[src]

Source Code

Source code
pub const IFBLK = 0o060000

ConstantIFDIR[src]

Source Code

Source code
pub const IFDIR = 0o040000

ConstantIFCHR[src]

Source Code

Source code
pub const IFCHR = 0o020000

ConstantIFIFO[src]

Source Code

Source code
pub const IFIFO = 0o010000

ConstantINDEX_DIR[src]

Source Code

Source code
pub const INDEX_DIR = 0o4000000000

ConstantIUMSK[src]

Source Code

Source code
pub const IUMSK = 0o7777

ConstantISUID[src]

Source Code

Source code
pub const ISUID = 0o4000

ConstantISGID[src]

Source Code

Source code
pub const ISGID = 0o2000

ConstantISVTX[src]

Source Code

Source code
pub const ISVTX = 0o1000

ConstantIRWXU[src]

Source Code

Source code
pub const IRWXU = 0o700

ConstantIRUSR[src]

Source Code

Source code
pub const IRUSR = 0o400

ConstantIWUSR[src]

Source Code

Source code
pub const IWUSR = 0o200

ConstantIXUSR[src]

Source Code

Source code
pub const IXUSR = 0o100

ConstantIRWXG[src]

Source Code

Source code
pub const IRWXG = 0o070

ConstantIRGRP[src]

Source Code

Source code
pub const IRGRP = 0o040

ConstantIWGRP[src]

Source Code

Source code
pub const IWGRP = 0o020

ConstantIXGRP[src]

Source Code

Source code
pub const IXGRP = 0o010

ConstantIRWXO[src]

Source Code

Source code
pub const IRWXO = 0o007

ConstantIROTH[src]

Source Code

Source code
pub const IROTH = 0o004

ConstantIWOTH[src]

Source Code

Source code
pub const IWOTH = 0o002

ConstantIXOTH[src]

Source Code

Source code
pub const IXOTH = 0o001

ConstantIFMT[src]

Source Code

Source code
pub const IFMT = 0o170000

ConstantIFIFO[src]

Source Code

Source code
pub const IFIFO = 0o010000

ConstantIFCHR[src]

Source Code

Source code
pub const IFCHR = 0o020000

ConstantIFDIR[src]

Source Code

Source code
pub const IFDIR = 0o040000

ConstantIFBLK[src]

Source Code

Source code
pub const IFBLK = 0o060000

ConstantIFREG[src]

Source Code

Source code
pub const IFREG = 0o100000

ConstantIFLNK[src]

Source Code

Source code
pub const IFLNK = 0o120000

ConstantIFSOCK[src]

Source Code

Source code
pub const IFSOCK = 0o140000

ConstantISUID[src]

Source Code

Source code
pub const ISUID = 0o4000

ConstantISGID[src]

Source Code

Source code
pub const ISGID = 0o2000

ConstantISVTX[src]

Source Code

Source code
pub const ISVTX = 0o1000

ConstantIRWXU[src]

Source Code

Source code
pub const IRWXU = 0o700

ConstantIRUSR[src]

Source Code

Source code
pub const IRUSR = 0o400

ConstantIWUSR[src]

Source Code

Source code
pub const IWUSR = 0o200

ConstantIXUSR[src]

Source Code

Source code
pub const IXUSR = 0o100

ConstantIRWXG[src]

Source Code

Source code
pub const IRWXG = 0o070

ConstantIRGRP[src]

Source Code

Source code
pub const IRGRP = 0o040

ConstantIWGRP[src]

Source Code

Source code
pub const IWGRP = 0o020

ConstantIXGRP[src]

Source Code

Source code
pub const IXGRP = 0o010

ConstantIRWXO[src]

Source Code

Source code
pub const IRWXO = 0o007

ConstantIROTH[src]

Source Code

Source code
pub const IROTH = 0o004

ConstantIWOTH[src]

Source Code

Source code
pub const IWOTH = 0o002

ConstantIXOTH[src]

Source Code

Source code
pub const IXOTH = 0o001

Functions

FunctionISBLK[src]

pub fn ISBLK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISBLK(m: u32) bool {
    return m & IFMT == IFBLK;
}

FunctionISCHR[src]

pub fn ISCHR(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISCHR(m: u32) bool {
    return m & IFMT == IFCHR;
}

FunctionISDIR[src]

pub fn ISDIR(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISDIR(m: u32) bool {
    return m & IFMT == IFDIR;
}

FunctionISFIFO[src]

pub fn ISFIFO(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISFIFO(m: u32) bool {
    return m & IFMT == IFIFO;
}

FunctionISLNK[src]

pub fn ISLNK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISLNK(m: u32) bool {
    return m & IFMT == IFLNK;
}

FunctionISREG[src]

pub fn ISREG(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISREG(m: u32) bool {
    return m & IFMT == IFREG;
}

FunctionISSOCK[src]

pub fn ISSOCK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISSOCK(m: u32) bool {
    return m & IFMT == IFSOCK;
}

FunctionISFIFO[src]

pub fn ISFIFO(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISFIFO(m: u32) bool {
    return m & IFMT == IFIFO;
}

FunctionISCHR[src]

pub fn ISCHR(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISCHR(m: u32) bool {
    return m & IFMT == IFCHR;
}

FunctionISDIR[src]

pub fn ISDIR(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISDIR(m: u32) bool {
    return m & IFMT == IFDIR;
}

FunctionISBLK[src]

pub fn ISBLK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISBLK(m: u32) bool {
    return m & IFMT == IFBLK;
}

FunctionISREG[src]

pub fn ISREG(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISREG(m: u32) bool {
    return m & IFMT == IFREG;
}

FunctionISLNK[src]

pub fn ISLNK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISLNK(m: u32) bool {
    return m & IFMT == IFLNK;
}

FunctionISSOCK[src]

pub fn ISSOCK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISSOCK(m: u32) bool {
    return m & IFMT == IFSOCK;
}

FunctionIWHT[src]

pub fn IWHT(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn IWHT(m: u32) bool {
    return m & IFMT == IFWHT;
}

FunctionISFIFO[src]

pub fn ISFIFO(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISFIFO(m: u32) bool {
    return m & IFMT == IFIFO;
}

FunctionISCHR[src]

pub fn ISCHR(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISCHR(m: u32) bool {
    return m & IFMT == IFCHR;
}

FunctionISDIR[src]

pub fn ISDIR(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISDIR(m: u32) bool {
    return m & IFMT == IFDIR;
}

FunctionISBLK[src]

pub fn ISBLK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISBLK(m: u32) bool {
    return m & IFMT == IFBLK;
}

FunctionISREG[src]

pub fn ISREG(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISREG(m: u32) bool {
    return m & IFMT == IFREG;
}

FunctionISLNK[src]

pub fn ISLNK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISLNK(m: u32) bool {
    return m & IFMT == IFLNK;
}

FunctionISSOCK[src]

pub fn ISSOCK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISSOCK(m: u32) bool {
    return m & IFMT == IFSOCK;
}

FunctionIWHT[src]

pub fn IWHT(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn IWHT(m: u32) bool {
    return m & IFMT == IFWHT;
}

FunctionISFIFO[src]

pub fn ISFIFO(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISFIFO(m: u32) bool {
    return m & IFMT == IFIFO;
}

FunctionISCHR[src]

pub fn ISCHR(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISCHR(m: u32) bool {
    return m & IFMT == IFCHR;
}

FunctionISDIR[src]

pub fn ISDIR(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISDIR(m: u32) bool {
    return m & IFMT == IFDIR;
}

FunctionISBLK[src]

pub fn ISBLK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISBLK(m: u32) bool {
    return m & IFMT == IFBLK;
}

FunctionISREG[src]

pub fn ISREG(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISREG(m: u32) bool {
    return m & IFMT == IFREG;
}

FunctionISLNK[src]

pub fn ISLNK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISLNK(m: u32) bool {
    return m & IFMT == IFLNK;
}

FunctionISSOCK[src]

pub fn ISSOCK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISSOCK(m: u32) bool {
    return m & IFMT == IFSOCK;
}

FunctionISDOOR[src]

pub fn ISDOOR(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISDOOR(m: u32) bool {
    return m & IFMT == IFDOOR;
}

FunctionISPORT[src]

pub fn ISPORT(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISPORT(m: u32) bool {
    return m & IFMT == IFPORT;
}

FunctionISFIFO[src]

pub fn ISFIFO(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISFIFO(m: u32) bool {
    return m & IFMT == IFIFO;
}

FunctionISCHR[src]

pub fn ISCHR(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISCHR(m: u32) bool {
    return m & IFMT == IFCHR;
}

FunctionISDIR[src]

pub fn ISDIR(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISDIR(m: u32) bool {
    return m & IFMT == IFDIR;
}

FunctionISBLK[src]

pub fn ISBLK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISBLK(m: u32) bool {
    return m & IFMT == IFBLK;
}

FunctionISREG[src]

pub fn ISREG(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISREG(m: u32) bool {
    return m & IFMT == IFREG;
}

FunctionISLNK[src]

pub fn ISLNK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISLNK(m: u32) bool {
    return m & IFMT == IFLNK;
}

FunctionISSOCK[src]

pub fn ISSOCK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISSOCK(m: u32) bool {
    return m & IFMT == IFSOCK;
}

FunctionIWHT[src]

pub fn IWHT(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn IWHT(m: u32) bool {
    return m & IFMT == IFWHT;
}

FunctionISCHR[src]

pub fn ISCHR(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISCHR(m: u32) bool {
    return m & IFMT == IFCHR;
}

FunctionISREG[src]

pub fn ISREG(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISREG(m: u32) bool {
    return m & IFMT == IFREG;
}

FunctionISLNK[src]

pub fn ISLNK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISLNK(m: u32) bool {
    return m & IFMT == IFLNK;
}

FunctionISBLK[src]

pub fn ISBLK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISBLK(m: u32) bool {
    return m & IFMT == IFBLK;
}

FunctionISDIR[src]

pub fn ISDIR(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISDIR(m: u32) bool {
    return m & IFMT == IFDIR;
}

FunctionISCHR[src]

pub fn ISCHR(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISCHR(m: u32) bool {
    return m & IFMT == IFCHR;
}

FunctionISFIFO[src]

pub fn ISFIFO(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISFIFO(m: u32) bool {
    return m & IFMT == IFIFO;
}

FunctionISSOCK[src]

pub fn ISSOCK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISSOCK(m: u32) bool {
    return m & IFMT == IFSOCK;
}

FunctionISINDEX[src]

pub fn ISINDEX(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISINDEX(m: u32) bool {
    return m & INDEX_DIR == INDEX_DIR;
}

FunctionISFIFO[src]

pub fn ISFIFO(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISFIFO(m: u32) bool {
    return m & IFMT == IFIFO;
}

FunctionISCHR[src]

pub fn ISCHR(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISCHR(m: u32) bool {
    return m & IFMT == IFCHR;
}

FunctionISDIR[src]

pub fn ISDIR(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISDIR(m: u32) bool {
    return m & IFMT == IFDIR;
}

FunctionISBLK[src]

pub fn ISBLK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISBLK(m: u32) bool {
    return m & IFMT == IFBLK;
}

FunctionISREG[src]

pub fn ISREG(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISREG(m: u32) bool {
    return m & IFMT == IFREG;
}

FunctionISLNK[src]

pub fn ISLNK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISLNK(m: u32) bool {
    return m & IFMT == IFLNK;
}

FunctionISSOCK[src]

pub fn ISSOCK(m: u32) bool

Parameters

m: u32

Source Code

Source code
pub fn ISSOCK(m: u32) bool {
    return m & IFMT == IFSOCK;
}

Source Code

Source code
pub const S = switch (native_os) {
    .linux => linux.S,
    .emscripten => emscripten.S,
    .wasi => struct {
        // Match `S_*` constants from lib/libc/include/wasm-wasi-musl/__mode_t.h
        pub const IFBLK = 0x6000;
        pub const IFCHR = 0x2000;
        pub const IFDIR = 0x4000;
        pub const IFIFO = 0x1000;
        pub const IFLNK = 0xa000;
        pub const IFMT = IFBLK | IFCHR | IFDIR | IFIFO | IFLNK | IFREG | IFSOCK;
        pub const IFREG = 0x8000;
        pub const IFSOCK = 0xc000;

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }
    },
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const IFMT = 0o170000;

        pub const IFIFO = 0o010000;
        pub const IFCHR = 0o020000;
        pub const IFDIR = 0o040000;
        pub const IFBLK = 0o060000;
        pub const IFREG = 0o100000;
        pub const IFLNK = 0o120000;
        pub const IFSOCK = 0o140000;
        pub const IFWHT = 0o160000;

        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }

        pub fn IWHT(m: u32) bool {
            return m & IFMT == IFWHT;
        }
    },
    .freebsd => struct {
        pub const IFMT = 0o170000;

        pub const IFIFO = 0o010000;
        pub const IFCHR = 0o020000;
        pub const IFDIR = 0o040000;
        pub const IFBLK = 0o060000;
        pub const IFREG = 0o100000;
        pub const IFLNK = 0o120000;
        pub const IFSOCK = 0o140000;
        pub const IFWHT = 0o160000;

        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }

        pub fn IWHT(m: u32) bool {
            return m & IFMT == IFWHT;
        }
    },
    .solaris, .illumos => struct {
        pub const IFMT = 0o170000;

        pub const IFIFO = 0o010000;
        pub const IFCHR = 0o020000;
        pub const IFDIR = 0o040000;
        pub const IFBLK = 0o060000;
        pub const IFREG = 0o100000;
        pub const IFLNK = 0o120000;
        pub const IFSOCK = 0o140000;
        /// SunOS 2.6 Door
        pub const IFDOOR = 0o150000;
        /// Solaris 10 Event Port
        pub const IFPORT = 0o160000;

        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }

        pub fn ISDOOR(m: u32) bool {
            return m & IFMT == IFDOOR;
        }

        pub fn ISPORT(m: u32) bool {
            return m & IFMT == IFPORT;
        }
    },
    .netbsd => struct {
        pub const IFMT = 0o170000;

        pub const IFIFO = 0o010000;
        pub const IFCHR = 0o020000;
        pub const IFDIR = 0o040000;
        pub const IFBLK = 0o060000;
        pub const IFREG = 0o100000;
        pub const IFLNK = 0o120000;
        pub const IFSOCK = 0o140000;
        pub const IFWHT = 0o160000;

        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }

        pub fn IWHT(m: u32) bool {
            return m & IFMT == IFWHT;
        }
    },
    .dragonfly => struct {
        pub const IREAD = IRUSR;
        pub const IEXEC = IXUSR;
        pub const IWRITE = IWUSR;
        pub const IXOTH = 1;
        pub const IWOTH = 2;
        pub const IROTH = 4;
        pub const IRWXO = 7;
        pub const IXGRP = 8;
        pub const IWGRP = 16;
        pub const IRGRP = 32;
        pub const IRWXG = 56;
        pub const IXUSR = 64;
        pub const IWUSR = 128;
        pub const IRUSR = 256;
        pub const IRWXU = 448;
        pub const ISTXT = 512;
        pub const BLKSIZE = 512;
        pub const ISVTX = 512;
        pub const ISGID = 1024;
        pub const ISUID = 2048;
        pub const IFIFO = 4096;
        pub const IFCHR = 8192;
        pub const IFDIR = 16384;
        pub const IFBLK = 24576;
        pub const IFREG = 32768;
        pub const IFDB = 36864;
        pub const IFLNK = 40960;
        pub const IFSOCK = 49152;
        pub const IFWHT = 57344;
        pub const IFMT = 61440;

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }
    },
    .haiku => struct {
        pub const IFMT = 0o170000;
        pub const IFSOCK = 0o140000;
        pub const IFLNK = 0o120000;
        pub const IFREG = 0o100000;
        pub const IFBLK = 0o060000;
        pub const IFDIR = 0o040000;
        pub const IFCHR = 0o020000;
        pub const IFIFO = 0o010000;
        pub const INDEX_DIR = 0o4000000000;

        pub const IUMSK = 0o7777;
        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }

        pub fn ISINDEX(m: u32) bool {
            return m & INDEX_DIR == INDEX_DIR;
        }
    },
    .openbsd => struct {
        pub const IFMT = 0o170000;

        pub const IFIFO = 0o010000;
        pub const IFCHR = 0o020000;
        pub const IFDIR = 0o040000;
        pub const IFBLK = 0o060000;
        pub const IFREG = 0o100000;
        pub const IFLNK = 0o120000;
        pub const IFSOCK = 0o140000;

        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }
    },
    else => void,
}

TypeSA[src]

Values

ConstantONSTACK[src]

take signal on signal stack

Source Code

Source code
pub const ONSTACK = 0x0001

ConstantRESTART[src]

restart system on signal return

Source Code

Source code
pub const RESTART = 0x0002

ConstantRESETHAND[src]

reset to SIG.DFL when taking signal

Source Code

Source code
pub const RESETHAND = 0x0004

ConstantNOCLDSTOP[src]

do not generate SIG.CHLD on child stop

Source Code

Source code
pub const NOCLDSTOP = 0x0008

ConstantNODEFER[src]

don't mask the signal we're delivering

Source Code

Source code
pub const NODEFER = 0x0010

ConstantNOCLDWAIT[src]

don't keep zombies around

Source Code

Source code
pub const NOCLDWAIT = 0x0020

ConstantSIGINFO[src]

signal handler with SIGINFO args

Source Code

Source code
pub const SIGINFO = 0x0040

ConstantUSERTRAMP[src]

do not bounce off kernel's sigtramp

Source Code

Source code
pub const USERTRAMP = 0x0100

Constant@"64REGSET"[src]

signal handler with SIGINFO args with 64bit regs information

Source Code

Source code
pub const @"64REGSET" = 0x0200

ConstantONSTACK[src]

Source Code

Source code
pub const ONSTACK = 0x0001

ConstantRESTART[src]

Source Code

Source code
pub const RESTART = 0x0002

ConstantRESETHAND[src]

Source Code

Source code
pub const RESETHAND = 0x0004

ConstantNOCLDSTOP[src]

Source Code

Source code
pub const NOCLDSTOP = 0x0008

ConstantNODEFER[src]

Source Code

Source code
pub const NODEFER = 0x0010

ConstantNOCLDWAIT[src]

Source Code

Source code
pub const NOCLDWAIT = 0x0020

ConstantSIGINFO[src]

Source Code

Source code
pub const SIGINFO = 0x0040

ConstantONSTACK[src]

Source Code

Source code
pub const ONSTACK = 0x00000001

ConstantRESETHAND[src]

Source Code

Source code
pub const RESETHAND = 0x00000002

ConstantRESTART[src]

Source Code

Source code
pub const RESTART = 0x00000004

ConstantSIGINFO[src]

Source Code

Source code
pub const SIGINFO = 0x00000008

ConstantNODEFER[src]

Source Code

Source code
pub const NODEFER = 0x00000010

ConstantNOCLDWAIT[src]

Source Code

Source code
pub const NOCLDWAIT = 0x00010000

ConstantONSTACK[src]

Source Code

Source code
pub const ONSTACK = 0x0001

ConstantRESTART[src]

Source Code

Source code
pub const RESTART = 0x0002

ConstantRESETHAND[src]

Source Code

Source code
pub const RESETHAND = 0x0004

ConstantNOCLDSTOP[src]

Source Code

Source code
pub const NOCLDSTOP = 0x0008

ConstantNODEFER[src]

Source Code

Source code
pub const NODEFER = 0x0010

ConstantNOCLDWAIT[src]

Source Code

Source code
pub const NOCLDWAIT = 0x0020

ConstantSIGINFO[src]

Source Code

Source code
pub const SIGINFO = 0x0040

ConstantONSTACK[src]

Source Code

Source code
pub const ONSTACK = 0x0001

ConstantRESTART[src]

Source Code

Source code
pub const RESTART = 0x0002

ConstantRESETHAND[src]

Source Code

Source code
pub const RESETHAND = 0x0004

ConstantNODEFER[src]

Source Code

Source code
pub const NODEFER = 0x0010

ConstantNOCLDWAIT[src]

Source Code

Source code
pub const NOCLDWAIT = 0x0020

ConstantSIGINFO[src]

Source Code

Source code
pub const SIGINFO = 0x0040

ConstantNOCLDSTOP[src]

Source Code

Source code
pub const NOCLDSTOP = 0x01

ConstantNOCLDWAIT[src]

Source Code

Source code
pub const NOCLDWAIT = 0x02

ConstantRESETHAND[src]

Source Code

Source code
pub const RESETHAND = 0x04

ConstantNODEFER[src]

Source Code

Source code
pub const NODEFER = 0x08

ConstantRESTART[src]

Source Code

Source code
pub const RESTART = 0x10

ConstantONSTACK[src]

Source Code

Source code
pub const ONSTACK = 0x20

ConstantSIGINFO[src]

Source Code

Source code
pub const SIGINFO = 0x40

ConstantNODEFER[src]

Source Code

Source code
pub const NODEFER = 0x08

ConstantONSTACK[src]

Source Code

Source code
pub const ONSTACK = 0x20

ConstantRESETHAND[src]

Source Code

Source code
pub const RESETHAND = 0x04

ConstantONSTACK[src]

Source Code

Source code
pub const ONSTACK = 0x0001

ConstantRESTART[src]

Source Code

Source code
pub const RESTART = 0x0002

ConstantRESETHAND[src]

Source Code

Source code
pub const RESETHAND = 0x0004

ConstantNOCLDSTOP[src]

Source Code

Source code
pub const NOCLDSTOP = 0x0008

ConstantNODEFER[src]

Source Code

Source code
pub const NODEFER = 0x0010

ConstantNOCLDWAIT[src]

Source Code

Source code
pub const NOCLDWAIT = 0x0020

ConstantSIGINFO[src]

Source Code

Source code
pub const SIGINFO = 0x0040

Source Code

Source code
pub const SA = switch (native_os) {
    .linux => linux.SA,
    .emscripten => emscripten.SA,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        /// take signal on signal stack
        pub const ONSTACK = 0x0001;
        /// restart system on signal return
        pub const RESTART = 0x0002;
        /// reset to SIG.DFL when taking signal
        pub const RESETHAND = 0x0004;
        /// do not generate SIG.CHLD on child stop
        pub const NOCLDSTOP = 0x0008;
        /// don't mask the signal we're delivering
        pub const NODEFER = 0x0010;
        /// don't keep zombies around
        pub const NOCLDWAIT = 0x0020;
        /// signal handler with SIGINFO args
        pub const SIGINFO = 0x0040;
        /// do not bounce off kernel's sigtramp
        pub const USERTRAMP = 0x0100;
        /// signal handler with SIGINFO args with 64bit regs information
        pub const @"64REGSET" = 0x0200;
    },
    .freebsd => struct {
        pub const ONSTACK = 0x0001;
        pub const RESTART = 0x0002;
        pub const RESETHAND = 0x0004;
        pub const NOCLDSTOP = 0x0008;
        pub const NODEFER = 0x0010;
        pub const NOCLDWAIT = 0x0020;
        pub const SIGINFO = 0x0040;
    },
    .solaris, .illumos => struct {
        pub const ONSTACK = 0x00000001;
        pub const RESETHAND = 0x00000002;
        pub const RESTART = 0x00000004;
        pub const SIGINFO = 0x00000008;
        pub const NODEFER = 0x00000010;
        pub const NOCLDWAIT = 0x00010000;
    },
    .netbsd => struct {
        pub const ONSTACK = 0x0001;
        pub const RESTART = 0x0002;
        pub const RESETHAND = 0x0004;
        pub const NOCLDSTOP = 0x0008;
        pub const NODEFER = 0x0010;
        pub const NOCLDWAIT = 0x0020;
        pub const SIGINFO = 0x0040;
    },
    .dragonfly => struct {
        pub const ONSTACK = 0x0001;
        pub const RESTART = 0x0002;
        pub const RESETHAND = 0x0004;
        pub const NODEFER = 0x0010;
        pub const NOCLDWAIT = 0x0020;
        pub const SIGINFO = 0x0040;
    },
    .haiku => struct {
        pub const NOCLDSTOP = 0x01;
        pub const NOCLDWAIT = 0x02;
        pub const RESETHAND = 0x04;
        pub const NODEFER = 0x08;
        pub const RESTART = 0x10;
        pub const ONSTACK = 0x20;
        pub const SIGINFO = 0x40;
        pub const NOMASK = NODEFER;
        pub const STACK = ONSTACK;
        pub const ONESHOT = RESETHAND;
    },
    .openbsd => struct {
        pub const ONSTACK = 0x0001;
        pub const RESTART = 0x0002;
        pub const RESETHAND = 0x0004;
        pub const NOCLDSTOP = 0x0008;
        pub const NODEFER = 0x0010;
        pub const NOCLDWAIT = 0x0020;
        pub const SIGINFO = 0x0040;
    },
    else => void,
}

Typesigval_t[src]

Source Code

Source code
pub const sigval_t = switch (native_os) {
    .netbsd, .solaris, .illumos => extern union {
        int: i32,
        ptr: ?*anyopaque,
    },
    else => void,
}

TypeSC[src]

Source Code

Source code
pub const SC = switch (native_os) {
    .linux => linux.SC,
    else => void,
}

Type_SC[src]

Source Code

Source code
pub const _SC = if (builtin.abi.isAndroid()) enum(c_int) {
    PAGESIZE = 39,
    NPROCESSORS_ONLN = 97,
} else switch (native_os) {
    .driverkit, .ios, .macos, .tvos, .visionos, .watchos => enum(c_int) {
        PAGESIZE = 29,
    },
    .dragonfly => enum(c_int) {
        PAGESIZE = 47,
    },
    .freebsd => enum(c_int) {
        PAGESIZE = 47,
    },
    .fuchsia => enum(c_int) {
        PAGESIZE = 30,
    },
    .haiku => enum(c_int) {
        PAGESIZE = 27,
    },
    .linux => enum(c_int) {
        PAGESIZE = 30,
    },
    .netbsd => enum(c_int) {
        PAGESIZE = 28,
    },
    .openbsd => enum(c_int) {
        PAGESIZE = 28,
    },
    .solaris, .illumos => enum(c_int) {
        PAGESIZE = 11,
        NPROCESSORS_ONLN = 15,
    },
    else => void,
}

TypeSEEK[src]

Values

ConstantSET[src]

Source Code

Source code
pub const SET: wasi.whence_t = .SET

ConstantCUR[src]

Source Code

Source code
pub const CUR: wasi.whence_t = .CUR

ConstantEND[src]

Source Code

Source code
pub const END: wasi.whence_t = .END

ConstantSET[src]

Source Code

Source code
pub const SET = 0

ConstantCUR[src]

Source Code

Source code
pub const CUR = 1

ConstantEND[src]

Source Code

Source code
pub const END = 2

ConstantSET[src]

Source Code

Source code
pub const SET = 0

ConstantCUR[src]

Source Code

Source code
pub const CUR = 1

ConstantEND[src]

Source Code

Source code
pub const END = 2

ConstantDATA[src]

Source Code

Source code
pub const DATA = 3

ConstantHOLE[src]

Source Code

Source code
pub const HOLE = 4

Source Code

Source code
pub const SEEK = switch (native_os) {
    .linux => linux.SEEK,
    .emscripten => emscripten.SEEK,
    .wasi => struct {
        pub const SET: wasi.whence_t = .SET;
        pub const CUR: wasi.whence_t = .CUR;
        pub const END: wasi.whence_t = .END;
    },
    .openbsd, .haiku, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .windows => struct {
        pub const SET = 0;
        pub const CUR = 1;
        pub const END = 2;
    },
    .dragonfly, .solaris, .illumos => struct {
        pub const SET = 0;
        pub const CUR = 1;
        pub const END = 2;
        pub const DATA = 3;
        pub const HOLE = 4;
    },
    else => void,
}

TypeSHUT[src]

Values

ConstantRD[src]

Source Code

Source code
pub const RD = 0

ConstantWR[src]

Source Code

Source code
pub const WR = 1

ConstantRDWR[src]

Source Code

Source code
pub const RDWR = 2

Source Code

Source code
pub const SHUT = switch (native_os) {
    .linux => linux.SHUT,
    .emscripten => emscripten.SHUT,
    else => struct {
        pub const RD = 0;
        pub const WR = 1;
        pub const RDWR = 2;
    },
}

TypeSIG[src]

Signal types

Values

ConstantINT[src]

interrupt

Source Code

Source code
pub const INT = 2

ConstantILL[src]

illegal instruction - invalid function image

Source Code

Source code
pub const ILL = 4

ConstantFPE[src]

floating point exception

Source Code

Source code
pub const FPE = 8

ConstantSEGV[src]

segment violation

Source Code

Source code
pub const SEGV = 11

ConstantTERM[src]

Software termination signal from kill

Source Code

Source code
pub const TERM = 15

ConstantBREAK[src]

Ctrl-Break sequence

Source Code

Source code
pub const BREAK = 21

ConstantABRT[src]

abnormal termination triggered by abort call

Source Code

Source code
pub const ABRT = 22

ConstantABRT_COMPAT[src]

SIGABRT compatible with other platforms, same as SIGABRT

Source Code

Source code
pub const ABRT_COMPAT = 6

ConstantDFL[src]

default signal action

Source Code

Source code
pub const DFL = 0

ConstantIGN[src]

ignore signal

Source Code

Source code
pub const IGN = 1

ConstantGET[src]

return current value

Source Code

Source code
pub const GET = 2

ConstantSGE[src]

signal gets error

Source Code

Source code
pub const SGE = 3

ConstantACK[src]

acknowledge

Source Code

Source code
pub const ACK = 4

ConstantERR[src]

Signal error value (returned by signal call on error)

Source Code

Source code
pub const ERR = -1

ConstantERR[src]

Source Code

Source code
pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize))

ConstantDFL[src]

Source Code

Source code
pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0)

ConstantIGN[src]

Source Code

Source code
pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1)

ConstantHOLD[src]

Source Code

Source code
pub const HOLD: ?Sigaction.handler_fn = @ptrFromInt(5)

ConstantBLOCK[src]

block specified signal set

Source Code

Source code
pub const BLOCK = 1

ConstantUNBLOCK[src]

unblock specified signal set

Source Code

Source code
pub const UNBLOCK = 2

ConstantSETMASK[src]

set specified signal set

Source Code

Source code
pub const SETMASK = 3

ConstantHUP[src]

hangup

Source Code

Source code
pub const HUP = 1

ConstantINT[src]

interrupt

Source Code

Source code
pub const INT = 2

ConstantQUIT[src]

quit

Source Code

Source code
pub const QUIT = 3

ConstantILL[src]

illegal instruction (not reset when caught)

Source Code

Source code
pub const ILL = 4

ConstantTRAP[src]

trace trap (not reset when caught)

Source Code

Source code
pub const TRAP = 5

ConstantABRT[src]

abort()

Source Code

Source code
pub const ABRT = 6

ConstantPOLL[src]

pollable event ([XSR] generated, not supported)

Source Code

Source code
pub const POLL = 7

ConstantABRT[src]

abort()

Source Code

Source code
pub const ABRT = 6

ConstantEMT[src]

EMT instruction

Source Code

Source code
pub const EMT = 7

ConstantFPE[src]

floating point exception

Source Code

Source code
pub const FPE = 8

ConstantKILL[src]

kill (cannot be caught or ignored)

Source Code

Source code
pub const KILL = 9

ConstantBUS[src]

bus error

Source Code

Source code
pub const BUS = 10

ConstantSEGV[src]

segmentation violation

Source Code

Source code
pub const SEGV = 11

ConstantSYS[src]

bad argument to system call

Source Code

Source code
pub const SYS = 12

ConstantPIPE[src]

write on a pipe with no one to read it

Source Code

Source code
pub const PIPE = 13

ConstantALRM[src]

alarm clock

Source Code

Source code
pub const ALRM = 14

ConstantTERM[src]

software termination signal from kill

Source Code

Source code
pub const TERM = 15

ConstantURG[src]

urgent condition on IO channel

Source Code

Source code
pub const URG = 16

ConstantSTOP[src]

sendable stop signal not from tty

Source Code

Source code
pub const STOP = 17

ConstantTSTP[src]

stop signal from tty

Source Code

Source code
pub const TSTP = 18

ConstantCONT[src]

continue a stopped process

Source Code

Source code
pub const CONT = 19

ConstantCHLD[src]

to parent on child stop or exit

Source Code

Source code
pub const CHLD = 20

ConstantTTIN[src]

to readers pgrp upon background tty read

Source Code

Source code
pub const TTIN = 21

ConstantTTOU[src]

like TTIN for output if (tp->t_local&LTOSTOP)

Source Code

Source code
pub const TTOU = 22

ConstantIO[src]

input/output possible signal

Source Code

Source code
pub const IO = 23

ConstantXCPU[src]

exceeded CPU time limit

Source Code

Source code
pub const XCPU = 24

ConstantXFSZ[src]

exceeded file size limit

Source Code

Source code
pub const XFSZ = 25

ConstantVTALRM[src]

virtual time alarm

Source Code

Source code
pub const VTALRM = 26

ConstantPROF[src]

profiling time alarm

Source Code

Source code
pub const PROF = 27

ConstantWINCH[src]

window size changes

Source Code

Source code
pub const WINCH = 28

ConstantINFO[src]

information request

Source Code

Source code
pub const INFO = 29

ConstantUSR1[src]

user defined signal 1

Source Code

Source code
pub const USR1 = 30

ConstantUSR2[src]

user defined signal 2

Source Code

Source code
pub const USR2 = 31

ConstantHUP[src]

Source Code

Source code
pub const HUP = 1

ConstantINT[src]

Source Code

Source code
pub const INT = 2

ConstantQUIT[src]

Source Code

Source code
pub const QUIT = 3

ConstantILL[src]

Source Code

Source code
pub const ILL = 4

ConstantTRAP[src]

Source Code

Source code
pub const TRAP = 5

ConstantABRT[src]

Source Code

Source code
pub const ABRT = 6

ConstantABRT[src]

Source Code

Source code
pub const ABRT = 6

ConstantEMT[src]

Source Code

Source code
pub const EMT = 7

ConstantFPE[src]

Source Code

Source code
pub const FPE = 8

ConstantKILL[src]

Source Code

Source code
pub const KILL = 9

ConstantBUS[src]

Source Code

Source code
pub const BUS = 10

ConstantSEGV[src]

Source Code

Source code
pub const SEGV = 11

ConstantSYS[src]

Source Code

Source code
pub const SYS = 12

ConstantPIPE[src]

Source Code

Source code
pub const PIPE = 13

ConstantALRM[src]

Source Code

Source code
pub const ALRM = 14

ConstantTERM[src]

Source Code

Source code
pub const TERM = 15

ConstantURG[src]

Source Code

Source code
pub const URG = 16

ConstantSTOP[src]

Source Code

Source code
pub const STOP = 17

ConstantTSTP[src]

Source Code

Source code
pub const TSTP = 18

ConstantCONT[src]

Source Code

Source code
pub const CONT = 19

ConstantCHLD[src]

Source Code

Source code
pub const CHLD = 20

ConstantTTIN[src]

Source Code

Source code
pub const TTIN = 21

ConstantTTOU[src]

Source Code

Source code
pub const TTOU = 22

ConstantIO[src]

Source Code

Source code
pub const IO = 23

ConstantXCPU[src]

Source Code

Source code
pub const XCPU = 24

ConstantXFSZ[src]

Source Code

Source code
pub const XFSZ = 25

ConstantVTALRM[src]

Source Code

Source code
pub const VTALRM = 26

ConstantPROF[src]

Source Code

Source code
pub const PROF = 27

ConstantWINCH[src]

Source Code

Source code
pub const WINCH = 28

ConstantINFO[src]

Source Code

Source code
pub const INFO = 29

ConstantUSR1[src]

Source Code

Source code
pub const USR1 = 30

ConstantUSR2[src]

Source Code

Source code
pub const USR2 = 31

ConstantTHR[src]

Source Code

Source code
pub const THR = 32

ConstantTHR[src]

Source Code

Source code
pub const THR = 32

ConstantLIBRT[src]

Source Code

Source code
pub const LIBRT = 33

ConstantRTMIN[src]

Source Code

Source code
pub const RTMIN = 65

ConstantRTMAX[src]

Source Code

Source code
pub const RTMAX = 126

ConstantBLOCK[src]

Source Code

Source code
pub const BLOCK = 1

ConstantUNBLOCK[src]

Source Code

Source code
pub const UNBLOCK = 2

ConstantSETMASK[src]

Source Code

Source code
pub const SETMASK = 3

ConstantDFL[src]

Source Code

Source code
pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0)

ConstantIGN[src]

Source Code

Source code
pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1)

ConstantERR[src]

Source Code

Source code
pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize))

ConstantWORDS[src]

Source Code

Source code
pub const WORDS = 4

ConstantMAXSIG[src]

Source Code

Source code
pub const MAXSIG = 128

ConstantDFL[src]

Source Code

Source code
pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0)

ConstantERR[src]

Source Code

Source code
pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize))

ConstantIGN[src]

Source Code

Source code
pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1)

ConstantHOLD[src]

Source Code

Source code
pub const HOLD: ?Sigaction.handler_fn = @ptrFromInt(2)

ConstantWORDS[src]

Source Code

Source code
pub const WORDS = 4

ConstantMAXSIG[src]

Source Code

Source code
pub const MAXSIG = 75

ConstantSIG_BLOCK[src]

Source Code

Source code
pub const SIG_BLOCK = 1

ConstantSIG_UNBLOCK[src]

Source Code

Source code
pub const SIG_UNBLOCK = 2

ConstantSIG_SETMASK[src]

Source Code

Source code
pub const SIG_SETMASK = 3

ConstantHUP[src]

Source Code

Source code
pub const HUP = 1

ConstantINT[src]

Source Code

Source code
pub const INT = 2

ConstantQUIT[src]

Source Code

Source code
pub const QUIT = 3

ConstantILL[src]

Source Code

Source code
pub const ILL = 4

ConstantTRAP[src]

Source Code

Source code
pub const TRAP = 5

ConstantIOT[src]

Source Code

Source code
pub const IOT = 6

ConstantABRT[src]

Source Code

Source code
pub const ABRT = 6

ConstantEMT[src]

Source Code

Source code
pub const EMT = 7

ConstantFPE[src]

Source Code

Source code
pub const FPE = 8

ConstantKILL[src]

Source Code

Source code
pub const KILL = 9

ConstantBUS[src]

Source Code

Source code
pub const BUS = 10

ConstantSEGV[src]

Source Code

Source code
pub const SEGV = 11

ConstantSYS[src]

Source Code

Source code
pub const SYS = 12

ConstantPIPE[src]

Source Code

Source code
pub const PIPE = 13

ConstantALRM[src]

Source Code

Source code
pub const ALRM = 14

ConstantTERM[src]

Source Code

Source code
pub const TERM = 15

ConstantUSR1[src]

Source Code

Source code
pub const USR1 = 16

ConstantUSR2[src]

Source Code

Source code
pub const USR2 = 17

ConstantCLD[src]

Source Code

Source code
pub const CLD = 18

ConstantCHLD[src]

Source Code

Source code
pub const CHLD = 18

ConstantPWR[src]

Source Code

Source code
pub const PWR = 19

ConstantWINCH[src]

Source Code

Source code
pub const WINCH = 20

ConstantURG[src]

Source Code

Source code
pub const URG = 21

ConstantPOLL[src]

Source Code

Source code
pub const POLL = 22

ConstantIO[src]

Source Code

Source code
pub const IO = .POLL

ConstantSTOP[src]

Source Code

Source code
pub const STOP = 23

ConstantTSTP[src]

Source Code

Source code
pub const TSTP = 24

ConstantCONT[src]

Source Code

Source code
pub const CONT = 25

ConstantTTIN[src]

Source Code

Source code
pub const TTIN = 26

ConstantTTOU[src]

Source Code

Source code
pub const TTOU = 27

ConstantVTALRM[src]

Source Code

Source code
pub const VTALRM = 28

ConstantPROF[src]

Source Code

Source code
pub const PROF = 29

ConstantXCPU[src]

Source Code

Source code
pub const XCPU = 30

ConstantXFSZ[src]

Source Code

Source code
pub const XFSZ = 31

ConstantWAITING[src]

Source Code

Source code
pub const WAITING = 32

ConstantLWP[src]

Source Code

Source code
pub const LWP = 33

ConstantFREEZE[src]

Source Code

Source code
pub const FREEZE = 34

ConstantTHAW[src]

Source Code

Source code
pub const THAW = 35

ConstantCANCEL[src]

Source Code

Source code
pub const CANCEL = 36

ConstantLOST[src]

Source Code

Source code
pub const LOST = 37

ConstantXRES[src]

Source Code

Source code
pub const XRES = 38

ConstantJVM1[src]

Source Code

Source code
pub const JVM1 = 39

ConstantJVM2[src]

Source Code

Source code
pub const JVM2 = 40

ConstantINFO[src]

Source Code

Source code
pub const INFO = 41

ConstantRTMIN[src]

Source Code

Source code
pub const RTMIN = 42

ConstantRTMAX[src]

Source Code

Source code
pub const RTMAX = 74

ConstantDFL[src]

Source Code

Source code
pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0)

ConstantIGN[src]

Source Code

Source code
pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1)

ConstantERR[src]

Source Code

Source code
pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize))

ConstantWORDS[src]

Source Code

Source code
pub const WORDS = 4

ConstantMAXSIG[src]

Source Code

Source code
pub const MAXSIG = 128

ConstantBLOCK[src]

Source Code

Source code
pub const BLOCK = 1

ConstantUNBLOCK[src]

Source Code

Source code
pub const UNBLOCK = 2

ConstantSETMASK[src]

Source Code

Source code
pub const SETMASK = 3

ConstantHUP[src]

Source Code

Source code
pub const HUP = 1

ConstantINT[src]

Source Code

Source code
pub const INT = 2

ConstantQUIT[src]

Source Code

Source code
pub const QUIT = 3

ConstantILL[src]

Source Code

Source code
pub const ILL = 4

ConstantTRAP[src]

Source Code

Source code
pub const TRAP = 5

ConstantABRT[src]

Source Code

Source code
pub const ABRT = 6

ConstantABRT[src]

Source Code

Source code
pub const ABRT = 6

ConstantEMT[src]

Source Code

Source code
pub const EMT = 7

ConstantFPE[src]

Source Code

Source code
pub const FPE = 8

ConstantKILL[src]

Source Code

Source code
pub const KILL = 9

ConstantBUS[src]

Source Code

Source code
pub const BUS = 10

ConstantSEGV[src]

Source Code

Source code
pub const SEGV = 11

ConstantSYS[src]

Source Code

Source code
pub const SYS = 12

ConstantPIPE[src]

Source Code

Source code
pub const PIPE = 13

ConstantALRM[src]

Source Code

Source code
pub const ALRM = 14

ConstantTERM[src]

Source Code

Source code
pub const TERM = 15

ConstantURG[src]

Source Code

Source code
pub const URG = 16

ConstantSTOP[src]

Source Code

Source code
pub const STOP = 17

ConstantTSTP[src]

Source Code

Source code
pub const TSTP = 18

ConstantCONT[src]

Source Code

Source code
pub const CONT = 19

ConstantCHLD[src]

Source Code

Source code
pub const CHLD = 20

ConstantTTIN[src]

Source Code

Source code
pub const TTIN = 21

ConstantTTOU[src]

Source Code

Source code
pub const TTOU = 22

ConstantIO[src]

Source Code

Source code
pub const IO = 23

ConstantXCPU[src]

Source Code

Source code
pub const XCPU = 24

ConstantXFSZ[src]

Source Code

Source code
pub const XFSZ = 25

ConstantVTALRM[src]

Source Code

Source code
pub const VTALRM = 26

ConstantPROF[src]

Source Code

Source code
pub const PROF = 27

ConstantWINCH[src]

Source Code

Source code
pub const WINCH = 28

ConstantINFO[src]

Source Code

Source code
pub const INFO = 29

ConstantUSR1[src]

Source Code

Source code
pub const USR1 = 30

ConstantUSR2[src]

Source Code

Source code
pub const USR2 = 31

ConstantPWR[src]

Source Code

Source code
pub const PWR = 32

ConstantRTMIN[src]

Source Code

Source code
pub const RTMIN = 33

ConstantRTMAX[src]

Source Code

Source code
pub const RTMAX = 63

ConstantDFL[src]

Source Code

Source code
pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0)

ConstantIGN[src]

Source Code

Source code
pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1)

ConstantERR[src]

Source Code

Source code
pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize))

ConstantBLOCK[src]

Source Code

Source code
pub const BLOCK = 1

ConstantUNBLOCK[src]

Source Code

Source code
pub const UNBLOCK = 2

ConstantSETMASK[src]

Source Code

Source code
pub const SETMASK = 3

ConstantABRT[src]

Source Code

Source code
pub const ABRT = 6

ConstantHUP[src]

Source Code

Source code
pub const HUP = 1

ConstantINT[src]

Source Code

Source code
pub const INT = 2

ConstantQUIT[src]

Source Code

Source code
pub const QUIT = 3

ConstantILL[src]

Source Code

Source code
pub const ILL = 4

ConstantTRAP[src]

Source Code

Source code
pub const TRAP = 5

ConstantABRT[src]

Source Code

Source code
pub const ABRT = 6

ConstantEMT[src]

Source Code

Source code
pub const EMT = 7

ConstantFPE[src]

Source Code

Source code
pub const FPE = 8

ConstantKILL[src]

Source Code

Source code
pub const KILL = 9

ConstantBUS[src]

Source Code

Source code
pub const BUS = 10

ConstantSEGV[src]

Source Code

Source code
pub const SEGV = 11

ConstantSYS[src]

Source Code

Source code
pub const SYS = 12

ConstantPIPE[src]

Source Code

Source code
pub const PIPE = 13

ConstantALRM[src]

Source Code

Source code
pub const ALRM = 14

ConstantTERM[src]

Source Code

Source code
pub const TERM = 15

ConstantURG[src]

Source Code

Source code
pub const URG = 16

ConstantSTOP[src]

Source Code

Source code
pub const STOP = 17

ConstantTSTP[src]

Source Code

Source code
pub const TSTP = 18

ConstantCONT[src]

Source Code

Source code
pub const CONT = 19

ConstantCHLD[src]

Source Code

Source code
pub const CHLD = 20

ConstantTTIN[src]

Source Code

Source code
pub const TTIN = 21

ConstantTTOU[src]

Source Code

Source code
pub const TTOU = 22

ConstantIO[src]

Source Code

Source code
pub const IO = 23

ConstantXCPU[src]

Source Code

Source code
pub const XCPU = 24

ConstantXFSZ[src]

Source Code

Source code
pub const XFSZ = 25

ConstantVTALRM[src]

Source Code

Source code
pub const VTALRM = 26

ConstantPROF[src]

Source Code

Source code
pub const PROF = 27

ConstantWINCH[src]

Source Code

Source code
pub const WINCH = 28

ConstantINFO[src]

Source Code

Source code
pub const INFO = 29

ConstantUSR1[src]

Source Code

Source code
pub const USR1 = 30

ConstantUSR2[src]

Source Code

Source code
pub const USR2 = 31

ConstantTHR[src]

Source Code

Source code
pub const THR = 32

ConstantCKPT[src]

Source Code

Source code
pub const CKPT = 33

ConstantCKPTEXIT[src]

Source Code

Source code
pub const CKPTEXIT = 34

ConstantWORDS[src]

Source Code

Source code
pub const WORDS = 4

ConstantDFL[src]

Source Code

Source code
pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0)

ConstantIGN[src]

Source Code

Source code
pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1)

ConstantERR[src]

Source Code

Source code
pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize))

ConstantHOLD[src]

Source Code

Source code
pub const HOLD: ?Sigaction.handler_fn = @ptrFromInt(3)

ConstantHUP[src]

Source Code

Source code
pub const HUP = 1

ConstantINT[src]

Source Code

Source code
pub const INT = 2

ConstantQUIT[src]

Source Code

Source code
pub const QUIT = 3

ConstantILL[src]

Source Code

Source code
pub const ILL = 4

ConstantCHLD[src]

Source Code

Source code
pub const CHLD = 5

ConstantABRT[src]

Source Code

Source code
pub const ABRT = 6

ConstantABRT[src]

Source Code

Source code
pub const ABRT = 6

ConstantPIPE[src]

Source Code

Source code
pub const PIPE = 7

ConstantFPE[src]

Source Code

Source code
pub const FPE = 8

ConstantKILL[src]

Source Code

Source code
pub const KILL = 9

ConstantSTOP[src]

Source Code

Source code
pub const STOP = 10

ConstantSEGV[src]

Source Code

Source code
pub const SEGV = 11

ConstantCONT[src]

Source Code

Source code
pub const CONT = 12

ConstantTSTP[src]

Source Code

Source code
pub const TSTP = 13

ConstantALRM[src]

Source Code

Source code
pub const ALRM = 14

ConstantTERM[src]

Source Code

Source code
pub const TERM = 15

ConstantTTIN[src]

Source Code

Source code
pub const TTIN = 16

ConstantTTOU[src]

Source Code

Source code
pub const TTOU = 17

ConstantUSR1[src]

Source Code

Source code
pub const USR1 = 18

ConstantUSR2[src]

Source Code

Source code
pub const USR2 = 19

ConstantWINCH[src]

Source Code

Source code
pub const WINCH = 20

ConstantKILLTHR[src]

Source Code

Source code
pub const KILLTHR = 21

ConstantTRAP[src]

Source Code

Source code
pub const TRAP = 22

ConstantPOLL[src]

Source Code

Source code
pub const POLL = 23

ConstantPROF[src]

Source Code

Source code
pub const PROF = 24

ConstantSYS[src]

Source Code

Source code
pub const SYS = 25

ConstantURG[src]

Source Code

Source code
pub const URG = 26

ConstantVTALRM[src]

Source Code

Source code
pub const VTALRM = 27

ConstantXCPU[src]

Source Code

Source code
pub const XCPU = 28

ConstantXFSZ[src]

Source Code

Source code
pub const XFSZ = 29

ConstantBUS[src]

Source Code

Source code
pub const BUS = 30

ConstantRESERVED1[src]

Source Code

Source code
pub const RESERVED1 = 31

ConstantRESERVED2[src]

Source Code

Source code
pub const RESERVED2 = 32

ConstantBLOCK[src]

Source Code

Source code
pub const BLOCK = 1

ConstantUNBLOCK[src]

Source Code

Source code
pub const UNBLOCK = 2

ConstantSETMASK[src]

Source Code

Source code
pub const SETMASK = 3

ConstantDFL[src]

Source Code

Source code
pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0)

ConstantIGN[src]

Source Code

Source code
pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1)

ConstantERR[src]

Source Code

Source code
pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize))

ConstantCATCH[src]

Source Code

Source code
pub const CATCH: ?Sigaction.handler_fn = @ptrFromInt(2)

ConstantHOLD[src]

Source Code

Source code
pub const HOLD: ?Sigaction.handler_fn = @ptrFromInt(3)

ConstantHUP[src]

Source Code

Source code
pub const HUP = 1

ConstantINT[src]

Source Code

Source code
pub const INT = 2

ConstantQUIT[src]

Source Code

Source code
pub const QUIT = 3

ConstantILL[src]

Source Code

Source code
pub const ILL = 4

ConstantTRAP[src]

Source Code

Source code
pub const TRAP = 5

ConstantABRT[src]

Source Code

Source code
pub const ABRT = 6

ConstantABRT[src]

Source Code

Source code
pub const ABRT = 6

ConstantEMT[src]

Source Code

Source code
pub const EMT = 7

ConstantFPE[src]

Source Code

Source code
pub const FPE = 8

ConstantKILL[src]

Source Code

Source code
pub const KILL = 9

ConstantBUS[src]

Source Code

Source code
pub const BUS = 10

ConstantSEGV[src]

Source Code

Source code
pub const SEGV = 11

ConstantSYS[src]

Source Code

Source code
pub const SYS = 12

ConstantPIPE[src]

Source Code

Source code
pub const PIPE = 13

ConstantALRM[src]

Source Code

Source code
pub const ALRM = 14

ConstantTERM[src]

Source Code

Source code
pub const TERM = 15

ConstantURG[src]

Source Code

Source code
pub const URG = 16

ConstantSTOP[src]

Source Code

Source code
pub const STOP = 17

ConstantTSTP[src]

Source Code

Source code
pub const TSTP = 18

ConstantCONT[src]

Source Code

Source code
pub const CONT = 19

ConstantCHLD[src]

Source Code

Source code
pub const CHLD = 20

ConstantTTIN[src]

Source Code

Source code
pub const TTIN = 21

ConstantTTOU[src]

Source Code

Source code
pub const TTOU = 22

ConstantIO[src]

Source Code

Source code
pub const IO = 23

ConstantXCPU[src]

Source Code

Source code
pub const XCPU = 24

ConstantXFSZ[src]

Source Code

Source code
pub const XFSZ = 25

ConstantVTALRM[src]

Source Code

Source code
pub const VTALRM = 26

ConstantPROF[src]

Source Code

Source code
pub const PROF = 27

ConstantWINCH[src]

Source Code

Source code
pub const WINCH = 28

ConstantINFO[src]

Source Code

Source code
pub const INFO = 29

ConstantUSR1[src]

Source Code

Source code
pub const USR1 = 30

ConstantUSR2[src]

Source Code

Source code
pub const USR2 = 31

ConstantPWR[src]

Source Code

Source code
pub const PWR = 32

ConstantBLOCK[src]

Source Code

Source code
pub const BLOCK = 1

ConstantUNBLOCK[src]

Source Code

Source code
pub const UNBLOCK = 2

ConstantSETMASK[src]

Source Code

Source code
pub const SETMASK = 3

Functions

FunctionIDX[src]

pub inline fn IDX(sig: usize) usize

Parameters

sig: usize

Source Code

Source code
pub inline fn IDX(sig: usize) usize {
    return sig - 1;
}

FunctionWORD[src]

pub inline fn WORD(sig: usize) usize

Parameters

sig: usize

Source Code

Source code
pub inline fn WORD(sig: usize) usize {
    return IDX(sig) >> 5;
}

FunctionBIT[src]

pub inline fn BIT(sig: usize) usize

Parameters

sig: usize

Source Code

Source code
pub inline fn BIT(sig: usize) usize {
    return 1 << (IDX(sig) & 31);
}

FunctionVALID[src]

pub inline fn VALID(sig: usize) usize

Parameters

sig: usize

Source Code

Source code
pub inline fn VALID(sig: usize) usize {
    return sig <= MAXSIG and sig > 0;
}

FunctionIDX[src]

pub inline fn IDX(sig: usize) usize

Parameters

sig: usize

Source Code

Source code
pub inline fn IDX(sig: usize) usize {
    return sig - 1;
}

FunctionWORD[src]

pub inline fn WORD(sig: usize) usize

Parameters

sig: usize

Source Code

Source code
pub inline fn WORD(sig: usize) usize {
    return IDX(sig) >> 5;
}

FunctionBIT[src]

pub inline fn BIT(sig: usize) usize

Parameters

sig: usize

Source Code

Source code
pub inline fn BIT(sig: usize) usize {
    return 1 << (IDX(sig) & 31);
}

FunctionVALID[src]

pub inline fn VALID(sig: usize) usize

Parameters

sig: usize

Source Code

Source code
pub inline fn VALID(sig: usize) usize {
    return sig <= MAXSIG and sig > 0;
}

FunctionIDX[src]

pub inline fn IDX(sig: usize) usize

Parameters

sig: usize

Source Code

Source code
pub inline fn IDX(sig: usize) usize {
    return sig - 1;
}

FunctionWORD[src]

pub inline fn WORD(sig: usize) usize

Parameters

sig: usize

Source Code

Source code
pub inline fn WORD(sig: usize) usize {
    return IDX(sig) >> 5;
}

FunctionBIT[src]

pub inline fn BIT(sig: usize) usize

Parameters

sig: usize

Source Code

Source code
pub inline fn BIT(sig: usize) usize {
    return 1 << (IDX(sig) & 31);
}

FunctionVALID[src]

pub inline fn VALID(sig: usize) usize

Parameters

sig: usize

Source Code

Source code
pub inline fn VALID(sig: usize) usize {
    return sig <= MAXSIG and sig > 0;
}

Source Code

Source code
pub const SIG = switch (native_os) {
    .linux => linux.SIG,
    .emscripten => emscripten.SIG,
    .windows => struct {
        /// interrupt
        pub const INT = 2;
        /// illegal instruction - invalid function image
        pub const ILL = 4;
        /// floating point exception
        pub const FPE = 8;
        /// segment violation
        pub const SEGV = 11;
        /// Software termination signal from kill
        pub const TERM = 15;
        /// Ctrl-Break sequence
        pub const BREAK = 21;
        /// abnormal termination triggered by abort call
        pub const ABRT = 22;
        /// SIGABRT compatible with other platforms, same as SIGABRT
        pub const ABRT_COMPAT = 6;

        // Signal action codes
        /// default signal action
        pub const DFL = 0;
        /// ignore signal
        pub const IGN = 1;
        /// return current value
        pub const GET = 2;
        /// signal gets error
        pub const SGE = 3;
        /// acknowledge
        pub const ACK = 4;
        /// Signal error value (returned by signal call on error)
        pub const ERR = -1;
    },
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const HOLD: ?Sigaction.handler_fn = @ptrFromInt(5);

        /// block specified signal set
        pub const BLOCK = 1;
        /// unblock specified signal set
        pub const UNBLOCK = 2;
        /// set specified signal set
        pub const SETMASK = 3;
        /// hangup
        pub const HUP = 1;
        /// interrupt
        pub const INT = 2;
        /// quit
        pub const QUIT = 3;
        /// illegal instruction (not reset when caught)
        pub const ILL = 4;
        /// trace trap (not reset when caught)
        pub const TRAP = 5;
        /// abort()
        pub const ABRT = 6;
        /// pollable event ([XSR] generated, not supported)
        pub const POLL = 7;
        /// compatibility
        pub const IOT = ABRT;
        /// EMT instruction
        pub const EMT = 7;
        /// floating point exception
        pub const FPE = 8;
        /// kill (cannot be caught or ignored)
        pub const KILL = 9;
        /// bus error
        pub const BUS = 10;
        /// segmentation violation
        pub const SEGV = 11;
        /// bad argument to system call
        pub const SYS = 12;
        /// write on a pipe with no one to read it
        pub const PIPE = 13;
        /// alarm clock
        pub const ALRM = 14;
        /// software termination signal from kill
        pub const TERM = 15;
        /// urgent condition on IO channel
        pub const URG = 16;
        /// sendable stop signal not from tty
        pub const STOP = 17;
        /// stop signal from tty
        pub const TSTP = 18;
        /// continue a stopped process
        pub const CONT = 19;
        /// to parent on child stop or exit
        pub const CHLD = 20;
        /// to readers pgrp upon background tty read
        pub const TTIN = 21;
        /// like TTIN for output if (tp->t_local&LTOSTOP)
        pub const TTOU = 22;
        /// input/output possible signal
        pub const IO = 23;
        /// exceeded CPU time limit
        pub const XCPU = 24;
        /// exceeded file size limit
        pub const XFSZ = 25;
        /// virtual time alarm
        pub const VTALRM = 26;
        /// profiling time alarm
        pub const PROF = 27;
        /// window size changes
        pub const WINCH = 28;
        /// information request
        pub const INFO = 29;
        /// user defined signal 1
        pub const USR1 = 30;
        /// user defined signal 2
        pub const USR2 = 31;
    },
    .freebsd => struct {
        pub const HUP = 1;
        pub const INT = 2;
        pub const QUIT = 3;
        pub const ILL = 4;
        pub const TRAP = 5;
        pub const ABRT = 6;
        pub const IOT = ABRT;
        pub const EMT = 7;
        pub const FPE = 8;
        pub const KILL = 9;
        pub const BUS = 10;
        pub const SEGV = 11;
        pub const SYS = 12;
        pub const PIPE = 13;
        pub const ALRM = 14;
        pub const TERM = 15;
        pub const URG = 16;
        pub const STOP = 17;
        pub const TSTP = 18;
        pub const CONT = 19;
        pub const CHLD = 20;
        pub const TTIN = 21;
        pub const TTOU = 22;
        pub const IO = 23;
        pub const XCPU = 24;
        pub const XFSZ = 25;
        pub const VTALRM = 26;
        pub const PROF = 27;
        pub const WINCH = 28;
        pub const INFO = 29;
        pub const USR1 = 30;
        pub const USR2 = 31;
        pub const THR = 32;
        pub const LWP = THR;
        pub const LIBRT = 33;

        pub const RTMIN = 65;
        pub const RTMAX = 126;

        pub const BLOCK = 1;
        pub const UNBLOCK = 2;
        pub const SETMASK = 3;

        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));

        pub const WORDS = 4;
        pub const MAXSIG = 128;

        pub inline fn IDX(sig: usize) usize {
            return sig - 1;
        }
        pub inline fn WORD(sig: usize) usize {
            return IDX(sig) >> 5;
        }
        pub inline fn BIT(sig: usize) usize {
            return 1 << (IDX(sig) & 31);
        }
        pub inline fn VALID(sig: usize) usize {
            return sig <= MAXSIG and sig > 0;
        }
    },
    .solaris, .illumos => struct {
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const HOLD: ?Sigaction.handler_fn = @ptrFromInt(2);

        pub const WORDS = 4;
        pub const MAXSIG = 75;

        pub const SIG_BLOCK = 1;
        pub const SIG_UNBLOCK = 2;
        pub const SIG_SETMASK = 3;

        pub const HUP = 1;
        pub const INT = 2;
        pub const QUIT = 3;
        pub const ILL = 4;
        pub const TRAP = 5;
        pub const IOT = 6;
        pub const ABRT = 6;
        pub const EMT = 7;
        pub const FPE = 8;
        pub const KILL = 9;
        pub const BUS = 10;
        pub const SEGV = 11;
        pub const SYS = 12;
        pub const PIPE = 13;
        pub const ALRM = 14;
        pub const TERM = 15;
        pub const USR1 = 16;
        pub const USR2 = 17;
        pub const CLD = 18;
        pub const CHLD = 18;
        pub const PWR = 19;
        pub const WINCH = 20;
        pub const URG = 21;
        pub const POLL = 22;
        pub const IO = .POLL;
        pub const STOP = 23;
        pub const TSTP = 24;
        pub const CONT = 25;
        pub const TTIN = 26;
        pub const TTOU = 27;
        pub const VTALRM = 28;
        pub const PROF = 29;
        pub const XCPU = 30;
        pub const XFSZ = 31;
        pub const WAITING = 32;
        pub const LWP = 33;
        pub const FREEZE = 34;
        pub const THAW = 35;
        pub const CANCEL = 36;
        pub const LOST = 37;
        pub const XRES = 38;
        pub const JVM1 = 39;
        pub const JVM2 = 40;
        pub const INFO = 41;

        pub const RTMIN = 42;
        pub const RTMAX = 74;

        pub inline fn IDX(sig: usize) usize {
            return sig - 1;
        }
        pub inline fn WORD(sig: usize) usize {
            return IDX(sig) >> 5;
        }
        pub inline fn BIT(sig: usize) usize {
            return 1 << (IDX(sig) & 31);
        }
        pub inline fn VALID(sig: usize) usize {
            return sig <= MAXSIG and sig > 0;
        }
    },
    .netbsd => struct {
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));

        pub const WORDS = 4;
        pub const MAXSIG = 128;

        pub const BLOCK = 1;
        pub const UNBLOCK = 2;
        pub const SETMASK = 3;

        pub const HUP = 1;
        pub const INT = 2;
        pub const QUIT = 3;
        pub const ILL = 4;
        pub const TRAP = 5;
        pub const ABRT = 6;
        pub const IOT = ABRT;
        pub const EMT = 7;
        pub const FPE = 8;
        pub const KILL = 9;
        pub const BUS = 10;
        pub const SEGV = 11;
        pub const SYS = 12;
        pub const PIPE = 13;
        pub const ALRM = 14;
        pub const TERM = 15;
        pub const URG = 16;
        pub const STOP = 17;
        pub const TSTP = 18;
        pub const CONT = 19;
        pub const CHLD = 20;
        pub const TTIN = 21;
        pub const TTOU = 22;
        pub const IO = 23;
        pub const XCPU = 24;
        pub const XFSZ = 25;
        pub const VTALRM = 26;
        pub const PROF = 27;
        pub const WINCH = 28;
        pub const INFO = 29;
        pub const USR1 = 30;
        pub const USR2 = 31;
        pub const PWR = 32;

        pub const RTMIN = 33;
        pub const RTMAX = 63;

        pub inline fn IDX(sig: usize) usize {
            return sig - 1;
        }
        pub inline fn WORD(sig: usize) usize {
            return IDX(sig) >> 5;
        }
        pub inline fn BIT(sig: usize) usize {
            return 1 << (IDX(sig) & 31);
        }
        pub inline fn VALID(sig: usize) usize {
            return sig <= MAXSIG and sig > 0;
        }
    },
    .dragonfly => struct {
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));

        pub const BLOCK = 1;
        pub const UNBLOCK = 2;
        pub const SETMASK = 3;

        pub const IOT = ABRT;
        pub const HUP = 1;
        pub const INT = 2;
        pub const QUIT = 3;
        pub const ILL = 4;
        pub const TRAP = 5;
        pub const ABRT = 6;
        pub const EMT = 7;
        pub const FPE = 8;
        pub const KILL = 9;
        pub const BUS = 10;
        pub const SEGV = 11;
        pub const SYS = 12;
        pub const PIPE = 13;
        pub const ALRM = 14;
        pub const TERM = 15;
        pub const URG = 16;
        pub const STOP = 17;
        pub const TSTP = 18;
        pub const CONT = 19;
        pub const CHLD = 20;
        pub const TTIN = 21;
        pub const TTOU = 22;
        pub const IO = 23;
        pub const XCPU = 24;
        pub const XFSZ = 25;
        pub const VTALRM = 26;
        pub const PROF = 27;
        pub const WINCH = 28;
        pub const INFO = 29;
        pub const USR1 = 30;
        pub const USR2 = 31;
        pub const THR = 32;
        pub const CKPT = 33;
        pub const CKPTEXIT = 34;

        pub const WORDS = 4;
    },
    .haiku => struct {
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));

        pub const HOLD: ?Sigaction.handler_fn = @ptrFromInt(3);

        pub const HUP = 1;
        pub const INT = 2;
        pub const QUIT = 3;
        pub const ILL = 4;
        pub const CHLD = 5;
        pub const ABRT = 6;
        pub const IOT = ABRT;
        pub const PIPE = 7;
        pub const FPE = 8;
        pub const KILL = 9;
        pub const STOP = 10;
        pub const SEGV = 11;
        pub const CONT = 12;
        pub const TSTP = 13;
        pub const ALRM = 14;
        pub const TERM = 15;
        pub const TTIN = 16;
        pub const TTOU = 17;
        pub const USR1 = 18;
        pub const USR2 = 19;
        pub const WINCH = 20;
        pub const KILLTHR = 21;
        pub const TRAP = 22;
        pub const POLL = 23;
        pub const PROF = 24;
        pub const SYS = 25;
        pub const URG = 26;
        pub const VTALRM = 27;
        pub const XCPU = 28;
        pub const XFSZ = 29;
        pub const BUS = 30;
        pub const RESERVED1 = 31;
        pub const RESERVED2 = 32;

        pub const BLOCK = 1;
        pub const UNBLOCK = 2;
        pub const SETMASK = 3;
    },
    .openbsd => struct {
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));
        pub const CATCH: ?Sigaction.handler_fn = @ptrFromInt(2);
        pub const HOLD: ?Sigaction.handler_fn = @ptrFromInt(3);

        pub const HUP = 1;
        pub const INT = 2;
        pub const QUIT = 3;
        pub const ILL = 4;
        pub const TRAP = 5;
        pub const ABRT = 6;
        pub const IOT = ABRT;
        pub const EMT = 7;
        pub const FPE = 8;
        pub const KILL = 9;
        pub const BUS = 10;
        pub const SEGV = 11;
        pub const SYS = 12;
        pub const PIPE = 13;
        pub const ALRM = 14;
        pub const TERM = 15;
        pub const URG = 16;
        pub const STOP = 17;
        pub const TSTP = 18;
        pub const CONT = 19;
        pub const CHLD = 20;
        pub const TTIN = 21;
        pub const TTOU = 22;
        pub const IO = 23;
        pub const XCPU = 24;
        pub const XFSZ = 25;
        pub const VTALRM = 26;
        pub const PROF = 27;
        pub const WINCH = 28;
        pub const INFO = 29;
        pub const USR1 = 30;
        pub const USR2 = 31;
        pub const PWR = 32;

        pub const BLOCK = 1;
        pub const UNBLOCK = 2;
        pub const SETMASK = 3;
    },
    else => void,
}

TypeSIOCGIFINDEX[src]

Source Code

Source code
pub const SIOCGIFINDEX = switch (native_os) {
    .linux => linux.SIOCGIFINDEX,
    .emscripten => emscripten.SIOCGIFINDEX,
    .solaris, .illumos => solaris.SIOCGLIFINDEX,
    else => void,
}

TypeSYS[src]

Source Code

Source code
pub const SYS = switch (native_os) {
    .linux => linux.SYS,
    else => void,
}

TypeSigaction[src]

Renamed from sigaction to Sigaction to avoid conflict with function name.

Types

Typehandler_fn[src]

Source Code

Source code
pub const handler_fn = *align(1) const fn (i32) callconv(.c) void

Typesigaction_fn[src]

Source Code

Source code
pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void

Typehandler_fn[src]

Source Code

Source code
pub const handler_fn = *align(1) const fn (i32) callconv(.c) void

Typesigaction_fn[src]

Source Code

Source code
pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void

Typehandler_fn[src]

Source Code

Source code
pub const handler_fn = *align(1) const fn (i32) callconv(.c) void

Typesigaction_fn[src]

Source Code

Source code
pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void

Typehandler_fn[src]

Source Code

Source code
pub const handler_fn = *align(1) const fn (i32) callconv(.c) void

Typesigaction_fn[src]

Source Code

Source code
pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void

Typehandler_fn[src]

Source Code

Source code
pub const handler_fn = *align(1) const fn (i32) callconv(.c) void

Typesigaction_fn[src]

Source Code

Source code
pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void

Typehandler_fn[src]

Source Code

Source code
pub const handler_fn = *align(1) const fn (i32) callconv(.c) void

Typesigaction_fn[src]

Source Code

Source code
pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void

Typehandler_fn[src]

Source Code

Source code
pub const handler_fn = *align(1) const fn (i32) callconv(.c) void

Typesigaction_fn[src]

Source Code

Source code
pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void

Typehandler_fn[src]

Source Code

Source code
pub const handler_fn = *align(1) const fn (i32) callconv(.c) void

Typesigaction_fn[src]

Source Code

Source code
pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void

Source Code

Source code
pub const Sigaction = switch (native_os) {
    .linux => switch (native_arch) {
        .mips,
        .mipsel,
        .mips64,
        .mips64el,
        => if (builtin.target.abi.isMusl())
            linux.Sigaction
        else if (builtin.target.ptrBitWidth() == 64) extern struct {
            pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
            pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;

            flags: c_uint,
            handler: extern union {
                handler: ?handler_fn,
                sigaction: ?sigaction_fn,
            },
            mask: sigset_t,
            restorer: ?*const fn () callconv(.c) void = null,
        } else extern struct {
            pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
            pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;

            flags: c_uint,
            handler: extern union {
                handler: ?handler_fn,
                sigaction: ?sigaction_fn,
            },
            mask: sigset_t,
            restorer: ?*const fn () callconv(.c) void = null,
            __resv: [1]c_int = .{0},
        },
        .s390x => if (builtin.abi == .gnu) extern struct {
            pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
            pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;

            handler: extern union {
                handler: ?handler_fn,
                sigaction: ?sigaction_fn,
            },
            __glibc_reserved0: c_int = 0,
            flags: c_uint,
            restorer: ?*const fn () callconv(.c) void = null,
            mask: sigset_t,
        } else linux.Sigaction,
        else => linux.Sigaction,
    },
    .emscripten => emscripten.Sigaction,
    .netbsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
        pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;

        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },
        mask: sigset_t,
        flags: c_uint,
    },
    .dragonfly, .freebsd => extern struct {
        pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
        pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;

        /// signal handler
        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },
        /// see signal options
        flags: c_uint,
        /// signal mask to apply
        mask: sigset_t,
    },
    .solaris, .illumos => extern struct {
        pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
        pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;

        /// signal options
        flags: c_uint,
        /// signal handler
        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },
        /// signal mask to apply
        mask: sigset_t,
    },
    .haiku => extern struct {
        pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
        pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;

        /// signal handler
        handler: extern union {
            handler: handler_fn,
            sigaction: sigaction_fn,
        },

        /// signal mask to apply
        mask: sigset_t,

        /// see signal options
        flags: i32,

        /// will be passed to the signal handler, BeOS extension
        userdata: *allowzero anyopaque = undefined,
    },
    .openbsd => extern struct {
        pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
        pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;

        /// signal handler
        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },
        /// signal mask to apply
        mask: sigset_t,
        /// signal options
        flags: c_uint,
    },
    else => void,
}

TypeT[src]

Values

ConstantIOCGWINSZ[src]

Source Code

Source code
pub const IOCGWINSZ = ior(0x40000000, 't', 104, @sizeOf(winsize))

ConstantIOCEXCL[src]

Source Code

Source code
pub const IOCEXCL = 0x2000740d

ConstantIOCNXCL[src]

Source Code

Source code
pub const IOCNXCL = 0x2000740e

ConstantIOCSCTTY[src]

Source Code

Source code
pub const IOCSCTTY = 0x20007461

ConstantIOCGPGRP[src]

Source Code

Source code
pub const IOCGPGRP = 0x40047477

ConstantIOCSPGRP[src]

Source Code

Source code
pub const IOCSPGRP = 0x80047476

ConstantIOCOUTQ[src]

Source Code

Source code
pub const IOCOUTQ = 0x40047473

ConstantIOCSTI[src]

Source Code

Source code
pub const IOCSTI = 0x80017472

ConstantIOCGWINSZ[src]

Source Code

Source code
pub const IOCGWINSZ = 0x40087468

ConstantIOCSWINSZ[src]

Source Code

Source code
pub const IOCSWINSZ = 0x80087467

ConstantIOCMGET[src]

Source Code

Source code
pub const IOCMGET = 0x4004746a

ConstantIOCMBIS[src]

Source Code

Source code
pub const IOCMBIS = 0x8004746c

ConstantIOCMBIC[src]

Source Code

Source code
pub const IOCMBIC = 0x8004746b

ConstantIOCMSET[src]

Source Code

Source code
pub const IOCMSET = 0x8004746d

ConstantFIONREAD[src]

Source Code

Source code
pub const FIONREAD = 0x4004667f

ConstantIOCCONS[src]

Source Code

Source code
pub const IOCCONS = 0x80047462

ConstantIOCPKT[src]

Source Code

Source code
pub const IOCPKT = 0x80047470

ConstantFIONBIO[src]

Source Code

Source code
pub const FIONBIO = 0x8004667e

ConstantIOCNOTTY[src]

Source Code

Source code
pub const IOCNOTTY = 0x20007471

ConstantIOCSETD[src]

Source Code

Source code
pub const IOCSETD = 0x8004741b

ConstantIOCGETD[src]

Source Code

Source code
pub const IOCGETD = 0x4004741a

ConstantIOCSBRK[src]

Source Code

Source code
pub const IOCSBRK = 0x2000747b

ConstantIOCCBRK[src]

Source Code

Source code
pub const IOCCBRK = 0x2000747a

ConstantIOCGSID[src]

Source Code

Source code
pub const IOCGSID = 0x40047463

ConstantIOCGPTN[src]

Source Code

Source code
pub const IOCGPTN = 0x4004740f

ConstantIOCSIG[src]

Source Code

Source code
pub const IOCSIG = 0x2004745f

ConstantCGETA[src]

Source Code

Source code
pub const CGETA = tioc('T', 1)

ConstantCSETA[src]

Source Code

Source code
pub const CSETA = tioc('T', 2)

ConstantCSETAW[src]

Source Code

Source code
pub const CSETAW = tioc('T', 3)

ConstantCSETAF[src]

Source Code

Source code
pub const CSETAF = tioc('T', 4)

ConstantCSBRK[src]

Source Code

Source code
pub const CSBRK = tioc('T', 5)

ConstantCXONC[src]

Source Code

Source code
pub const CXONC = tioc('T', 6)

ConstantCFLSH[src]

Source Code

Source code
pub const CFLSH = tioc('T', 7)

ConstantIOCGWINSZ[src]

Source Code

Source code
pub const IOCGWINSZ = tioc('T', 104)

ConstantIOCSWINSZ[src]

Source Code

Source code
pub const IOCSWINSZ = tioc('T', 103)

ConstantIOCGSOFTCAR[src]

Source Code

Source code
pub const IOCGSOFTCAR = tioc('T', 105)

ConstantIOCSSOFTCAR[src]

Source Code

Source code
pub const IOCSSOFTCAR = tioc('T', 106)

ConstantCGETS[src]

Source Code

Source code
pub const CGETS = tioc('T', 13)

ConstantCSETS[src]

Source Code

Source code
pub const CSETS = tioc('T', 14)

ConstantCSANOW[src]

Source Code

Source code
pub const CSANOW = tioc('T', 14)

ConstantCSETSW[src]

Source Code

Source code
pub const CSETSW = tioc('T', 15)

ConstantCSADRAIN[src]

Source Code

Source code
pub const CSADRAIN = tioc('T', 15)

ConstantCSETSF[src]

Source Code

Source code
pub const CSETSF = tioc('T', 16)

ConstantIOCSETLD[src]

Source Code

Source code
pub const IOCSETLD = tioc('T', 123)

ConstantIOCGETLD[src]

Source Code

Source code
pub const IOCGETLD = tioc('T', 124)

ConstantIOCGPPS[src]

Source Code

Source code
pub const IOCGPPS = tioc('T', 125)

ConstantIOCSPPS[src]

Source Code

Source code
pub const IOCSPPS = tioc('T', 126)

ConstantIOCGPPSEV[src]

Source Code

Source code
pub const IOCGPPSEV = tioc('T', 127)

ConstantIOCGETD[src]

Source Code

Source code
pub const IOCGETD = tioc('t', 0)

ConstantIOCSETD[src]

Source Code

Source code
pub const IOCSETD = tioc('t', 1)

ConstantIOCHPCL[src]

Source Code

Source code
pub const IOCHPCL = tioc('t', 2)

ConstantIOCGETP[src]

Source Code

Source code
pub const IOCGETP = tioc('t', 8)

ConstantIOCSETP[src]

Source Code

Source code
pub const IOCSETP = tioc('t', 9)

ConstantIOCSETN[src]

Source Code

Source code
pub const IOCSETN = tioc('t', 10)

ConstantIOCEXCL[src]

Source Code

Source code
pub const IOCEXCL = tioc('t', 13)

ConstantIOCNXCL[src]

Source Code

Source code
pub const IOCNXCL = tioc('t', 14)

ConstantIOCFLUSH[src]

Source Code

Source code
pub const IOCFLUSH = tioc('t', 16)

ConstantIOCSETC[src]

Source Code

Source code
pub const IOCSETC = tioc('t', 17)

ConstantIOCGETC[src]

Source Code

Source code
pub const IOCGETC = tioc('t', 18)

ConstantIOCLBIS[src]

bis local mode bits

Source Code

Source code
pub const IOCLBIS = tioc('t', 127)

ConstantIOCLBIC[src]

bic local mode bits

Source Code

Source code
pub const IOCLBIC = tioc('t', 126)

ConstantIOCLSET[src]

set entire local mode word

Source Code

Source code
pub const IOCLSET = tioc('t', 125)

ConstantIOCLGET[src]

get local modes

Source Code

Source code
pub const IOCLGET = tioc('t', 124)

ConstantIOCSBRK[src]

set break bit

Source Code

Source code
pub const IOCSBRK = tioc('t', 123)

ConstantIOCCBRK[src]

clear break bit

Source Code

Source code
pub const IOCCBRK = tioc('t', 122)

ConstantIOCSDTR[src]

set data terminal ready

Source Code

Source code
pub const IOCSDTR = tioc('t', 121)

ConstantIOCCDTR[src]

clear data terminal ready

Source Code

Source code
pub const IOCCDTR = tioc('t', 120)

ConstantIOCSLTC[src]

set local special chars

Source Code

Source code
pub const IOCSLTC = tioc('t', 117)

ConstantIOCGLTC[src]

get local special chars

Source Code

Source code
pub const IOCGLTC = tioc('t', 116)

ConstantIOCOUTQ[src]

driver output queue size

Source Code

Source code
pub const IOCOUTQ = tioc('t', 115)

ConstantIOCNOTTY[src]

void tty association

Source Code

Source code
pub const IOCNOTTY = tioc('t', 113)

ConstantIOCSCTTY[src]

get a ctty

Source Code

Source code
pub const IOCSCTTY = tioc('t', 132)

ConstantIOCSTOP[src]

stop output, like ^S

Source Code

Source code
pub const IOCSTOP = tioc('t', 111)

ConstantIOCSTART[src]

start output, like ^Q

Source Code

Source code
pub const IOCSTART = tioc('t', 110)

ConstantIOCGPGRP[src]

get pgrp of tty

Source Code

Source code
pub const IOCGPGRP = tioc('t', 20)

ConstantIOCSPGRP[src]

set pgrp of tty

Source Code

Source code
pub const IOCSPGRP = tioc('t', 21)

ConstantIOCGSID[src]

get session id on ctty

Source Code

Source code
pub const IOCGSID = tioc('t', 22)

ConstantIOCSTI[src]

simulate terminal input

Source Code

Source code
pub const IOCSTI = tioc('t', 23)

ConstantIOCMSET[src]

set all modem bits

Source Code

Source code
pub const IOCMSET = tioc('t', 26)

ConstantIOCMBIS[src]

bis modem bits

Source Code

Source code
pub const IOCMBIS = tioc('t', 27)

ConstantIOCMBIC[src]

bic modem bits

Source Code

Source code
pub const IOCMBIC = tioc('t', 28)

ConstantIOCMGET[src]

get all modem bits

Source Code

Source code
pub const IOCMGET = tioc('t', 29)

ConstantIOCCBRK[src]

Source Code

Source code
pub const IOCCBRK = 0x2000747a

ConstantIOCCDTR[src]

Source Code

Source code
pub const IOCCDTR = 0x20007478

ConstantIOCCONS[src]

Source Code

Source code
pub const IOCCONS = 0x80047462

ConstantIOCDCDTIMESTAMP[src]

Source Code

Source code
pub const IOCDCDTIMESTAMP = 0x40107458

ConstantIOCDRAIN[src]

Source Code

Source code
pub const IOCDRAIN = 0x2000745e

ConstantIOCEXCL[src]

Source Code

Source code
pub const IOCEXCL = 0x2000740d

ConstantIOCEXT[src]

Source Code

Source code
pub const IOCEXT = 0x80047460

ConstantIOCFLAG_CDTRCTS[src]

Source Code

Source code
pub const IOCFLAG_CDTRCTS = 0x10

ConstantIOCFLAG_CLOCAL[src]

Source Code

Source code
pub const IOCFLAG_CLOCAL = 0x2

ConstantIOCFLAG_CRTSCTS[src]

Source Code

Source code
pub const IOCFLAG_CRTSCTS = 0x4

ConstantIOCFLAG_MDMBUF[src]

Source Code

Source code
pub const IOCFLAG_MDMBUF = 0x8

ConstantIOCFLAG_SOFTCAR[src]

Source Code

Source code
pub const IOCFLAG_SOFTCAR = 0x1

ConstantIOCFLUSH[src]

Source Code

Source code
pub const IOCFLUSH = 0x80047410

ConstantIOCGETA[src]

Source Code

Source code
pub const IOCGETA = 0x402c7413

ConstantIOCGETD[src]

Source Code

Source code
pub const IOCGETD = 0x4004741a

ConstantIOCGFLAGS[src]

Source Code

Source code
pub const IOCGFLAGS = 0x4004745d

ConstantIOCGLINED[src]

Source Code

Source code
pub const IOCGLINED = 0x40207442

ConstantIOCGPGRP[src]

Source Code

Source code
pub const IOCGPGRP = 0x40047477

ConstantIOCGQSIZE[src]

Source Code

Source code
pub const IOCGQSIZE = 0x40047481

ConstantIOCGRANTPT[src]

Source Code

Source code
pub const IOCGRANTPT = 0x20007447

ConstantIOCGSID[src]

Source Code

Source code
pub const IOCGSID = 0x40047463

ConstantIOCGSIZE[src]

Source Code

Source code
pub const IOCGSIZE = 0x40087468

ConstantIOCGWINSZ[src]

Source Code

Source code
pub const IOCGWINSZ = 0x40087468

ConstantIOCMBIC[src]

Source Code

Source code
pub const IOCMBIC = 0x8004746b

ConstantIOCMBIS[src]

Source Code

Source code
pub const IOCMBIS = 0x8004746c

ConstantIOCMGET[src]

Source Code

Source code
pub const IOCMGET = 0x4004746a

ConstantIOCMSET[src]

Source Code

Source code
pub const IOCMSET = 0x8004746d

ConstantIOCM_CAR[src]

Source Code

Source code
pub const IOCM_CAR = 0x40

ConstantIOCM_CD[src]

Source Code

Source code
pub const IOCM_CD = 0x40

ConstantIOCM_CTS[src]

Source Code

Source code
pub const IOCM_CTS = 0x20

ConstantIOCM_DSR[src]

Source Code

Source code
pub const IOCM_DSR = 0x100

ConstantIOCM_DTR[src]

Source Code

Source code
pub const IOCM_DTR = 0x2

ConstantIOCM_LE[src]

Source Code

Source code
pub const IOCM_LE = 0x1

ConstantIOCM_RI[src]

Source Code

Source code
pub const IOCM_RI = 0x80

ConstantIOCM_RNG[src]

Source Code

Source code
pub const IOCM_RNG = 0x80

ConstantIOCM_RTS[src]

Source Code

Source code
pub const IOCM_RTS = 0x4

ConstantIOCM_SR[src]

Source Code

Source code
pub const IOCM_SR = 0x10

ConstantIOCM_ST[src]

Source Code

Source code
pub const IOCM_ST = 0x8

ConstantIOCNOTTY[src]

Source Code

Source code
pub const IOCNOTTY = 0x20007471

ConstantIOCNXCL[src]

Source Code

Source code
pub const IOCNXCL = 0x2000740e

ConstantIOCOUTQ[src]

Source Code

Source code
pub const IOCOUTQ = 0x40047473

ConstantIOCPKT[src]

Source Code

Source code
pub const IOCPKT = 0x80047470

ConstantIOCPKT_DATA[src]

Source Code

Source code
pub const IOCPKT_DATA = 0x0

ConstantIOCPKT_DOSTOP[src]

Source Code

Source code
pub const IOCPKT_DOSTOP = 0x20

ConstantIOCPKT_FLUSHREAD[src]

Source Code

Source code
pub const IOCPKT_FLUSHREAD = 0x1

ConstantIOCPKT_FLUSHWRITE[src]

Source Code

Source code
pub const IOCPKT_FLUSHWRITE = 0x2

ConstantIOCPKT_IOCTL[src]

Source Code

Source code
pub const IOCPKT_IOCTL = 0x40

ConstantIOCPKT_NOSTOP[src]

Source Code

Source code
pub const IOCPKT_NOSTOP = 0x10

ConstantIOCPKT_START[src]

Source Code

Source code
pub const IOCPKT_START = 0x8

ConstantIOCPKT_STOP[src]

Source Code

Source code
pub const IOCPKT_STOP = 0x4

ConstantIOCPTMGET[src]

Source Code

Source code
pub const IOCPTMGET = 0x40287446

ConstantIOCPTSNAME[src]

Source Code

Source code
pub const IOCPTSNAME = 0x40287448

ConstantIOCRCVFRAME[src]

Source Code

Source code
pub const IOCRCVFRAME = 0x80087445

ConstantIOCREMOTE[src]

Source Code

Source code
pub const IOCREMOTE = 0x80047469

ConstantIOCSBRK[src]

Source Code

Source code
pub const IOCSBRK = 0x2000747b

ConstantIOCSCTTY[src]

Source Code

Source code
pub const IOCSCTTY = 0x20007461

ConstantIOCSDTR[src]

Source Code

Source code
pub const IOCSDTR = 0x20007479

ConstantIOCSETA[src]

Source Code

Source code
pub const IOCSETA = 0x802c7414

ConstantIOCSETAF[src]

Source Code

Source code
pub const IOCSETAF = 0x802c7416

ConstantIOCSETAW[src]

Source Code

Source code
pub const IOCSETAW = 0x802c7415

ConstantIOCSETD[src]

Source Code

Source code
pub const IOCSETD = 0x8004741b

ConstantIOCSFLAGS[src]

Source Code

Source code
pub const IOCSFLAGS = 0x8004745c

ConstantIOCSIG[src]

Source Code

Source code
pub const IOCSIG = 0x2000745f

ConstantIOCSLINED[src]

Source Code

Source code
pub const IOCSLINED = 0x80207443

ConstantIOCSPGRP[src]

Source Code

Source code
pub const IOCSPGRP = 0x80047476

ConstantIOCSQSIZE[src]

Source Code

Source code
pub const IOCSQSIZE = 0x80047480

ConstantIOCSSIZE[src]

Source Code

Source code
pub const IOCSSIZE = 0x80087467

ConstantIOCSTART[src]

Source Code

Source code
pub const IOCSTART = 0x2000746e

ConstantIOCSTAT[src]

Source Code

Source code
pub const IOCSTAT = 0x80047465

ConstantIOCSTI[src]

Source Code

Source code
pub const IOCSTI = 0x80017472

ConstantIOCSTOP[src]

Source Code

Source code
pub const IOCSTOP = 0x2000746f

ConstantIOCSWINSZ[src]

Source Code

Source code
pub const IOCSWINSZ = 0x80087467

ConstantIOCUCNTL[src]

Source Code

Source code
pub const IOCUCNTL = 0x80047466

ConstantIOCXMTFRAME[src]

Source Code

Source code
pub const IOCXMTFRAME = 0x80087444

ConstantCGETA[src]

Source Code

Source code
pub const CGETA = 0x8000

ConstantCSETA[src]

Source Code

Source code
pub const CSETA = 0x8001

ConstantCSETAF[src]

Source Code

Source code
pub const CSETAF = 0x8002

ConstantCSETAW[src]

Source Code

Source code
pub const CSETAW = 0x8003

ConstantCWAITEVENT[src]

Source Code

Source code
pub const CWAITEVENT = 0x8004

ConstantCSBRK[src]

Source Code

Source code
pub const CSBRK = 0x8005

ConstantCFLSH[src]

Source Code

Source code
pub const CFLSH = 0x8006

ConstantCXONC[src]

Source Code

Source code
pub const CXONC = 0x8007

ConstantCQUERYCONNECTED[src]

Source Code

Source code
pub const CQUERYCONNECTED = 0x8008

ConstantCGETBITS[src]

Source Code

Source code
pub const CGETBITS = 0x8009

ConstantCSETDTR[src]

Source Code

Source code
pub const CSETDTR = 0x8010

ConstantCSETRTS[src]

Source Code

Source code
pub const CSETRTS = 0x8011

ConstantIOCGWINSZ[src]

Source Code

Source code
pub const IOCGWINSZ = 0x8012

ConstantIOCSWINSZ[src]

Source Code

Source code
pub const IOCSWINSZ = 0x8013

ConstantCVTIME[src]

Source Code

Source code
pub const CVTIME = 0x8014

ConstantIOCGPGRP[src]

Source Code

Source code
pub const IOCGPGRP = 0x8015

ConstantIOCSPGRP[src]

Source Code

Source code
pub const IOCSPGRP = 0x8016

ConstantIOCSCTTY[src]

Source Code

Source code
pub const IOCSCTTY = 0x8017

ConstantIOCMGET[src]

Source Code

Source code
pub const IOCMGET = 0x8018

ConstantIOCMSET[src]

Source Code

Source code
pub const IOCMSET = 0x8019

ConstantIOCSBRK[src]

Source Code

Source code
pub const IOCSBRK = 0x8020

ConstantIOCCBRK[src]

Source Code

Source code
pub const IOCCBRK = 0x8021

ConstantIOCMBIS[src]

Source Code

Source code
pub const IOCMBIS = 0x8022

ConstantIOCMBIC[src]

Source Code

Source code
pub const IOCMBIC = 0x8023

ConstantIOCGSID[src]

Source Code

Source code
pub const IOCGSID = 0x8024

ConstantFIONREAD[src]

Source Code

Source code
pub const FIONREAD = 0xbe000001

ConstantFIONBIO[src]

Source Code

Source code
pub const FIONBIO = 0xbe000000

ConstantIOCCBRK[src]

Source Code

Source code
pub const IOCCBRK = 0x2000747a

ConstantIOCCDTR[src]

Source Code

Source code
pub const IOCCDTR = 0x20007478

ConstantIOCCONS[src]

Source Code

Source code
pub const IOCCONS = 0x80047462

ConstantIOCDCDTIMESTAMP[src]

Source Code

Source code
pub const IOCDCDTIMESTAMP = 0x40107458

ConstantIOCDRAIN[src]

Source Code

Source code
pub const IOCDRAIN = 0x2000745e

ConstantIOCEXCL[src]

Source Code

Source code
pub const IOCEXCL = 0x2000740d

ConstantIOCEXT[src]

Source Code

Source code
pub const IOCEXT = 0x80047460

ConstantIOCFLAG_CDTRCTS[src]

Source Code

Source code
pub const IOCFLAG_CDTRCTS = 0x10

ConstantIOCFLAG_CLOCAL[src]

Source Code

Source code
pub const IOCFLAG_CLOCAL = 0x2

ConstantIOCFLAG_CRTSCTS[src]

Source Code

Source code
pub const IOCFLAG_CRTSCTS = 0x4

ConstantIOCFLAG_MDMBUF[src]

Source Code

Source code
pub const IOCFLAG_MDMBUF = 0x8

ConstantIOCFLAG_SOFTCAR[src]

Source Code

Source code
pub const IOCFLAG_SOFTCAR = 0x1

ConstantIOCFLUSH[src]

Source Code

Source code
pub const IOCFLUSH = 0x80047410

ConstantIOCGETA[src]

Source Code

Source code
pub const IOCGETA = 0x402c7413

ConstantIOCGETD[src]

Source Code

Source code
pub const IOCGETD = 0x4004741a

ConstantIOCGFLAGS[src]

Source Code

Source code
pub const IOCGFLAGS = 0x4004745d

ConstantIOCGLINED[src]

Source Code

Source code
pub const IOCGLINED = 0x40207442

ConstantIOCGPGRP[src]

Source Code

Source code
pub const IOCGPGRP = 0x40047477

ConstantIOCGQSIZE[src]

Source Code

Source code
pub const IOCGQSIZE = 0x40047481

ConstantIOCGRANTPT[src]

Source Code

Source code
pub const IOCGRANTPT = 0x20007447

ConstantIOCGSID[src]

Source Code

Source code
pub const IOCGSID = 0x40047463

ConstantIOCGSIZE[src]

Source Code

Source code
pub const IOCGSIZE = 0x40087468

ConstantIOCGWINSZ[src]

Source Code

Source code
pub const IOCGWINSZ = 0x40087468

ConstantIOCMBIC[src]

Source Code

Source code
pub const IOCMBIC = 0x8004746b

ConstantIOCMBIS[src]

Source Code

Source code
pub const IOCMBIS = 0x8004746c

ConstantIOCMGET[src]

Source Code

Source code
pub const IOCMGET = 0x4004746a

ConstantIOCMSET[src]

Source Code

Source code
pub const IOCMSET = 0x8004746d

ConstantIOCM_CAR[src]

Source Code

Source code
pub const IOCM_CAR = 0x40

ConstantIOCM_CD[src]

Source Code

Source code
pub const IOCM_CD = 0x40

ConstantIOCM_CTS[src]

Source Code

Source code
pub const IOCM_CTS = 0x20

ConstantIOCM_DSR[src]

Source Code

Source code
pub const IOCM_DSR = 0x100

ConstantIOCM_DTR[src]

Source Code

Source code
pub const IOCM_DTR = 0x2

ConstantIOCM_LE[src]

Source Code

Source code
pub const IOCM_LE = 0x1

ConstantIOCM_RI[src]

Source Code

Source code
pub const IOCM_RI = 0x80

ConstantIOCM_RNG[src]

Source Code

Source code
pub const IOCM_RNG = 0x80

ConstantIOCM_RTS[src]

Source Code

Source code
pub const IOCM_RTS = 0x4

ConstantIOCM_SR[src]

Source Code

Source code
pub const IOCM_SR = 0x10

ConstantIOCM_ST[src]

Source Code

Source code
pub const IOCM_ST = 0x8

ConstantIOCNOTTY[src]

Source Code

Source code
pub const IOCNOTTY = 0x20007471

ConstantIOCNXCL[src]

Source Code

Source code
pub const IOCNXCL = 0x2000740e

ConstantIOCOUTQ[src]

Source Code

Source code
pub const IOCOUTQ = 0x40047473

ConstantIOCPKT[src]

Source Code

Source code
pub const IOCPKT = 0x80047470

ConstantIOCPKT_DATA[src]

Source Code

Source code
pub const IOCPKT_DATA = 0x0

ConstantIOCPKT_DOSTOP[src]

Source Code

Source code
pub const IOCPKT_DOSTOP = 0x20

ConstantIOCPKT_FLUSHREAD[src]

Source Code

Source code
pub const IOCPKT_FLUSHREAD = 0x1

ConstantIOCPKT_FLUSHWRITE[src]

Source Code

Source code
pub const IOCPKT_FLUSHWRITE = 0x2

ConstantIOCPKT_IOCTL[src]

Source Code

Source code
pub const IOCPKT_IOCTL = 0x40

ConstantIOCPKT_NOSTOP[src]

Source Code

Source code
pub const IOCPKT_NOSTOP = 0x10

ConstantIOCPKT_START[src]

Source Code

Source code
pub const IOCPKT_START = 0x8

ConstantIOCPKT_STOP[src]

Source Code

Source code
pub const IOCPKT_STOP = 0x4

ConstantIOCPTMGET[src]

Source Code

Source code
pub const IOCPTMGET = 0x40287446

ConstantIOCPTSNAME[src]

Source Code

Source code
pub const IOCPTSNAME = 0x40287448

ConstantIOCRCVFRAME[src]

Source Code

Source code
pub const IOCRCVFRAME = 0x80087445

ConstantIOCREMOTE[src]

Source Code

Source code
pub const IOCREMOTE = 0x80047469

ConstantIOCSBRK[src]

Source Code

Source code
pub const IOCSBRK = 0x2000747b

ConstantIOCSCTTY[src]

Source Code

Source code
pub const IOCSCTTY = 0x20007461

ConstantIOCSDTR[src]

Source Code

Source code
pub const IOCSDTR = 0x20007479

ConstantIOCSETA[src]

Source Code

Source code
pub const IOCSETA = 0x802c7414

ConstantIOCSETAF[src]

Source Code

Source code
pub const IOCSETAF = 0x802c7416

ConstantIOCSETAW[src]

Source Code

Source code
pub const IOCSETAW = 0x802c7415

ConstantIOCSETD[src]

Source Code

Source code
pub const IOCSETD = 0x8004741b

ConstantIOCSFLAGS[src]

Source Code

Source code
pub const IOCSFLAGS = 0x8004745c

ConstantIOCSIG[src]

Source Code

Source code
pub const IOCSIG = 0x2000745f

ConstantIOCSLINED[src]

Source Code

Source code
pub const IOCSLINED = 0x80207443

ConstantIOCSPGRP[src]

Source Code

Source code
pub const IOCSPGRP = 0x80047476

ConstantIOCSQSIZE[src]

Source Code

Source code
pub const IOCSQSIZE = 0x80047480

ConstantIOCSSIZE[src]

Source Code

Source code
pub const IOCSSIZE = 0x80087467

ConstantIOCSTART[src]

Source Code

Source code
pub const IOCSTART = 0x2000746e

ConstantIOCSTAT[src]

Source Code

Source code
pub const IOCSTAT = 0x80047465

ConstantIOCSTI[src]

Source Code

Source code
pub const IOCSTI = 0x80017472

ConstantIOCSTOP[src]

Source Code

Source code
pub const IOCSTOP = 0x2000746f

ConstantIOCSWINSZ[src]

Source Code

Source code
pub const IOCSWINSZ = 0x80087467

ConstantIOCUCNTL[src]

Source Code

Source code
pub const IOCUCNTL = 0x80047466

ConstantIOCXMTFRAME[src]

Source Code

Source code
pub const IOCXMTFRAME = 0x80087444

ConstantIOCMODG[src]

Source Code

Source code
pub const IOCMODG = 0x40047403

ConstantIOCMODS[src]

Source Code

Source code
pub const IOCMODS = 0x80047404

ConstantIOCM_LE[src]

Source Code

Source code
pub const IOCM_LE = 0x00000001

ConstantIOCM_DTR[src]

Source Code

Source code
pub const IOCM_DTR = 0x00000002

ConstantIOCM_RTS[src]

Source Code

Source code
pub const IOCM_RTS = 0x00000004

ConstantIOCM_ST[src]

Source Code

Source code
pub const IOCM_ST = 0x00000008

ConstantIOCM_SR[src]

Source Code

Source code
pub const IOCM_SR = 0x00000010

ConstantIOCM_CTS[src]

Source Code

Source code
pub const IOCM_CTS = 0x00000020

ConstantIOCM_CAR[src]

Source Code

Source code
pub const IOCM_CAR = 0x00000040

ConstantIOCM_CD[src]

Source Code

Source code
pub const IOCM_CD = 0x00000040

ConstantIOCM_RNG[src]

Source Code

Source code
pub const IOCM_RNG = 0x00000080

ConstantIOCM_RI[src]

Source Code

Source code
pub const IOCM_RI = 0x00000080

ConstantIOCM_DSR[src]

Source Code

Source code
pub const IOCM_DSR = 0x00000100

ConstantIOCEXCL[src]

Source Code

Source code
pub const IOCEXCL = 0x2000740d

ConstantIOCNXCL[src]

Source Code

Source code
pub const IOCNXCL = 0x2000740e

ConstantIOCFLUSH[src]

Source Code

Source code
pub const IOCFLUSH = 0x80047410

ConstantIOCGETA[src]

Source Code

Source code
pub const IOCGETA = 0x402c7413

ConstantIOCSETA[src]

Source Code

Source code
pub const IOCSETA = 0x802c7414

ConstantIOCSETAW[src]

Source Code

Source code
pub const IOCSETAW = 0x802c7415

ConstantIOCSETAF[src]

Source Code

Source code
pub const IOCSETAF = 0x802c7416

ConstantIOCGETD[src]

Source Code

Source code
pub const IOCGETD = 0x4004741a

ConstantIOCSETD[src]

Source Code

Source code
pub const IOCSETD = 0x8004741b

ConstantIOCSBRK[src]

Source Code

Source code
pub const IOCSBRK = 0x2000747b

ConstantIOCCBRK[src]

Source Code

Source code
pub const IOCCBRK = 0x2000747a

ConstantIOCSDTR[src]

Source Code

Source code
pub const IOCSDTR = 0x20007479

ConstantIOCCDTR[src]

Source Code

Source code
pub const IOCCDTR = 0x20007478

ConstantIOCGPGRP[src]

Source Code

Source code
pub const IOCGPGRP = 0x40047477

ConstantIOCSPGRP[src]

Source Code

Source code
pub const IOCSPGRP = 0x80047476

ConstantIOCOUTQ[src]

Source Code

Source code
pub const IOCOUTQ = 0x40047473

ConstantIOCSTI[src]

Source Code

Source code
pub const IOCSTI = 0x80017472

ConstantIOCNOTTY[src]

Source Code

Source code
pub const IOCNOTTY = 0x20007471

ConstantIOCPKT[src]

Source Code

Source code
pub const IOCPKT = 0x80047470

ConstantIOCPKT_DATA[src]

Source Code

Source code
pub const IOCPKT_DATA = 0x00000000

ConstantIOCPKT_FLUSHREAD[src]

Source Code

Source code
pub const IOCPKT_FLUSHREAD = 0x00000001

ConstantIOCPKT_FLUSHWRITE[src]

Source Code

Source code
pub const IOCPKT_FLUSHWRITE = 0x00000002

ConstantIOCPKT_STOP[src]

Source Code

Source code
pub const IOCPKT_STOP = 0x00000004

ConstantIOCPKT_START[src]

Source Code

Source code
pub const IOCPKT_START = 0x00000008

ConstantIOCPKT_NOSTOP[src]

Source Code

Source code
pub const IOCPKT_NOSTOP = 0x00000010

ConstantIOCPKT_DOSTOP[src]

Source Code

Source code
pub const IOCPKT_DOSTOP = 0x00000020

ConstantIOCPKT_IOCTL[src]

Source Code

Source code
pub const IOCPKT_IOCTL = 0x00000040

ConstantIOCSTOP[src]

Source Code

Source code
pub const IOCSTOP = 0x2000746f

ConstantIOCSTART[src]

Source Code

Source code
pub const IOCSTART = 0x2000746e

ConstantIOCMSET[src]

Source Code

Source code
pub const IOCMSET = 0x8004746d

ConstantIOCMBIS[src]

Source Code

Source code
pub const IOCMBIS = 0x8004746c

ConstantIOCMBIC[src]

Source Code

Source code
pub const IOCMBIC = 0x8004746b

ConstantIOCMGET[src]

Source Code

Source code
pub const IOCMGET = 0x4004746a

ConstantIOCREMOTE[src]

Source Code

Source code
pub const IOCREMOTE = 0x80047469

ConstantIOCGWINSZ[src]

Source Code

Source code
pub const IOCGWINSZ = 0x40087468

ConstantIOCSWINSZ[src]

Source Code

Source code
pub const IOCSWINSZ = 0x80087467

ConstantIOCUCNTL[src]

Source Code

Source code
pub const IOCUCNTL = 0x80047466

ConstantIOCSTAT[src]

Source Code

Source code
pub const IOCSTAT = 0x20007465

ConstantIOCGSID[src]

Source Code

Source code
pub const IOCGSID = 0x40047463

ConstantIOCCONS[src]

Source Code

Source code
pub const IOCCONS = 0x80047462

ConstantIOCSCTTY[src]

Source Code

Source code
pub const IOCSCTTY = 0x20007461

ConstantIOCEXT[src]

Source Code

Source code
pub const IOCEXT = 0x80047460

ConstantIOCSIG[src]

Source Code

Source code
pub const IOCSIG = 0x2000745f

ConstantIOCDRAIN[src]

Source Code

Source code
pub const IOCDRAIN = 0x2000745e

ConstantIOCMSDTRWAIT[src]

Source Code

Source code
pub const IOCMSDTRWAIT = 0x8004745b

ConstantIOCMGDTRWAIT[src]

Source Code

Source code
pub const IOCMGDTRWAIT = 0x4004745a

ConstantIOCTIMESTAMP[src]

Source Code

Source code
pub const IOCTIMESTAMP = 0x40107459

ConstantIOCDCDTIMESTAMP[src]

Source Code

Source code
pub const IOCDCDTIMESTAMP = 0x40107458

ConstantIOCSDRAINWAIT[src]

Source Code

Source code
pub const IOCSDRAINWAIT = 0x80047457

ConstantIOCGDRAINWAIT[src]

Source Code

Source code
pub const IOCGDRAINWAIT = 0x40047456

ConstantIOCISPTMASTER[src]

Source Code

Source code
pub const IOCISPTMASTER = 0x20007455

Source Code

Source code
pub const T = switch (native_os) {
    .linux => linux.T,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const IOCGWINSZ = ior(0x40000000, 't', 104, @sizeOf(winsize));

        fn ior(inout: u32, group: usize, num: usize, len: usize) usize {
            return (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num));
        }
    },
    .freebsd => struct {
        pub const IOCEXCL = 0x2000740d;
        pub const IOCNXCL = 0x2000740e;
        pub const IOCSCTTY = 0x20007461;
        pub const IOCGPGRP = 0x40047477;
        pub const IOCSPGRP = 0x80047476;
        pub const IOCOUTQ = 0x40047473;
        pub const IOCSTI = 0x80017472;
        pub const IOCGWINSZ = 0x40087468;
        pub const IOCSWINSZ = 0x80087467;
        pub const IOCMGET = 0x4004746a;
        pub const IOCMBIS = 0x8004746c;
        pub const IOCMBIC = 0x8004746b;
        pub const IOCMSET = 0x8004746d;
        pub const FIONREAD = 0x4004667f;
        pub const IOCCONS = 0x80047462;
        pub const IOCPKT = 0x80047470;
        pub const FIONBIO = 0x8004667e;
        pub const IOCNOTTY = 0x20007471;
        pub const IOCSETD = 0x8004741b;
        pub const IOCGETD = 0x4004741a;
        pub const IOCSBRK = 0x2000747b;
        pub const IOCCBRK = 0x2000747a;
        pub const IOCGSID = 0x40047463;
        pub const IOCGPTN = 0x4004740f;
        pub const IOCSIG = 0x2004745f;
    },
    .solaris, .illumos => struct {
        pub const CGETA = tioc('T', 1);
        pub const CSETA = tioc('T', 2);
        pub const CSETAW = tioc('T', 3);
        pub const CSETAF = tioc('T', 4);
        pub const CSBRK = tioc('T', 5);
        pub const CXONC = tioc('T', 6);
        pub const CFLSH = tioc('T', 7);
        pub const IOCGWINSZ = tioc('T', 104);
        pub const IOCSWINSZ = tioc('T', 103);
        // Softcarrier ioctls
        pub const IOCGSOFTCAR = tioc('T', 105);
        pub const IOCSSOFTCAR = tioc('T', 106);
        // termios ioctls
        pub const CGETS = tioc('T', 13);
        pub const CSETS = tioc('T', 14);
        pub const CSANOW = tioc('T', 14);
        pub const CSETSW = tioc('T', 15);
        pub const CSADRAIN = tioc('T', 15);
        pub const CSETSF = tioc('T', 16);
        pub const IOCSETLD = tioc('T', 123);
        pub const IOCGETLD = tioc('T', 124);
        // NTP PPS ioctls
        pub const IOCGPPS = tioc('T', 125);
        pub const IOCSPPS = tioc('T', 126);
        pub const IOCGPPSEV = tioc('T', 127);

        pub const IOCGETD = tioc('t', 0);
        pub const IOCSETD = tioc('t', 1);
        pub const IOCHPCL = tioc('t', 2);
        pub const IOCGETP = tioc('t', 8);
        pub const IOCSETP = tioc('t', 9);
        pub const IOCSETN = tioc('t', 10);
        pub const IOCEXCL = tioc('t', 13);
        pub const IOCNXCL = tioc('t', 14);
        pub const IOCFLUSH = tioc('t', 16);
        pub const IOCSETC = tioc('t', 17);
        pub const IOCGETC = tioc('t', 18);
        /// bis local mode bits
        pub const IOCLBIS = tioc('t', 127);
        /// bic local mode bits
        pub const IOCLBIC = tioc('t', 126);
        /// set entire local mode word
        pub const IOCLSET = tioc('t', 125);
        /// get local modes
        pub const IOCLGET = tioc('t', 124);
        /// set break bit
        pub const IOCSBRK = tioc('t', 123);
        /// clear break bit
        pub const IOCCBRK = tioc('t', 122);
        /// set data terminal ready
        pub const IOCSDTR = tioc('t', 121);
        /// clear data terminal ready
        pub const IOCCDTR = tioc('t', 120);
        /// set local special chars
        pub const IOCSLTC = tioc('t', 117);
        /// get local special chars
        pub const IOCGLTC = tioc('t', 116);
        /// driver output queue size
        pub const IOCOUTQ = tioc('t', 115);
        /// void tty association
        pub const IOCNOTTY = tioc('t', 113);
        /// get a ctty
        pub const IOCSCTTY = tioc('t', 132);
        /// stop output, like ^S
        pub const IOCSTOP = tioc('t', 111);
        /// start output, like ^Q
        pub const IOCSTART = tioc('t', 110);
        /// get pgrp of tty
        pub const IOCGPGRP = tioc('t', 20);
        /// set pgrp of tty
        pub const IOCSPGRP = tioc('t', 21);
        /// get session id on ctty
        pub const IOCGSID = tioc('t', 22);
        /// simulate terminal input
        pub const IOCSTI = tioc('t', 23);
        /// set all modem bits
        pub const IOCMSET = tioc('t', 26);
        /// bis modem bits
        pub const IOCMBIS = tioc('t', 27);
        /// bic modem bits
        pub const IOCMBIC = tioc('t', 28);
        /// get all modem bits
        pub const IOCMGET = tioc('t', 29);

        fn tioc(t: u16, num: u8) u16 {
            return (t << 8) | num;
        }
    },
    .netbsd => struct {
        pub const IOCCBRK = 0x2000747a;
        pub const IOCCDTR = 0x20007478;
        pub const IOCCONS = 0x80047462;
        pub const IOCDCDTIMESTAMP = 0x40107458;
        pub const IOCDRAIN = 0x2000745e;
        pub const IOCEXCL = 0x2000740d;
        pub const IOCEXT = 0x80047460;
        pub const IOCFLAG_CDTRCTS = 0x10;
        pub const IOCFLAG_CLOCAL = 0x2;
        pub const IOCFLAG_CRTSCTS = 0x4;
        pub const IOCFLAG_MDMBUF = 0x8;
        pub const IOCFLAG_SOFTCAR = 0x1;
        pub const IOCFLUSH = 0x80047410;
        pub const IOCGETA = 0x402c7413;
        pub const IOCGETD = 0x4004741a;
        pub const IOCGFLAGS = 0x4004745d;
        pub const IOCGLINED = 0x40207442;
        pub const IOCGPGRP = 0x40047477;
        pub const IOCGQSIZE = 0x40047481;
        pub const IOCGRANTPT = 0x20007447;
        pub const IOCGSID = 0x40047463;
        pub const IOCGSIZE = 0x40087468;
        pub const IOCGWINSZ = 0x40087468;
        pub const IOCMBIC = 0x8004746b;
        pub const IOCMBIS = 0x8004746c;
        pub const IOCMGET = 0x4004746a;
        pub const IOCMSET = 0x8004746d;
        pub const IOCM_CAR = 0x40;
        pub const IOCM_CD = 0x40;
        pub const IOCM_CTS = 0x20;
        pub const IOCM_DSR = 0x100;
        pub const IOCM_DTR = 0x2;
        pub const IOCM_LE = 0x1;
        pub const IOCM_RI = 0x80;
        pub const IOCM_RNG = 0x80;
        pub const IOCM_RTS = 0x4;
        pub const IOCM_SR = 0x10;
        pub const IOCM_ST = 0x8;
        pub const IOCNOTTY = 0x20007471;
        pub const IOCNXCL = 0x2000740e;
        pub const IOCOUTQ = 0x40047473;
        pub const IOCPKT = 0x80047470;
        pub const IOCPKT_DATA = 0x0;
        pub const IOCPKT_DOSTOP = 0x20;
        pub const IOCPKT_FLUSHREAD = 0x1;
        pub const IOCPKT_FLUSHWRITE = 0x2;
        pub const IOCPKT_IOCTL = 0x40;
        pub const IOCPKT_NOSTOP = 0x10;
        pub const IOCPKT_START = 0x8;
        pub const IOCPKT_STOP = 0x4;
        pub const IOCPTMGET = 0x40287446;
        pub const IOCPTSNAME = 0x40287448;
        pub const IOCRCVFRAME = 0x80087445;
        pub const IOCREMOTE = 0x80047469;
        pub const IOCSBRK = 0x2000747b;
        pub const IOCSCTTY = 0x20007461;
        pub const IOCSDTR = 0x20007479;
        pub const IOCSETA = 0x802c7414;
        pub const IOCSETAF = 0x802c7416;
        pub const IOCSETAW = 0x802c7415;
        pub const IOCSETD = 0x8004741b;
        pub const IOCSFLAGS = 0x8004745c;
        pub const IOCSIG = 0x2000745f;
        pub const IOCSLINED = 0x80207443;
        pub const IOCSPGRP = 0x80047476;
        pub const IOCSQSIZE = 0x80047480;
        pub const IOCSSIZE = 0x80087467;
        pub const IOCSTART = 0x2000746e;
        pub const IOCSTAT = 0x80047465;
        pub const IOCSTI = 0x80017472;
        pub const IOCSTOP = 0x2000746f;
        pub const IOCSWINSZ = 0x80087467;
        pub const IOCUCNTL = 0x80047466;
        pub const IOCXMTFRAME = 0x80087444;
    },
    .haiku => struct {
        pub const CGETA = 0x8000;
        pub const CSETA = 0x8001;
        pub const CSETAF = 0x8002;
        pub const CSETAW = 0x8003;
        pub const CWAITEVENT = 0x8004;
        pub const CSBRK = 0x8005;
        pub const CFLSH = 0x8006;
        pub const CXONC = 0x8007;
        pub const CQUERYCONNECTED = 0x8008;
        pub const CGETBITS = 0x8009;
        pub const CSETDTR = 0x8010;
        pub const CSETRTS = 0x8011;
        pub const IOCGWINSZ = 0x8012;
        pub const IOCSWINSZ = 0x8013;
        pub const CVTIME = 0x8014;
        pub const IOCGPGRP = 0x8015;
        pub const IOCSPGRP = 0x8016;
        pub const IOCSCTTY = 0x8017;
        pub const IOCMGET = 0x8018;
        pub const IOCMSET = 0x8019;
        pub const IOCSBRK = 0x8020;
        pub const IOCCBRK = 0x8021;
        pub const IOCMBIS = 0x8022;
        pub const IOCMBIC = 0x8023;
        pub const IOCGSID = 0x8024;

        pub const FIONREAD = 0xbe000001;
        pub const FIONBIO = 0xbe000000;
    },
    .openbsd => struct {
        pub const IOCCBRK = 0x2000747a;
        pub const IOCCDTR = 0x20007478;
        pub const IOCCONS = 0x80047462;
        pub const IOCDCDTIMESTAMP = 0x40107458;
        pub const IOCDRAIN = 0x2000745e;
        pub const IOCEXCL = 0x2000740d;
        pub const IOCEXT = 0x80047460;
        pub const IOCFLAG_CDTRCTS = 0x10;
        pub const IOCFLAG_CLOCAL = 0x2;
        pub const IOCFLAG_CRTSCTS = 0x4;
        pub const IOCFLAG_MDMBUF = 0x8;
        pub const IOCFLAG_SOFTCAR = 0x1;
        pub const IOCFLUSH = 0x80047410;
        pub const IOCGETA = 0x402c7413;
        pub const IOCGETD = 0x4004741a;
        pub const IOCGFLAGS = 0x4004745d;
        pub const IOCGLINED = 0x40207442;
        pub const IOCGPGRP = 0x40047477;
        pub const IOCGQSIZE = 0x40047481;
        pub const IOCGRANTPT = 0x20007447;
        pub const IOCGSID = 0x40047463;
        pub const IOCGSIZE = 0x40087468;
        pub const IOCGWINSZ = 0x40087468;
        pub const IOCMBIC = 0x8004746b;
        pub const IOCMBIS = 0x8004746c;
        pub const IOCMGET = 0x4004746a;
        pub const IOCMSET = 0x8004746d;
        pub const IOCM_CAR = 0x40;
        pub const IOCM_CD = 0x40;
        pub const IOCM_CTS = 0x20;
        pub const IOCM_DSR = 0x100;
        pub const IOCM_DTR = 0x2;
        pub const IOCM_LE = 0x1;
        pub const IOCM_RI = 0x80;
        pub const IOCM_RNG = 0x80;
        pub const IOCM_RTS = 0x4;
        pub const IOCM_SR = 0x10;
        pub const IOCM_ST = 0x8;
        pub const IOCNOTTY = 0x20007471;
        pub const IOCNXCL = 0x2000740e;
        pub const IOCOUTQ = 0x40047473;
        pub const IOCPKT = 0x80047470;
        pub const IOCPKT_DATA = 0x0;
        pub const IOCPKT_DOSTOP = 0x20;
        pub const IOCPKT_FLUSHREAD = 0x1;
        pub const IOCPKT_FLUSHWRITE = 0x2;
        pub const IOCPKT_IOCTL = 0x40;
        pub const IOCPKT_NOSTOP = 0x10;
        pub const IOCPKT_START = 0x8;
        pub const IOCPKT_STOP = 0x4;
        pub const IOCPTMGET = 0x40287446;
        pub const IOCPTSNAME = 0x40287448;
        pub const IOCRCVFRAME = 0x80087445;
        pub const IOCREMOTE = 0x80047469;
        pub const IOCSBRK = 0x2000747b;
        pub const IOCSCTTY = 0x20007461;
        pub const IOCSDTR = 0x20007479;
        pub const IOCSETA = 0x802c7414;
        pub const IOCSETAF = 0x802c7416;
        pub const IOCSETAW = 0x802c7415;
        pub const IOCSETD = 0x8004741b;
        pub const IOCSFLAGS = 0x8004745c;
        pub const IOCSIG = 0x2000745f;
        pub const IOCSLINED = 0x80207443;
        pub const IOCSPGRP = 0x80047476;
        pub const IOCSQSIZE = 0x80047480;
        pub const IOCSSIZE = 0x80087467;
        pub const IOCSTART = 0x2000746e;
        pub const IOCSTAT = 0x80047465;
        pub const IOCSTI = 0x80017472;
        pub const IOCSTOP = 0x2000746f;
        pub const IOCSWINSZ = 0x80087467;
        pub const IOCUCNTL = 0x80047466;
        pub const IOCXMTFRAME = 0x80087444;
    },
    .dragonfly => struct {
        pub const IOCMODG = 0x40047403;
        pub const IOCMODS = 0x80047404;
        pub const IOCM_LE = 0x00000001;
        pub const IOCM_DTR = 0x00000002;
        pub const IOCM_RTS = 0x00000004;
        pub const IOCM_ST = 0x00000008;
        pub const IOCM_SR = 0x00000010;
        pub const IOCM_CTS = 0x00000020;
        pub const IOCM_CAR = 0x00000040;
        pub const IOCM_CD = 0x00000040;
        pub const IOCM_RNG = 0x00000080;
        pub const IOCM_RI = 0x00000080;
        pub const IOCM_DSR = 0x00000100;
        pub const IOCEXCL = 0x2000740d;
        pub const IOCNXCL = 0x2000740e;
        pub const IOCFLUSH = 0x80047410;
        pub const IOCGETA = 0x402c7413;
        pub const IOCSETA = 0x802c7414;
        pub const IOCSETAW = 0x802c7415;
        pub const IOCSETAF = 0x802c7416;
        pub const IOCGETD = 0x4004741a;
        pub const IOCSETD = 0x8004741b;
        pub const IOCSBRK = 0x2000747b;
        pub const IOCCBRK = 0x2000747a;
        pub const IOCSDTR = 0x20007479;
        pub const IOCCDTR = 0x20007478;
        pub const IOCGPGRP = 0x40047477;
        pub const IOCSPGRP = 0x80047476;
        pub const IOCOUTQ = 0x40047473;
        pub const IOCSTI = 0x80017472;
        pub const IOCNOTTY = 0x20007471;
        pub const IOCPKT = 0x80047470;
        pub const IOCPKT_DATA = 0x00000000;
        pub const IOCPKT_FLUSHREAD = 0x00000001;
        pub const IOCPKT_FLUSHWRITE = 0x00000002;
        pub const IOCPKT_STOP = 0x00000004;
        pub const IOCPKT_START = 0x00000008;
        pub const IOCPKT_NOSTOP = 0x00000010;
        pub const IOCPKT_DOSTOP = 0x00000020;
        pub const IOCPKT_IOCTL = 0x00000040;
        pub const IOCSTOP = 0x2000746f;
        pub const IOCSTART = 0x2000746e;
        pub const IOCMSET = 0x8004746d;
        pub const IOCMBIS = 0x8004746c;
        pub const IOCMBIC = 0x8004746b;
        pub const IOCMGET = 0x4004746a;
        pub const IOCREMOTE = 0x80047469;
        pub const IOCGWINSZ = 0x40087468;
        pub const IOCSWINSZ = 0x80087467;
        pub const IOCUCNTL = 0x80047466;
        pub const IOCSTAT = 0x20007465;
        pub const IOCGSID = 0x40047463;
        pub const IOCCONS = 0x80047462;
        pub const IOCSCTTY = 0x20007461;
        pub const IOCEXT = 0x80047460;
        pub const IOCSIG = 0x2000745f;
        pub const IOCDRAIN = 0x2000745e;
        pub const IOCMSDTRWAIT = 0x8004745b;
        pub const IOCMGDTRWAIT = 0x4004745a;
        pub const IOCTIMESTAMP = 0x40107459;
        pub const IOCDCDTIMESTAMP = 0x40107458;
        pub const IOCSDRAINWAIT = 0x80047457;
        pub const IOCGDRAINWAIT = 0x40047456;
        pub const IOCISPTMASTER = 0x20007455;
    },
    else => void,
}

TypeIOCPARM_MASK[src]

Source Code

Source code
pub const IOCPARM_MASK = switch (native_os) {
    .windows => ws2_32.IOCPARM_MASK,
    .macos, .ios, .tvos, .watchos, .visionos => 0x1fff,
    else => void,
}

TypeTFD[src]

Source Code

Source code
pub const TFD = switch (native_os) {
    .linux => linux.TFD,
    else => void,
}

TypeVDSO[src]

Source Code

Source code
pub const VDSO = switch (native_os) {
    .linux => linux.VDSO,
    else => void,
}

TypeW[src]

Values

ConstantNOHANG[src]

[XSI] no hang in wait/no child to reap

Source Code

Source code
pub const NOHANG = 0x00000001

ConstantUNTRACED[src]

[XSI] notify on stop, untraced child

Source Code

Source code
pub const UNTRACED = 0x00000002

ConstantNOHANG[src]

Source Code

Source code
pub const NOHANG = 1

ConstantUNTRACED[src]

Source Code

Source code
pub const UNTRACED = 2

ConstantUNTRACED[src]

Source Code

Source code
pub const UNTRACED = 2

ConstantCONTINUED[src]

Source Code

Source code
pub const CONTINUED = 4

ConstantNOWAIT[src]

Source Code

Source code
pub const NOWAIT = 8

ConstantEXITED[src]

Source Code

Source code
pub const EXITED = 16

ConstantTRAPPED[src]

Source Code

Source code
pub const TRAPPED = 32

ConstantEXITED[src]

Source Code

Source code
pub const EXITED = 0o001

ConstantTRAPPED[src]

Source Code

Source code
pub const TRAPPED = 0o002

ConstantUNTRACED[src]

Source Code

Source code
pub const UNTRACED = 0o004

ConstantUNTRACED[src]

Source Code

Source code
pub const UNTRACED = 0o004

ConstantCONTINUED[src]

Source Code

Source code
pub const CONTINUED = 0o010

ConstantNOHANG[src]

Source Code

Source code
pub const NOHANG = 0o100

ConstantNOWAIT[src]

Source Code

Source code
pub const NOWAIT = 0o200

ConstantNOHANG[src]

Source Code

Source code
pub const NOHANG = 0x00000001

ConstantUNTRACED[src]

Source Code

Source code
pub const UNTRACED = 0x00000002

ConstantUNTRACED[src]

Source Code

Source code
pub const UNTRACED = 0x00000002

ConstantCONTINUED[src]

Source Code

Source code
pub const CONTINUED = 0x00000010

ConstantNOWAIT[src]

Source Code

Source code
pub const NOWAIT = 0x00010000

ConstantEXITED[src]

Source Code

Source code
pub const EXITED = 0x00000020

ConstantTRAPPED[src]

Source Code

Source code
pub const TRAPPED = 0x00000040

ConstantNOHANG[src]

Source Code

Source code
pub const NOHANG = 0x0001

ConstantUNTRACED[src]

Source Code

Source code
pub const UNTRACED = 0x0002

ConstantCONTINUED[src]

Source Code

Source code
pub const CONTINUED = 0x0004

ConstantUNTRACED[src]

Source Code

Source code
pub const UNTRACED = 0x0002

ConstantNOWAIT[src]

Source Code

Source code
pub const NOWAIT = 0x0008

ConstantEXITED[src]

Source Code

Source code
pub const EXITED = 0x0010

ConstantTRAPPED[src]

Source Code

Source code
pub const TRAPPED = 0x0020

ConstantNOHANG[src]

Source Code

Source code
pub const NOHANG = 0x1

ConstantUNTRACED[src]

Source Code

Source code
pub const UNTRACED = 0x2

ConstantCONTINUED[src]

Source Code

Source code
pub const CONTINUED = 0x4

ConstantEXITED[src]

Source Code

Source code
pub const EXITED = 0x08

ConstantSTOPPED[src]

Source Code

Source code
pub const STOPPED = 0x10

ConstantNOWAIT[src]

Source Code

Source code
pub const NOWAIT = 0x20

ConstantNOHANG[src]

Source Code

Source code
pub const NOHANG = 1

ConstantUNTRACED[src]

Source Code

Source code
pub const UNTRACED = 2

ConstantCONTINUED[src]

Source Code

Source code
pub const CONTINUED = 8

Functions

FunctionEXITSTATUS[src]

pub fn EXITSTATUS(x: u32) u8

Parameters

x: u32

Source Code

Source code
pub fn EXITSTATUS(x: u32) u8 {
    return @as(u8, @intCast(x >> 8));
}

FunctionTERMSIG[src]

pub fn TERMSIG(x: u32) u32

Parameters

x: u32

Source Code

Source code
pub fn TERMSIG(x: u32) u32 {
    return status(x);
}

FunctionSTOPSIG[src]

pub fn STOPSIG(x: u32) u32

Parameters

x: u32

Source Code

Source code
pub fn STOPSIG(x: u32) u32 {
    return x >> 8;
}

FunctionIFEXITED[src]

pub fn IFEXITED(x: u32) bool

Parameters

x: u32

Source Code

Source code
pub fn IFEXITED(x: u32) bool {
    return status(x) == 0;
}

FunctionIFSTOPPED[src]

pub fn IFSTOPPED(x: u32) bool

Parameters

x: u32

Source Code

Source code
pub fn IFSTOPPED(x: u32) bool {
    return status(x) == stopped and STOPSIG(x) != 0x13;
}

FunctionIFSIGNALED[src]

pub fn IFSIGNALED(x: u32) bool

Parameters

x: u32

Source Code

Source code
pub fn IFSIGNALED(x: u32) bool {
    return status(x) != stopped and status(x) != 0;
}

FunctionEXITSTATUS[src]

pub fn EXITSTATUS(s: u32) u8

Parameters

s: u32

Source Code

Source code
pub fn EXITSTATUS(s: u32) u8 {
    return @as(u8, @intCast((s & 0xff00) >> 8));
}

FunctionTERMSIG[src]

pub fn TERMSIG(s: u32) u32

Parameters

s: u32

Source Code

Source code
pub fn TERMSIG(s: u32) u32 {
    return s & 0x7f;
}

FunctionSTOPSIG[src]

pub fn STOPSIG(s: u32) u32

Parameters

s: u32

Source Code

Source code
pub fn STOPSIG(s: u32) u32 {
    return EXITSTATUS(s);
}

FunctionIFEXITED[src]

pub fn IFEXITED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFEXITED(s: u32) bool {
    return TERMSIG(s) == 0;
}

FunctionIFSTOPPED[src]

pub fn IFSTOPPED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFSTOPPED(s: u32) bool {
    return @as(u16, @truncate((((s & 0xffff) *% 0x10001) >> 8))) > 0x7f00;
}

FunctionIFSIGNALED[src]

pub fn IFSIGNALED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFSIGNALED(s: u32) bool {
    return (s & 0xffff) -% 1 < 0xff;
}

FunctionEXITSTATUS[src]

pub fn EXITSTATUS(s: u32) u8

Parameters

s: u32

Source Code

Source code
pub fn EXITSTATUS(s: u32) u8 {
    return @as(u8, @intCast((s >> 8) & 0xff));
}

FunctionTERMSIG[src]

pub fn TERMSIG(s: u32) u32

Parameters

s: u32

Source Code

Source code
pub fn TERMSIG(s: u32) u32 {
    return s & 0x7f;
}

FunctionSTOPSIG[src]

pub fn STOPSIG(s: u32) u32

Parameters

s: u32

Source Code

Source code
pub fn STOPSIG(s: u32) u32 {
    return EXITSTATUS(s);
}

FunctionIFEXITED[src]

pub fn IFEXITED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFEXITED(s: u32) bool {
    return TERMSIG(s) == 0;
}

FunctionIFCONTINUED[src]

pub fn IFCONTINUED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFCONTINUED(s: u32) bool {
    return ((s & 0o177777) == 0o177777);
}

FunctionIFSTOPPED[src]

pub fn IFSTOPPED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFSTOPPED(s: u32) bool {
    return (s & 0x00ff != 0o177) and !(s & 0xff00 != 0);
}

FunctionIFSIGNALED[src]

pub fn IFSIGNALED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFSIGNALED(s: u32) bool {
    return s & 0x00ff > 0 and s & 0xff00 == 0;
}

FunctionEXITSTATUS[src]

pub fn EXITSTATUS(s: u32) u8

Parameters

s: u32

Source Code

Source code
pub fn EXITSTATUS(s: u32) u8 {
    return @as(u8, @intCast((s >> 8) & 0xff));
}

FunctionTERMSIG[src]

pub fn TERMSIG(s: u32) u32

Parameters

s: u32

Source Code

Source code
pub fn TERMSIG(s: u32) u32 {
    return s & 0x7f;
}

FunctionSTOPSIG[src]

pub fn STOPSIG(s: u32) u32

Parameters

s: u32

Source Code

Source code
pub fn STOPSIG(s: u32) u32 {
    return EXITSTATUS(s);
}

FunctionIFEXITED[src]

pub fn IFEXITED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFEXITED(s: u32) bool {
    return TERMSIG(s) == 0;
}

FunctionIFCONTINUED[src]

pub fn IFCONTINUED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFCONTINUED(s: u32) bool {
    return ((s & 0x7f) == 0xffff);
}

FunctionIFSTOPPED[src]

pub fn IFSTOPPED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFSTOPPED(s: u32) bool {
    return ((s & 0x7f != 0x7f) and !IFCONTINUED(s));
}

FunctionIFSIGNALED[src]

pub fn IFSIGNALED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFSIGNALED(s: u32) bool {
    return !IFSTOPPED(s) and !IFCONTINUED(s) and !IFEXITED(s);
}

FunctionEXITSTATUS[src]

pub fn EXITSTATUS(s: u32) u8

Parameters

s: u32

Source Code

Source code
pub fn EXITSTATUS(s: u32) u8 {
    return @as(u8, @intCast((s & 0xff00) >> 8));
}

FunctionTERMSIG[src]

pub fn TERMSIG(s: u32) u32

Parameters

s: u32

Source Code

Source code
pub fn TERMSIG(s: u32) u32 {
    return s & 0x7f;
}

FunctionSTOPSIG[src]

pub fn STOPSIG(s: u32) u32

Parameters

s: u32

Source Code

Source code
pub fn STOPSIG(s: u32) u32 {
    return EXITSTATUS(s);
}

FunctionIFEXITED[src]

pub fn IFEXITED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFEXITED(s: u32) bool {
    return TERMSIG(s) == 0;
}

FunctionIFSTOPPED[src]

pub fn IFSTOPPED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFSTOPPED(s: u32) bool {
    return @as(u16, @truncate((((s & 0xffff) *% 0x10001) >> 8))) > 0x7f00;
}

FunctionIFSIGNALED[src]

pub fn IFSIGNALED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFSIGNALED(s: u32) bool {
    return (s & 0xffff) -% 1 < 0xff;
}

FunctionEXITSTATUS[src]

pub fn EXITSTATUS(s: u32) u8

Parameters

s: u32

Source Code

Source code
pub fn EXITSTATUS(s: u32) u8 {
    return @as(u8, @intCast(s & 0xff));
}

FunctionTERMSIG[src]

pub fn TERMSIG(s: u32) u32

Parameters

s: u32

Source Code

Source code
pub fn TERMSIG(s: u32) u32 {
    return (s >> 8) & 0xff;
}

FunctionSTOPSIG[src]

pub fn STOPSIG(s: u32) u32

Parameters

s: u32

Source Code

Source code
pub fn STOPSIG(s: u32) u32 {
    return (s >> 16) & 0xff;
}

FunctionIFEXITED[src]

pub fn IFEXITED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFEXITED(s: u32) bool {
    return (s & ~@as(u32, 0xff)) == 0;
}

FunctionIFSTOPPED[src]

pub fn IFSTOPPED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFSTOPPED(s: u32) bool {
    return ((s >> 16) & 0xff) != 0;
}

FunctionIFSIGNALED[src]

pub fn IFSIGNALED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFSIGNALED(s: u32) bool {
    return ((s >> 8) & 0xff) != 0;
}

FunctionEXITSTATUS[src]

pub fn EXITSTATUS(s: u32) u8

Parameters

s: u32

Source Code

Source code
pub fn EXITSTATUS(s: u32) u8 {
    return @as(u8, @intCast((s >> 8) & 0xff));
}

FunctionTERMSIG[src]

pub fn TERMSIG(s: u32) u32

Parameters

s: u32

Source Code

Source code
pub fn TERMSIG(s: u32) u32 {
    return (s & 0x7f);
}

FunctionSTOPSIG[src]

pub fn STOPSIG(s: u32) u32

Parameters

s: u32

Source Code

Source code
pub fn STOPSIG(s: u32) u32 {
    return EXITSTATUS(s);
}

FunctionIFEXITED[src]

pub fn IFEXITED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFEXITED(s: u32) bool {
    return TERMSIG(s) == 0;
}

FunctionIFCONTINUED[src]

pub fn IFCONTINUED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFCONTINUED(s: u32) bool {
    return ((s & 0o177777) == 0o177777);
}

FunctionIFSTOPPED[src]

pub fn IFSTOPPED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFSTOPPED(s: u32) bool {
    return (s & 0xff == 0o177);
}

FunctionIFSIGNALED[src]

pub fn IFSIGNALED(s: u32) bool

Parameters

s: u32

Source Code

Source code
pub fn IFSIGNALED(s: u32) bool {
    return (((s) & 0o177) != 0o177) and (((s) & 0o177) != 0);
}

Source Code

Source code
pub const W = switch (native_os) {
    .linux => linux.W,
    .emscripten => emscripten.W,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        /// [XSI] no hang in wait/no child to reap
        pub const NOHANG = 0x00000001;
        /// [XSI] notify on stop, untraced child
        pub const UNTRACED = 0x00000002;

        pub fn EXITSTATUS(x: u32) u8 {
            return @as(u8, @intCast(x >> 8));
        }
        pub fn TERMSIG(x: u32) u32 {
            return status(x);
        }
        pub fn STOPSIG(x: u32) u32 {
            return x >> 8;
        }
        pub fn IFEXITED(x: u32) bool {
            return status(x) == 0;
        }
        pub fn IFSTOPPED(x: u32) bool {
            return status(x) == stopped and STOPSIG(x) != 0x13;
        }
        pub fn IFSIGNALED(x: u32) bool {
            return status(x) != stopped and status(x) != 0;
        }

        fn status(x: u32) u32 {
            return x & 0o177;
        }
        const stopped = 0o177;
    },
    .freebsd => struct {
        pub const NOHANG = 1;
        pub const UNTRACED = 2;
        pub const STOPPED = UNTRACED;
        pub const CONTINUED = 4;
        pub const NOWAIT = 8;
        pub const EXITED = 16;
        pub const TRAPPED = 32;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast((s & 0xff00) >> 8));
        }
        pub fn TERMSIG(s: u32) u32 {
            return s & 0x7f;
        }
        pub fn STOPSIG(s: u32) u32 {
            return EXITSTATUS(s);
        }
        pub fn IFEXITED(s: u32) bool {
            return TERMSIG(s) == 0;
        }
        pub fn IFSTOPPED(s: u32) bool {
            return @as(u16, @truncate((((s & 0xffff) *% 0x10001) >> 8))) > 0x7f00;
        }
        pub fn IFSIGNALED(s: u32) bool {
            return (s & 0xffff) -% 1 < 0xff;
        }
    },
    .solaris, .illumos => struct {
        pub const EXITED = 0o001;
        pub const TRAPPED = 0o002;
        pub const UNTRACED = 0o004;
        pub const STOPPED = UNTRACED;
        pub const CONTINUED = 0o010;
        pub const NOHANG = 0o100;
        pub const NOWAIT = 0o200;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast((s >> 8) & 0xff));
        }
        pub fn TERMSIG(s: u32) u32 {
            return s & 0x7f;
        }
        pub fn STOPSIG(s: u32) u32 {
            return EXITSTATUS(s);
        }
        pub fn IFEXITED(s: u32) bool {
            return TERMSIG(s) == 0;
        }

        pub fn IFCONTINUED(s: u32) bool {
            return ((s & 0o177777) == 0o177777);
        }

        pub fn IFSTOPPED(s: u32) bool {
            return (s & 0x00ff != 0o177) and !(s & 0xff00 != 0);
        }

        pub fn IFSIGNALED(s: u32) bool {
            return s & 0x00ff > 0 and s & 0xff00 == 0;
        }
    },
    .netbsd => struct {
        pub const NOHANG = 0x00000001;
        pub const UNTRACED = 0x00000002;
        pub const STOPPED = UNTRACED;
        pub const CONTINUED = 0x00000010;
        pub const NOWAIT = 0x00010000;
        pub const EXITED = 0x00000020;
        pub const TRAPPED = 0x00000040;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast((s >> 8) & 0xff));
        }
        pub fn TERMSIG(s: u32) u32 {
            return s & 0x7f;
        }
        pub fn STOPSIG(s: u32) u32 {
            return EXITSTATUS(s);
        }
        pub fn IFEXITED(s: u32) bool {
            return TERMSIG(s) == 0;
        }

        pub fn IFCONTINUED(s: u32) bool {
            return ((s & 0x7f) == 0xffff);
        }

        pub fn IFSTOPPED(s: u32) bool {
            return ((s & 0x7f != 0x7f) and !IFCONTINUED(s));
        }

        pub fn IFSIGNALED(s: u32) bool {
            return !IFSTOPPED(s) and !IFCONTINUED(s) and !IFEXITED(s);
        }
    },
    .dragonfly => struct {
        pub const NOHANG = 0x0001;
        pub const UNTRACED = 0x0002;
        pub const CONTINUED = 0x0004;
        pub const STOPPED = UNTRACED;
        pub const NOWAIT = 0x0008;
        pub const EXITED = 0x0010;
        pub const TRAPPED = 0x0020;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast((s & 0xff00) >> 8));
        }
        pub fn TERMSIG(s: u32) u32 {
            return s & 0x7f;
        }
        pub fn STOPSIG(s: u32) u32 {
            return EXITSTATUS(s);
        }
        pub fn IFEXITED(s: u32) bool {
            return TERMSIG(s) == 0;
        }
        pub fn IFSTOPPED(s: u32) bool {
            return @as(u16, @truncate((((s & 0xffff) *% 0x10001) >> 8))) > 0x7f00;
        }
        pub fn IFSIGNALED(s: u32) bool {
            return (s & 0xffff) -% 1 < 0xff;
        }
    },
    .haiku => struct {
        pub const NOHANG = 0x1;
        pub const UNTRACED = 0x2;
        pub const CONTINUED = 0x4;
        pub const EXITED = 0x08;
        pub const STOPPED = 0x10;
        pub const NOWAIT = 0x20;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast(s & 0xff));
        }

        pub fn TERMSIG(s: u32) u32 {
            return (s >> 8) & 0xff;
        }

        pub fn STOPSIG(s: u32) u32 {
            return (s >> 16) & 0xff;
        }

        pub fn IFEXITED(s: u32) bool {
            return (s & ~@as(u32, 0xff)) == 0;
        }

        pub fn IFSTOPPED(s: u32) bool {
            return ((s >> 16) & 0xff) != 0;
        }

        pub fn IFSIGNALED(s: u32) bool {
            return ((s >> 8) & 0xff) != 0;
        }
    },
    .openbsd => struct {
        pub const NOHANG = 1;
        pub const UNTRACED = 2;
        pub const CONTINUED = 8;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast((s >> 8) & 0xff));
        }
        pub fn TERMSIG(s: u32) u32 {
            return (s & 0x7f);
        }
        pub fn STOPSIG(s: u32) u32 {
            return EXITSTATUS(s);
        }
        pub fn IFEXITED(s: u32) bool {
            return TERMSIG(s) == 0;
        }

        pub fn IFCONTINUED(s: u32) bool {
            return ((s & 0o177777) == 0o177777);
        }

        pub fn IFSTOPPED(s: u32) bool {
            return (s & 0xff == 0o177);
        }

        pub fn IFSIGNALED(s: u32) bool {
            return (((s) & 0o177) != 0o177) and (((s) & 0o177) != 0);
        }
    },
    else => void,
}

Typeclock_t[src]

Source Code

Source code
pub const clock_t = switch (native_os) {
    .linux => linux.clock_t,
    .emscripten => emscripten.clock_t,
    .macos, .ios, .tvos, .watchos, .visionos => c_ulong,
    .freebsd => isize,
    .openbsd, .solaris, .illumos => i64,
    .netbsd => u32,
    .haiku => i32,
    else => void,
}

Typecpu_set_t[src]

Source Code

Source code
pub const cpu_set_t = switch (native_os) {
    .linux => linux.cpu_set_t,
    .emscripten => emscripten.cpu_set_t,
    else => void,
}

Typedl_phdr_info[src]

Source Code

Source code
pub const dl_phdr_info = switch (native_os) {
    .linux => linux.dl_phdr_info,
    .emscripten => emscripten.dl_phdr_info,
    .freebsd => extern struct {
        /// Module relocation base.
        addr: if (builtin.target.ptrBitWidth() == 32) std.elf.Elf32_Addr else std.elf.Elf64_Addr,
        /// Module name.
        name: ?[*:0]const u8,
        /// Pointer to module's phdr.
        phdr: [*]std.elf.Phdr,
        /// Number of entries in phdr.
        phnum: u16,
        /// Total number of loads.
        adds: u64,
        /// Total number of unloads.
        subs: u64,
        tls_modid: usize,
        tls_data: ?*anyopaque,
    },
    .solaris, .illumos => extern struct {
        addr: std.elf.Addr,
        name: ?[*:0]const u8,
        phdr: [*]std.elf.Phdr,
        phnum: std.elf.Half,
        /// Incremented when a new object is mapped into the process.
        adds: u64,
        /// Incremented when an object is unmapped from the process.
        subs: u64,
    },
    .openbsd, .haiku, .dragonfly, .netbsd => extern struct {
        addr: usize,
        name: ?[*:0]const u8,
        phdr: [*]std.elf.Phdr,
        phnum: u16,
    },
    else => void,
}

Typeepoll_event[src]

Source Code

Source code
pub const epoll_event = switch (native_os) {
    .linux => linux.epoll_event,
    else => void,
}

Typeifreq[src]

Source Code

Source code
pub const ifreq = switch (native_os) {
    .linux => linux.ifreq,
    .emscripten => emscripten.ifreq,
    .solaris, .illumos => lifreq,
    else => void,
}

Typeitimerspec[src]

Source Code

Source code
pub const itimerspec = switch (native_os) {
    .linux => linux.itimerspec,
    .haiku => extern struct {
        interval: timespec,
        value: timespec,
    },
    else => void,
}

Typemsghdr[src]

Source Code

Source code
pub const msghdr = switch (native_os) {
    .linux => linux.msghdr,
    .openbsd,
    .emscripten,
    .dragonfly,
    .freebsd,
    .netbsd,
    .haiku,
    .solaris,
    .illumos,
    .macos,
    .driverkit,
    .ios,
    .tvos,
    .visionos,
    .watchos,
    => extern struct {
        /// optional address
        name: ?*sockaddr,
        /// size of address
        namelen: socklen_t,
        /// scatter/gather array
        iov: [*]iovec,
        /// # elements in iov
        iovlen: i32,
        /// ancillary data
        control: ?*anyopaque,
        /// ancillary data buffer len
        controllen: socklen_t,
        /// flags on received message
        flags: i32,
    },
    else => void,
}

Typemsghdr_const[src]

Source Code

Source code
pub const msghdr_const = switch (native_os) {
    .linux => linux.msghdr_const,
    .openbsd,
    .emscripten,
    .dragonfly,
    .freebsd,
    .netbsd,
    .haiku,
    .solaris,
    .illumos,
    .macos,
    .driverkit,
    .ios,
    .tvos,
    .visionos,
    .watchos,
    => extern struct {
        /// optional address
        name: ?*const sockaddr,
        /// size of address
        namelen: socklen_t,
        /// scatter/gather array
        iov: [*]const iovec_const,
        /// # elements in iov
        iovlen: i32,
        /// ancillary data
        control: ?*const anyopaque,
        /// ancillary data buffer len
        controllen: socklen_t,
        /// flags on received message
        flags: i32,
    },
    else => void,
}

Typenfds_t[src]

Source Code

Source code
pub const nfds_t = switch (native_os) {
    .linux => linux.nfds_t,
    .emscripten => emscripten.nfds_t,
    .haiku, .solaris, .illumos, .wasi => usize,
    .windows => c_ulong,
    .openbsd, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => u32,
    else => void,
}

Typeperf_event_attr[src]

Source Code

Source code
pub const perf_event_attr = switch (native_os) {
    .linux => linux.perf_event_attr,
    else => void,
}

Typepid_t[src]

Source Code

Source code
pub const pid_t = switch (native_os) {
    .linux => linux.pid_t,
    .emscripten => emscripten.pid_t,
    .windows => windows.HANDLE,
    else => i32,
}

Typepollfd[src]

Source Code

Source code
pub const pollfd = switch (native_os) {
    .linux => linux.pollfd,
    .emscripten => emscripten.pollfd,
    .windows => ws2_32.pollfd,
    else => extern struct {
        fd: fd_t,
        events: i16,
        revents: i16,
    },
}

Typerlim_t[src]

Source Code

Source code
pub const rlim_t = switch (native_os) {
    .linux => linux.rlim_t,
    .emscripten => emscripten.rlim_t,
    .openbsd, .netbsd, .solaris, .illumos, .macos, .ios, .tvos, .watchos, .visionos => u64,
    .haiku, .dragonfly, .freebsd => i64,
    else => void,
}

Typerlimit[src]

Source Code

Source code
pub const rlimit = switch (native_os) {
    .linux, .emscripten => linux.rlimit,
    .windows => void,
    else => extern struct {
        /// Soft limit
        cur: rlim_t,
        /// Hard limit
        max: rlim_t,
    },
}

Typerlimit_resource[src]

Values

ConstantAS[src]

Source Code

Source code
pub const AS: rlimit_resource = .RSS

ConstantAS[src]

Source Code

Source code
pub const AS: rlimit_resource = .VMEM

ConstantAS[src]

Source Code

Source code
pub const AS: rlimit_resource = .VMEM

ConstantAS[src]

Source Code

Source code
pub const AS: rlimit_resource = .VMEM

ConstantAS[src]

Source Code

Source code
pub const AS: rlimit_resource = .VMEM

Source Code

Source code
pub const rlimit_resource = switch (native_os) {
    .linux => linux.rlimit_resource,
    .emscripten => emscripten.rlimit_resource,
    .openbsd, .macos, .ios, .tvos, .watchos, .visionos => enum(c_int) {
        CPU = 0,
        FSIZE = 1,
        DATA = 2,
        STACK = 3,
        CORE = 4,
        RSS = 5,
        MEMLOCK = 6,
        NPROC = 7,
        NOFILE = 8,
        _,

        pub const AS: rlimit_resource = .RSS;
    },
    .freebsd => enum(c_int) {
        CPU = 0,
        FSIZE = 1,
        DATA = 2,
        STACK = 3,
        CORE = 4,
        RSS = 5,
        MEMLOCK = 6,
        NPROC = 7,
        NOFILE = 8,
        SBSIZE = 9,
        VMEM = 10,
        NPTS = 11,
        SWAP = 12,
        KQUEUES = 13,
        UMTXP = 14,
        _,

        pub const AS: rlimit_resource = .VMEM;
    },
    .solaris, .illumos => enum(c_int) {
        CPU = 0,
        FSIZE = 1,
        DATA = 2,
        STACK = 3,
        CORE = 4,
        NOFILE = 5,
        VMEM = 6,
        _,

        pub const AS: rlimit_resource = .VMEM;
    },
    .netbsd => enum(c_int) {
        CPU = 0,
        FSIZE = 1,
        DATA = 2,
        STACK = 3,
        CORE = 4,
        RSS = 5,
        MEMLOCK = 6,
        NPROC = 7,
        NOFILE = 8,
        SBSIZE = 9,
        VMEM = 10,
        NTHR = 11,
        _,

        pub const AS: rlimit_resource = .VMEM;
    },
    .dragonfly => enum(c_int) {
        CPU = 0,
        FSIZE = 1,
        DATA = 2,
        STACK = 3,
        CORE = 4,
        RSS = 5,
        MEMLOCK = 6,
        NPROC = 7,
        NOFILE = 8,
        SBSIZE = 9,
        VMEM = 10,
        POSIXLOCKS = 11,
        _,

        pub const AS: rlimit_resource = .VMEM;
    },
    .haiku => enum(i32) {
        CORE = 0,
        CPU = 1,
        DATA = 2,
        FSIZE = 3,
        NOFILE = 4,
        STACK = 5,
        AS = 6,
        NOVMON = 7,
        _,
    },
    else => void,
}

Typerusage[src]

Values

ConstantSELF[src]

Source Code

Source code
pub const SELF = 0

ConstantCHILDREN[src]

Source Code

Source code
pub const CHILDREN = -1

ConstantSELF[src]

Source Code

Source code
pub const SELF = 0

ConstantCHILDREN[src]

Source Code

Source code
pub const CHILDREN = -1

ConstantTHREAD[src]

Source Code

Source code
pub const THREAD = 1

Source Code

Source code
pub const rusage = switch (native_os) {
    .linux => linux.rusage,
    .emscripten => emscripten.rusage,
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        utime: timeval,
        stime: timeval,
        maxrss: isize,
        ixrss: isize,
        idrss: isize,
        isrss: isize,
        minflt: isize,
        majflt: isize,
        nswap: isize,
        inblock: isize,
        oublock: isize,
        msgsnd: isize,
        msgrcv: isize,
        nsignals: isize,
        nvcsw: isize,
        nivcsw: isize,

        pub const SELF = 0;
        pub const CHILDREN = -1;
    },
    .solaris, .illumos => extern struct {
        utime: timeval,
        stime: timeval,
        maxrss: isize,
        ixrss: isize,
        idrss: isize,
        isrss: isize,
        minflt: isize,
        majflt: isize,
        nswap: isize,
        inblock: isize,
        oublock: isize,
        msgsnd: isize,
        msgrcv: isize,
        nsignals: isize,
        nvcsw: isize,
        nivcsw: isize,

        pub const SELF = 0;
        pub const CHILDREN = -1;
        pub const THREAD = 1;
    },
    else => void,
}

Typesiginfo_t[src]

Source Code

Source code
pub const siginfo_t = switch (native_os) {
    .linux => linux.siginfo_t,
    .emscripten => emscripten.siginfo_t,
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        signo: c_int,
        errno: c_int,
        code: c_int,
        pid: pid_t,
        uid: uid_t,
        status: c_int,
        addr: *allowzero anyopaque,
        value: extern union {
            int: c_int,
            ptr: *anyopaque,
        },
        si_band: c_long,
        _pad: [7]c_ulong,
    },
    .freebsd => extern struct {
        // Signal number.
        signo: c_int,
        // Errno association.
        errno: c_int,
        /// Signal code.
        ///
        /// Cause of signal, one of the SI_ macros or signal-specific values, i.e.
        /// one of the FPE_... values for SIGFPE.
        /// This value is equivalent to the second argument to an old-style FreeBSD
        /// signal handler.
        code: c_int,
        /// Sending process.
        pid: pid_t,
        /// Sender's ruid.
        uid: uid_t,
        /// Exit value.
        status: c_int,
        /// Faulting instruction.
        addr: *allowzero anyopaque,
        /// Signal value.
        value: sigval,
        reason: extern union {
            fault: extern struct {
                /// Machine specific trap code.
                trapno: c_int,
            },
            timer: extern struct {
                timerid: c_int,
                overrun: c_int,
            },
            mesgq: extern struct {
                mqd: c_int,
            },
            poll: extern struct {
                /// Band event for SIGPOLL. UNUSED.
                band: c_long,
            },
            spare: extern struct {
                spare1: c_long,
                spare2: [7]c_int,
            },
        },
    },
    .solaris, .illumos => extern struct {
        signo: c_int,
        code: c_int,
        errno: c_int,
        // 64bit architectures insert 4bytes of padding here, this is done by
        // correctly aligning the reason field
        reason: extern union {
            proc: extern struct {
                pid: pid_t,
                pdata: extern union {
                    kill: extern struct {
                        uid: uid_t,
                        value: sigval_t,
                    },
                    cld: extern struct {
                        utime: clock_t,
                        status: c_int,
                        stime: clock_t,
                    },
                },
                contract: solaris.ctid_t,
                zone: solaris.zoneid_t,
            },
            fault: extern struct {
                addr: *allowzero anyopaque,
                trapno: c_int,
                pc: ?*anyopaque,
            },
            file: extern struct {
                // fd not currently available for SIGPOLL.
                fd: c_int,
                band: c_long,
            },
            prof: extern struct {
                addr: ?*anyopaque,
                timestamp: timespec,
                syscall: c_short,
                sysarg: u8,
                fault: u8,
                args: [8]c_long,
                state: [10]c_int,
            },
            rctl: extern struct {
                entity: i32,
            },
            __pad: [256 - 4 * @sizeOf(c_int)]u8,
        } align(@sizeOf(usize)),

        comptime {
            assert(@sizeOf(@This()) == 256);
            assert(@alignOf(@This()) == @sizeOf(usize));
        }
    },
    .netbsd => extern union {
        pad: [128]u8,
        info: netbsd._ksiginfo,
    },
    .dragonfly => extern struct {
        signo: c_int,
        errno: c_int,
        code: c_int,
        pid: c_int,
        uid: uid_t,
        status: c_int,
        addr: *allowzero anyopaque,
        value: sigval,
        band: c_long,
        __spare__: [7]c_int,
    },
    .haiku => extern struct {
        signo: i32,
        code: i32,
        errno: i32,

        pid: pid_t,
        uid: uid_t,
        addr: *allowzero anyopaque,
    },
    .openbsd => extern struct {
        signo: c_int,
        code: c_int,
        errno: c_int,
        data: extern union {
            proc: extern struct {
                pid: pid_t,
                pdata: extern union {
                    kill: extern struct {
                        uid: uid_t,
                        value: sigval,
                    },
                    cld: extern struct {
                        utime: clock_t,
                        stime: clock_t,
                        status: c_int,
                    },
                },
            },
            fault: extern struct {
                addr: *allowzero anyopaque,
                trapno: c_int,
            },
            __pad: [128 - 3 * @sizeOf(c_int)]u8,
        },

        comptime {
            if (@sizeOf(usize) == 4)
                assert(@sizeOf(@This()) == 128)
            else
                // Take into account the padding between errno and data fields.
                assert(@sizeOf(@This()) == 136);
        }
    },
    else => void,
}

Typesigset_t[src]

Source Code

Source code
pub const sigset_t = switch (native_os) {
    .linux => linux.sigset_t,
    .emscripten => emscripten.sigset_t,
    .openbsd, .macos, .ios, .tvos, .watchos, .visionos => u32,
    .dragonfly, .netbsd, .solaris, .illumos, .freebsd => extern struct {
        __bits: [SIG.WORDS]u32,
    },
    .haiku => u64,
    else => u0,
}

Typesigval[src]

Source Code

Source code
pub const sigval = switch (native_os) {
    .linux => linux.sigval,
    .openbsd, .dragonfly, .freebsd => extern union {
        int: c_int,
        ptr: ?*anyopaque,
    },
    else => void,
}

Typeaddrinfo[src]

Source Code

Source code
pub const addrinfo = if (builtin.abi.isAndroid()) extern struct {
    flags: AI,
    family: i32,
    socktype: i32,
    protocol: i32,
    addrlen: socklen_t,
    canonname: ?[*:0]u8,
    addr: ?*sockaddr,
    next: ?*addrinfo,
} else switch (native_os) {
    .linux, .emscripten => linux.addrinfo,
    .windows => ws2_32.addrinfo,
    .freebsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        flags: AI,
        family: i32,
        socktype: i32,
        protocol: i32,
        addrlen: socklen_t,
        canonname: ?[*:0]u8,
        addr: ?*sockaddr,
        next: ?*addrinfo,
    },
    .solaris, .illumos => extern struct {
        flags: AI,
        family: i32,
        socktype: i32,
        protocol: i32,
        addrlen: socklen_t,
        canonname: ?[*:0]u8,
        addr: ?*sockaddr,
        next: ?*addrinfo,
    },
    .netbsd => extern struct {
        flags: AI,
        family: i32,
        socktype: i32,
        protocol: i32,
        addrlen: socklen_t,
        canonname: ?[*:0]u8,
        addr: ?*sockaddr,
        next: ?*addrinfo,
    },
    .dragonfly => extern struct {
        flags: AI,
        family: i32,
        socktype: i32,
        protocol: i32,
        addrlen: socklen_t,
        canonname: ?[*:0]u8,
        addr: ?*sockaddr,
        next: ?*addrinfo,
    },
    .haiku => extern struct {
        flags: AI,
        family: i32,
        socktype: i32,
        protocol: i32,
        addrlen: socklen_t,
        canonname: ?[*:0]u8,
        addr: ?*sockaddr,
        next: ?*addrinfo,
    },
    .openbsd => extern struct {
        flags: AI,
        family: c_int,
        socktype: c_int,
        protocol: c_int,
        addrlen: socklen_t,
        addr: ?*sockaddr,
        canonname: ?[*:0]u8,
        next: ?*addrinfo,
    },
    else => void,
}

Typesockaddr[src]

Values

ConstantSS_MAXSIZE[src]

Source Code

Source code
pub const SS_MAXSIZE = 128

ConstantSS_MAXSIZE[src]

Source Code

Source code
pub const SS_MAXSIZE = 128

ConstantSS_MAXSIZE[src]

Source Code

Source code
pub const SS_MAXSIZE = 256

ConstantSS_MAXSIZE[src]

Source Code

Source code
pub const SS_MAXSIZE = 128

ConstantSS_MAXSIZE[src]

Source Code

Source code
pub const SS_MAXSIZE = 128

ConstantSS_MAXSIZE[src]

Source Code

Source code
pub const SS_MAXSIZE = 128

ConstantSS_MAXSIZE[src]

Source Code

Source code
pub const SS_MAXSIZE = 256

Source Code

Source code
pub const sockaddr = switch (native_os) {
    .linux, .emscripten => linux.sockaddr,
    .windows => ws2_32.sockaddr,
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        len: u8,
        family: sa_family_t,
        data: [14]u8,

        pub const SS_MAXSIZE = 128;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [126]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };
        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };
        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        /// UNIX domain socket
        pub const un = extern struct {
            len: u8 = @sizeOf(un),
            family: sa_family_t = AF.UNIX,
            path: [104]u8,
        };
    },
    .freebsd => extern struct {
        /// total length
        len: u8,
        /// address family
        family: sa_family_t,
        /// actually longer; address value
        data: [14]u8,

        pub const SS_MAXSIZE = 128;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [126]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        pub const un = extern struct {
            len: u8 = @sizeOf(un),
            family: sa_family_t = AF.UNIX,
            path: [104]u8,
        };
    },
    .solaris, .illumos => extern struct {
        /// address family
        family: sa_family_t,

        /// actually longer; address value
        data: [14]u8,

        pub const SS_MAXSIZE = 256;
        pub const storage = extern struct {
            family: sa_family_t align(8),
            padding: [254]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
            __src_id: u32 = 0,
        };

        /// Definitions for UNIX IPC domain.
        pub const un = extern struct {
            family: sa_family_t = AF.UNIX,
            path: [108]u8,
        };
    },
    .netbsd => extern struct {
        /// total length
        len: u8,
        /// address family
        family: sa_family_t,
        /// actually longer; address value
        data: [14]u8,

        pub const SS_MAXSIZE = 128;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [126]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        /// Definitions for UNIX IPC domain.
        pub const un = extern struct {
            /// total sockaddr length
            len: u8 = @sizeOf(un),

            family: sa_family_t = AF.LOCAL,

            /// path name
            path: [104]u8,
        };
    },
    .dragonfly => extern struct {
        len: u8,
        family: sa_family_t,
        data: [14]u8,

        pub const SS_MAXSIZE = 128;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [126]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        pub const un = extern struct {
            len: u8 = @sizeOf(un),
            family: sa_family_t = AF.UNIX,
            path: [104]u8,
        };
    },
    .haiku => extern struct {
        /// total length
        len: u8,
        /// address family
        family: sa_family_t,
        /// actually longer; address value
        data: [14]u8,

        pub const SS_MAXSIZE = 128;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [126]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        pub const un = extern struct {
            len: u8 = @sizeOf(un),
            family: sa_family_t = AF.UNIX,
            path: [104]u8,
        };
    },
    .openbsd => extern struct {
        /// total length
        len: u8,
        /// address family
        family: sa_family_t,
        /// actually longer; address value
        data: [14]u8,

        pub const SS_MAXSIZE = 256;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [254]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        /// Definitions for UNIX IPC domain.
        pub const un = extern struct {
            /// total sockaddr length
            len: u8 = @sizeOf(un),

            family: sa_family_t = AF.LOCAL,

            /// path name
            path: [104]u8,
        };
    },
    else => void,
}

Typesocklen_t[src]

Source Code

Source code
pub const socklen_t = switch (native_os) {
    .linux, .emscripten => linux.socklen_t,
    .windows => ws2_32.socklen_t,
    else => u32,
}

Typein_port_t[src]

Source Code

Source code
pub const in_port_t = u16

Typesa_family_t[src]

Source Code

Source code
pub const sa_family_t = switch (native_os) {
    .linux, .emscripten => linux.sa_family_t,
    .windows => ws2_32.ADDRESS_FAMILY,
    .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => u8,
    .solaris, .illumos => u16,
    else => void,
}

TypeAF[src]

Values

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = 0

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = 1

ConstantLOCAL[src]

Source Code

Source code
pub const LOCAL = 1

ConstantINET[src]

Source Code

Source code
pub const INET = 2

ConstantAX25[src]

Source Code

Source code
pub const AX25 = 3

ConstantIPX[src]

Source Code

Source code
pub const IPX = 4

ConstantAPPLETALK[src]

Source Code

Source code
pub const APPLETALK = 5

ConstantNETROM[src]

Source Code

Source code
pub const NETROM = 6

ConstantBRIDGE[src]

Source Code

Source code
pub const BRIDGE = 7

ConstantATMPVC[src]

Source Code

Source code
pub const ATMPVC = 8

ConstantX25[src]

Source Code

Source code
pub const X25 = 9

ConstantINET6[src]

Source Code

Source code
pub const INET6 = 10

ConstantROSE[src]

Source Code

Source code
pub const ROSE = 11

ConstantDECnet[src]

Source Code

Source code
pub const DECnet = 12

ConstantNETBEUI[src]

Source Code

Source code
pub const NETBEUI = 13

ConstantSECURITY[src]

Source Code

Source code
pub const SECURITY = 14

ConstantKEY[src]

Source Code

Source code
pub const KEY = 15
Source code
pub const NETLINK = 16
Source code
pub const NETLINK = 16

ConstantPACKET[src]

Source Code

Source code
pub const PACKET = 17

ConstantASH[src]

Source Code

Source code
pub const ASH = 18

ConstantECONET[src]

Source Code

Source code
pub const ECONET = 19

ConstantATMSVC[src]

Source Code

Source code
pub const ATMSVC = 20

ConstantRDS[src]

Source Code

Source code
pub const RDS = 21

ConstantSNA[src]

Source Code

Source code
pub const SNA = 22

ConstantIRDA[src]

Source Code

Source code
pub const IRDA = 23

ConstantPPPOX[src]

Source Code

Source code
pub const PPPOX = 24

ConstantWANPIPE[src]

Source Code

Source code
pub const WANPIPE = 25

ConstantLLC[src]

Source Code

Source code
pub const LLC = 26

ConstantCAN[src]

Source Code

Source code
pub const CAN = 29

ConstantTIPC[src]

Source Code

Source code
pub const TIPC = 30

ConstantBLUETOOTH[src]

Source Code

Source code
pub const BLUETOOTH = 31

ConstantIUCV[src]

Source Code

Source code
pub const IUCV = 32

ConstantRXRPC[src]

Source Code

Source code
pub const RXRPC = 33

ConstantISDN[src]

Source Code

Source code
pub const ISDN = 34

ConstantPHONET[src]

Source Code

Source code
pub const PHONET = 35

ConstantIEEE802154[src]

Source Code

Source code
pub const IEEE802154 = 36

ConstantCAIF[src]

Source Code

Source code
pub const CAIF = 37

ConstantALG[src]

Source Code

Source code
pub const ALG = 38

ConstantNFC[src]

Source Code

Source code
pub const NFC = 39

ConstantVSOCK[src]

Source Code

Source code
pub const VSOCK = 40

ConstantKCM[src]

Source Code

Source code
pub const KCM = 41

ConstantQIPCRTR[src]

Source Code

Source code
pub const QIPCRTR = 42

ConstantMAX[src]

Source Code

Source code
pub const MAX = 43

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = 0

ConstantLOCAL[src]

Source Code

Source code
pub const LOCAL = 1

ConstantLOCAL[src]

Source Code

Source code
pub const LOCAL = 1

ConstantINET[src]

Source Code

Source code
pub const INET = 2

ConstantSYS_CONTROL[src]

Source Code

Source code
pub const SYS_CONTROL = 2
Source code
pub const IMPLINK = 3

ConstantPUP[src]

Source Code

Source code
pub const PUP = 4

ConstantCHAOS[src]

Source Code

Source code
pub const CHAOS = 5

ConstantNS[src]

Source Code

Source code
pub const NS = 6

ConstantISO[src]

Source Code

Source code
pub const ISO = 7

ConstantISO[src]

Source Code

Source code
pub const ISO = 7

ConstantECMA[src]

Source Code

Source code
pub const ECMA = 8

ConstantDATAKIT[src]

Source Code

Source code
pub const DATAKIT = 9

ConstantCCITT[src]

Source Code

Source code
pub const CCITT = 10

ConstantSNA[src]

Source Code

Source code
pub const SNA = 11

ConstantDECnet[src]

Source Code

Source code
pub const DECnet = 12

ConstantDLI[src]

Source Code

Source code
pub const DLI = 13

ConstantLAT[src]

Source Code

Source code
pub const LAT = 14
Source code
pub const HYLINK = 15

ConstantAPPLETALK[src]

Source Code

Source code
pub const APPLETALK = 16

ConstantROUTE[src]

Source Code

Source code
pub const ROUTE = 17
Source code
pub const LINK = 18

ConstantXTP[src]

Source Code

Source code
pub const XTP = 19

ConstantCOIP[src]

Source Code

Source code
pub const COIP = 20

ConstantCNT[src]

Source Code

Source code
pub const CNT = 21

ConstantRTIP[src]

Source Code

Source code
pub const RTIP = 22

ConstantIPX[src]

Source Code

Source code
pub const IPX = 23

ConstantSIP[src]

Source Code

Source code
pub const SIP = 24

ConstantPIP[src]

Source Code

Source code
pub const PIP = 25

ConstantISDN[src]

Source Code

Source code
pub const ISDN = 28

ConstantISDN[src]

Source Code

Source code
pub const ISDN = 28

ConstantKEY[src]

Source Code

Source code
pub const KEY = 29

ConstantINET6[src]

Source Code

Source code
pub const INET6 = 30

ConstantNATM[src]

Source Code

Source code
pub const NATM = 31

ConstantSYSTEM[src]

Source Code

Source code
pub const SYSTEM = 32

ConstantNETBIOS[src]

Source Code

Source code
pub const NETBIOS = 33

ConstantPPP[src]

Source Code

Source code
pub const PPP = 34

ConstantMAX[src]

Source Code

Source code
pub const MAX = 40

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = 0

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = 1

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = 1

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = 1

ConstantINET[src]

Source Code

Source code
pub const INET = 2
Source code
pub const IMPLINK = 3

ConstantPUP[src]

Source Code

Source code
pub const PUP = 4

ConstantCHAOS[src]

Source Code

Source code
pub const CHAOS = 5

ConstantNETBIOS[src]

Source Code

Source code
pub const NETBIOS = 6

ConstantISO[src]

Source Code

Source code
pub const ISO = 7

ConstantISO[src]

Source Code

Source code
pub const ISO = 7

ConstantECMA[src]

Source Code

Source code
pub const ECMA = 8

ConstantDATAKIT[src]

Source Code

Source code
pub const DATAKIT = 9

ConstantCCITT[src]

Source Code

Source code
pub const CCITT = 10

ConstantSNA[src]

Source Code

Source code
pub const SNA = 11

ConstantDECnet[src]

Source Code

Source code
pub const DECnet = 12

ConstantDLI[src]

Source Code

Source code
pub const DLI = 13

ConstantLAT[src]

Source Code

Source code
pub const LAT = 14
Source code
pub const HYLINK = 15

ConstantAPPLETALK[src]

Source Code

Source code
pub const APPLETALK = 16

ConstantROUTE[src]

Source Code

Source code
pub const ROUTE = 17
Source code
pub const LINK = 18

Constantpseudo_XTP[src]

Source Code

Source code
pub const pseudo_XTP = 19

ConstantCOIP[src]

Source Code

Source code
pub const COIP = 20

ConstantCNT[src]

Source Code

Source code
pub const CNT = 21

Constantpseudo_RTIP[src]

Source Code

Source code
pub const pseudo_RTIP = 22

ConstantIPX[src]

Source Code

Source code
pub const IPX = 23

ConstantSIP[src]

Source Code

Source code
pub const SIP = 24

Constantpseudo_PIP[src]

Source Code

Source code
pub const pseudo_PIP = 25

ConstantISDN[src]

Source Code

Source code
pub const ISDN = 26

ConstantISDN[src]

Source Code

Source code
pub const ISDN = 26

Constantpseudo_KEY[src]

Source Code

Source code
pub const pseudo_KEY = 27

ConstantINET6[src]

Source Code

Source code
pub const INET6 = 28

ConstantNATM[src]

Source Code

Source code
pub const NATM = 29

ConstantATM[src]

Source Code

Source code
pub const ATM = 30

Constantpseudo_HDRCMPLT[src]

Source Code

Source code
pub const pseudo_HDRCMPLT = 31

ConstantNETGRAPH[src]

Source Code

Source code
pub const NETGRAPH = 32

ConstantSLOW[src]

Source Code

Source code
pub const SLOW = 33

ConstantSCLUSTER[src]

Source Code

Source code
pub const SCLUSTER = 34

ConstantARP[src]

Source Code

Source code
pub const ARP = 35

ConstantBLUETOOTH[src]

Source Code

Source code
pub const BLUETOOTH = 36

ConstantIEEE80211[src]

Source Code

Source code
pub const IEEE80211 = 37

ConstantINET_SDP[src]

Source Code

Source code
pub const INET_SDP = 40

ConstantINET6_SDP[src]

Source Code

Source code
pub const INET6_SDP = 42

ConstantMAX[src]

Source Code

Source code
pub const MAX = 42

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = 0

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = 1

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = 1

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = 1

ConstantINET[src]

Source Code

Source code
pub const INET = 2
Source code
pub const IMPLINK = 3

ConstantPUP[src]

Source Code

Source code
pub const PUP = 4

ConstantCHAOS[src]

Source Code

Source code
pub const CHAOS = 5

ConstantNS[src]

Source Code

Source code
pub const NS = 6

ConstantNBS[src]

Source Code

Source code
pub const NBS = 7

ConstantECMA[src]

Source Code

Source code
pub const ECMA = 8

ConstantDATAKIT[src]

Source Code

Source code
pub const DATAKIT = 9

ConstantCCITT[src]

Source Code

Source code
pub const CCITT = 10

ConstantSNA[src]

Source Code

Source code
pub const SNA = 11

ConstantDECnet[src]

Source Code

Source code
pub const DECnet = 12

ConstantDLI[src]

Source Code

Source code
pub const DLI = 13

ConstantLAT[src]

Source Code

Source code
pub const LAT = 14
Source code
pub const HYLINK = 15

ConstantAPPLETALK[src]

Source Code

Source code
pub const APPLETALK = 16

ConstantNIT[src]

Source Code

Source code
pub const NIT = 17

Constant@"802"[src]

Source Code

Source code
pub const @"802" = 18

ConstantOSI[src]

Source Code

Source code
pub const OSI = 19

ConstantX25[src]

Source Code

Source code
pub const X25 = 20

ConstantOSINET[src]

Source Code

Source code
pub const OSINET = 21

ConstantGOSIP[src]

Source Code

Source code
pub const GOSIP = 22

ConstantIPX[src]

Source Code

Source code
pub const IPX = 23

ConstantROUTE[src]

Source Code

Source code
pub const ROUTE = 24
Source code
pub const LINK = 25

ConstantINET6[src]

Source Code

Source code
pub const INET6 = 26

ConstantKEY[src]

Source Code

Source code
pub const KEY = 27

ConstantNCA[src]

Source Code

Source code
pub const NCA = 28

ConstantPOLICY[src]

Source Code

Source code
pub const POLICY = 29

ConstantINET_OFFLOAD[src]

Source Code

Source code
pub const INET_OFFLOAD = 30

ConstantTRILL[src]

Source Code

Source code
pub const TRILL = 31

ConstantPACKET[src]

Source Code

Source code
pub const PACKET = 32
Source code
pub const LX_NETLINK = 33

ConstantMAX[src]

Source Code

Source code
pub const MAX = 33

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = 0

ConstantLOCAL[src]

Source Code

Source code
pub const LOCAL = 1

ConstantLOCAL[src]

Source Code

Source code
pub const LOCAL = 1

ConstantINET[src]

Source Code

Source code
pub const INET = 2
Source code
pub const IMPLINK = 3

ConstantPUP[src]

Source Code

Source code
pub const PUP = 4

ConstantCHAOS[src]

Source Code

Source code
pub const CHAOS = 5

ConstantNS[src]

Source Code

Source code
pub const NS = 6

ConstantISO[src]

Source Code

Source code
pub const ISO = 7

ConstantISO[src]

Source Code

Source code
pub const ISO = 7

ConstantECMA[src]

Source Code

Source code
pub const ECMA = 8

ConstantDATAKIT[src]

Source Code

Source code
pub const DATAKIT = 9

ConstantCCITT[src]

Source Code

Source code
pub const CCITT = 10

ConstantSNA[src]

Source Code

Source code
pub const SNA = 11

ConstantDECnet[src]

Source Code

Source code
pub const DECnet = 12

ConstantDLI[src]

Source Code

Source code
pub const DLI = 13

ConstantLAT[src]

Source Code

Source code
pub const LAT = 14
Source code
pub const HYLINK = 15

ConstantAPPLETALK[src]

Source Code

Source code
pub const APPLETALK = 16

ConstantOROUTE[src]

Source Code

Source code
pub const OROUTE = 17
Source code
pub const LINK = 18

ConstantCOIP[src]

Source Code

Source code
pub const COIP = 20

ConstantCNT[src]

Source Code

Source code
pub const CNT = 21

ConstantIPX[src]

Source Code

Source code
pub const IPX = 23

ConstantINET6[src]

Source Code

Source code
pub const INET6 = 24

ConstantISDN[src]

Source Code

Source code
pub const ISDN = 26

ConstantISDN[src]

Source Code

Source code
pub const ISDN = 26

ConstantNATM[src]

Source Code

Source code
pub const NATM = 27

ConstantARP[src]

Source Code

Source code
pub const ARP = 28

ConstantBLUETOOTH[src]

Source Code

Source code
pub const BLUETOOTH = 31

ConstantIEEE80211[src]

Source Code

Source code
pub const IEEE80211 = 32

ConstantMPLS[src]

Source Code

Source code
pub const MPLS = 33

ConstantROUTE[src]

Source Code

Source code
pub const ROUTE = 34

ConstantCAN[src]

Source Code

Source code
pub const CAN = 35

ConstantETHER[src]

Source Code

Source code
pub const ETHER = 36

ConstantMAX[src]

Source Code

Source code
pub const MAX = 37

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = 0

ConstantISO[src]

Source Code

Source code
pub const ISO = 7

ConstantLOCAL[src]

Source Code

Source code
pub const LOCAL = 1

ConstantLOCAL[src]

Source Code

Source code
pub const LOCAL = 1

ConstantINET[src]

Source Code

Source code
pub const INET = 2
Source code
pub const IMPLINK = 3

ConstantPUP[src]

Source Code

Source code
pub const PUP = 4

ConstantCHAOS[src]

Source Code

Source code
pub const CHAOS = 5

ConstantNETBIOS[src]

Source Code

Source code
pub const NETBIOS = 6

ConstantISO[src]

Source Code

Source code
pub const ISO = 7

ConstantECMA[src]

Source Code

Source code
pub const ECMA = 8

ConstantDATAKIT[src]

Source Code

Source code
pub const DATAKIT = 9

ConstantCCITT[src]

Source Code

Source code
pub const CCITT = 10

ConstantSNA[src]

Source Code

Source code
pub const SNA = 11

ConstantDLI[src]

Source Code

Source code
pub const DLI = 13

ConstantLAT[src]

Source Code

Source code
pub const LAT = 14
Source code
pub const HYLINK = 15

ConstantAPPLETALK[src]

Source Code

Source code
pub const APPLETALK = 16

ConstantROUTE[src]

Source Code

Source code
pub const ROUTE = 17
Source code
pub const LINK = 18

ConstantCOIP[src]

Source Code

Source code
pub const COIP = 20

ConstantCNT[src]

Source Code

Source code
pub const CNT = 21

ConstantIPX[src]

Source Code

Source code
pub const IPX = 23

ConstantSIP[src]

Source Code

Source code
pub const SIP = 24

ConstantISDN[src]

Source Code

Source code
pub const ISDN = 26

ConstantINET6[src]

Source Code

Source code
pub const INET6 = 28

ConstantNATM[src]

Source Code

Source code
pub const NATM = 29

ConstantATM[src]

Source Code

Source code
pub const ATM = 30

ConstantNETGRAPH[src]

Source Code

Source code
pub const NETGRAPH = 32

ConstantBLUETOOTH[src]

Source Code

Source code
pub const BLUETOOTH = 33

ConstantMPLS[src]

Source Code

Source code
pub const MPLS = 34

ConstantMAX[src]

Source Code

Source code
pub const MAX = 36

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = 0

ConstantINET[src]

Source Code

Source code
pub const INET = 1

ConstantAPPLETALK[src]

Source Code

Source code
pub const APPLETALK = 2

ConstantROUTE[src]

Source Code

Source code
pub const ROUTE = 3
Source code
pub const LINK = 4

ConstantINET6[src]

Source Code

Source code
pub const INET6 = 5

ConstantDLI[src]

Source Code

Source code
pub const DLI = 6

ConstantIPX[src]

Source Code

Source code
pub const IPX = 7

ConstantNOTIFY[src]

Source Code

Source code
pub const NOTIFY = 8

ConstantLOCAL[src]

Source Code

Source code
pub const LOCAL = 9

ConstantLOCAL[src]

Source Code

Source code
pub const LOCAL = 9

ConstantBLUETOOTH[src]

Source Code

Source code
pub const BLUETOOTH = 10

ConstantMAX[src]

Source Code

Source code
pub const MAX = 11

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = 0

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = 1

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = 1

ConstantINET[src]

Source Code

Source code
pub const INET = 2

ConstantAPPLETALK[src]

Source Code

Source code
pub const APPLETALK = 16

ConstantINET6[src]

Source Code

Source code
pub const INET6 = 24

ConstantKEY[src]

Source Code

Source code
pub const KEY = 30

ConstantROUTE[src]

Source Code

Source code
pub const ROUTE = 17

ConstantSNA[src]

Source Code

Source code
pub const SNA = 11

ConstantMPLS[src]

Source Code

Source code
pub const MPLS = 33

ConstantBLUETOOTH[src]

Source Code

Source code
pub const BLUETOOTH = 32

ConstantISDN[src]

Source Code

Source code
pub const ISDN = 26

ConstantMAX[src]

Source Code

Source code
pub const MAX = 36

Source Code

Source code
pub const AF = if (builtin.abi.isAndroid()) struct {
    pub const UNSPEC = 0;
    pub const UNIX = 1;
    pub const LOCAL = 1;
    pub const INET = 2;
    pub const AX25 = 3;
    pub const IPX = 4;
    pub const APPLETALK = 5;
    pub const NETROM = 6;
    pub const BRIDGE = 7;
    pub const ATMPVC = 8;
    pub const X25 = 9;
    pub const INET6 = 10;
    pub const ROSE = 11;
    pub const DECnet = 12;
    pub const NETBEUI = 13;
    pub const SECURITY = 14;
    pub const KEY = 15;
    pub const NETLINK = 16;
    pub const ROUTE = NETLINK;
    pub const PACKET = 17;
    pub const ASH = 18;
    pub const ECONET = 19;
    pub const ATMSVC = 20;
    pub const RDS = 21;
    pub const SNA = 22;
    pub const IRDA = 23;
    pub const PPPOX = 24;
    pub const WANPIPE = 25;
    pub const LLC = 26;
    pub const CAN = 29;
    pub const TIPC = 30;
    pub const BLUETOOTH = 31;
    pub const IUCV = 32;
    pub const RXRPC = 33;
    pub const ISDN = 34;
    pub const PHONET = 35;
    pub const IEEE802154 = 36;
    pub const CAIF = 37;
    pub const ALG = 38;
    pub const NFC = 39;
    pub const VSOCK = 40;
    pub const KCM = 41;
    pub const QIPCRTR = 42;
    pub const MAX = 43;
} else switch (native_os) {
    .linux, .emscripten => linux.AF,
    .windows => ws2_32.AF,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const UNSPEC = 0;
        pub const LOCAL = 1;
        pub const UNIX = LOCAL;
        pub const INET = 2;
        pub const SYS_CONTROL = 2;
        pub const IMPLINK = 3;
        pub const PUP = 4;
        pub const CHAOS = 5;
        pub const NS = 6;
        pub const ISO = 7;
        pub const OSI = ISO;
        pub const ECMA = 8;
        pub const DATAKIT = 9;
        pub const CCITT = 10;
        pub const SNA = 11;
        pub const DECnet = 12;
        pub const DLI = 13;
        pub const LAT = 14;
        pub const HYLINK = 15;
        pub const APPLETALK = 16;
        pub const ROUTE = 17;
        pub const LINK = 18;
        pub const XTP = 19;
        pub const COIP = 20;
        pub const CNT = 21;
        pub const RTIP = 22;
        pub const IPX = 23;
        pub const SIP = 24;
        pub const PIP = 25;
        pub const ISDN = 28;
        pub const E164 = ISDN;
        pub const KEY = 29;
        pub const INET6 = 30;
        pub const NATM = 31;
        pub const SYSTEM = 32;
        pub const NETBIOS = 33;
        pub const PPP = 34;
        pub const MAX = 40;
    },
    .freebsd => struct {
        pub const UNSPEC = 0;
        pub const UNIX = 1;
        pub const LOCAL = UNIX;
        pub const FILE = LOCAL;
        pub const INET = 2;
        pub const IMPLINK = 3;
        pub const PUP = 4;
        pub const CHAOS = 5;
        pub const NETBIOS = 6;
        pub const ISO = 7;
        pub const OSI = ISO;
        pub const ECMA = 8;
        pub const DATAKIT = 9;
        pub const CCITT = 10;
        pub const SNA = 11;
        pub const DECnet = 12;
        pub const DLI = 13;
        pub const LAT = 14;
        pub const HYLINK = 15;
        pub const APPLETALK = 16;
        pub const ROUTE = 17;
        pub const LINK = 18;
        pub const pseudo_XTP = 19;
        pub const COIP = 20;
        pub const CNT = 21;
        pub const pseudo_RTIP = 22;
        pub const IPX = 23;
        pub const SIP = 24;
        pub const pseudo_PIP = 25;
        pub const ISDN = 26;
        pub const E164 = ISDN;
        pub const pseudo_KEY = 27;
        pub const INET6 = 28;
        pub const NATM = 29;
        pub const ATM = 30;
        pub const pseudo_HDRCMPLT = 31;
        pub const NETGRAPH = 32;
        pub const SLOW = 33;
        pub const SCLUSTER = 34;
        pub const ARP = 35;
        pub const BLUETOOTH = 36;
        pub const IEEE80211 = 37;
        pub const INET_SDP = 40;
        pub const INET6_SDP = 42;
        pub const MAX = 42;
    },
    .solaris, .illumos => struct {
        pub const UNSPEC = 0;
        pub const UNIX = 1;
        pub const LOCAL = UNIX;
        pub const FILE = UNIX;
        pub const INET = 2;
        pub const IMPLINK = 3;
        pub const PUP = 4;
        pub const CHAOS = 5;
        pub const NS = 6;
        pub const NBS = 7;
        pub const ECMA = 8;
        pub const DATAKIT = 9;
        pub const CCITT = 10;
        pub const SNA = 11;
        pub const DECnet = 12;
        pub const DLI = 13;
        pub const LAT = 14;
        pub const HYLINK = 15;
        pub const APPLETALK = 16;
        pub const NIT = 17;
        pub const @"802" = 18;
        pub const OSI = 19;
        pub const X25 = 20;
        pub const OSINET = 21;
        pub const GOSIP = 22;
        pub const IPX = 23;
        pub const ROUTE = 24;
        pub const LINK = 25;
        pub const INET6 = 26;
        pub const KEY = 27;
        pub const NCA = 28;
        pub const POLICY = 29;
        pub const INET_OFFLOAD = 30;
        pub const TRILL = 31;
        pub const PACKET = 32;
        pub const LX_NETLINK = 33;
        pub const MAX = 33;
    },
    .netbsd => struct {
        pub const UNSPEC = 0;
        pub const LOCAL = 1;
        pub const UNIX = LOCAL;
        pub const INET = 2;
        pub const IMPLINK = 3;
        pub const PUP = 4;
        pub const CHAOS = 5;
        pub const NS = 6;
        pub const ISO = 7;
        pub const OSI = ISO;
        pub const ECMA = 8;
        pub const DATAKIT = 9;
        pub const CCITT = 10;
        pub const SNA = 11;
        pub const DECnet = 12;
        pub const DLI = 13;
        pub const LAT = 14;
        pub const HYLINK = 15;
        pub const APPLETALK = 16;
        pub const OROUTE = 17;
        pub const LINK = 18;
        pub const COIP = 20;
        pub const CNT = 21;
        pub const IPX = 23;
        pub const INET6 = 24;
        pub const ISDN = 26;
        pub const E164 = ISDN;
        pub const NATM = 27;
        pub const ARP = 28;
        pub const BLUETOOTH = 31;
        pub const IEEE80211 = 32;
        pub const MPLS = 33;
        pub const ROUTE = 34;
        pub const CAN = 35;
        pub const ETHER = 36;
        pub const MAX = 37;
    },
    .dragonfly => struct {
        pub const UNSPEC = 0;
        pub const OSI = ISO;
        pub const UNIX = LOCAL;
        pub const LOCAL = 1;
        pub const INET = 2;
        pub const IMPLINK = 3;
        pub const PUP = 4;
        pub const CHAOS = 5;
        pub const NETBIOS = 6;
        pub const ISO = 7;
        pub const ECMA = 8;
        pub const DATAKIT = 9;
        pub const CCITT = 10;
        pub const SNA = 11;
        pub const DLI = 13;
        pub const LAT = 14;
        pub const HYLINK = 15;
        pub const APPLETALK = 16;
        pub const ROUTE = 17;
        pub const LINK = 18;
        pub const COIP = 20;
        pub const CNT = 21;
        pub const IPX = 23;
        pub const SIP = 24;
        pub const ISDN = 26;
        pub const INET6 = 28;
        pub const NATM = 29;
        pub const ATM = 30;
        pub const NETGRAPH = 32;
        pub const BLUETOOTH = 33;
        pub const MPLS = 34;
        pub const MAX = 36;
    },
    .haiku => struct {
        pub const UNSPEC = 0;
        pub const INET = 1;
        pub const APPLETALK = 2;
        pub const ROUTE = 3;
        pub const LINK = 4;
        pub const INET6 = 5;
        pub const DLI = 6;
        pub const IPX = 7;
        pub const NOTIFY = 8;
        pub const LOCAL = 9;
        pub const UNIX = LOCAL;
        pub const BLUETOOTH = 10;
        pub const MAX = 11;
    },
    .openbsd => struct {
        pub const UNSPEC = 0;
        pub const UNIX = 1;
        pub const LOCAL = UNIX;
        pub const INET = 2;
        pub const APPLETALK = 16;
        pub const INET6 = 24;
        pub const KEY = 30;
        pub const ROUTE = 17;
        pub const SNA = 11;
        pub const MPLS = 33;
        pub const BLUETOOTH = 32;
        pub const ISDN = 26;
        pub const MAX = 36;
    },
    else => void,
}

TypePF[src]

Values

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = AF.UNSPEC

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = AF.UNIX

ConstantLOCAL[src]

Source Code

Source code
pub const LOCAL = AF.LOCAL

ConstantINET[src]

Source Code

Source code
pub const INET = AF.INET

ConstantAX25[src]

Source Code

Source code
pub const AX25 = AF.AX25

ConstantIPX[src]

Source Code

Source code
pub const IPX = AF.IPX

ConstantAPPLETALK[src]

Source Code

Source code
pub const APPLETALK = AF.APPLETALK

ConstantNETROM[src]

Source Code

Source code
pub const NETROM = AF.NETROM

ConstantBRIDGE[src]

Source Code

Source code
pub const BRIDGE = AF.BRIDGE

ConstantATMPVC[src]

Source Code

Source code
pub const ATMPVC = AF.ATMPVC

ConstantX25[src]

Source Code

Source code
pub const X25 = AF.X25

ConstantPF_INET6[src]

Source Code

Source code
pub const PF_INET6 = AF.INET6

ConstantPF_ROSE[src]

Source Code

Source code
pub const PF_ROSE = AF.ROSE

ConstantPF_DECnet[src]

Source Code

Source code
pub const PF_DECnet = AF.DECnet

ConstantPF_NETBEUI[src]

Source Code

Source code
pub const PF_NETBEUI = AF.NETBEUI

ConstantPF_SECURITY[src]

Source Code

Source code
pub const PF_SECURITY = AF.SECURITY

ConstantPF_KEY[src]

Source Code

Source code
pub const PF_KEY = AF.KEY
Source code
pub const PF_NETLINK = AF.NETLINK

ConstantPF_ROUTE[src]

Source Code

Source code
pub const PF_ROUTE = AF.ROUTE

ConstantPF_PACKET[src]

Source Code

Source code
pub const PF_PACKET = AF.PACKET

ConstantPF_ASH[src]

Source Code

Source code
pub const PF_ASH = AF.ASH

ConstantPF_ECONET[src]

Source Code

Source code
pub const PF_ECONET = AF.ECONET

ConstantPF_ATMSVC[src]

Source Code

Source code
pub const PF_ATMSVC = AF.ATMSVC

ConstantPF_RDS[src]

Source Code

Source code
pub const PF_RDS = AF.RDS

ConstantPF_SNA[src]

Source Code

Source code
pub const PF_SNA = AF.SNA

ConstantPF_IRDA[src]

Source Code

Source code
pub const PF_IRDA = AF.IRDA

ConstantPF_PPPOX[src]

Source Code

Source code
pub const PF_PPPOX = AF.PPPOX

ConstantPF_WANPIPE[src]

Source Code

Source code
pub const PF_WANPIPE = AF.WANPIPE

ConstantPF_LLC[src]

Source Code

Source code
pub const PF_LLC = AF.LLC

ConstantPF_CAN[src]

Source Code

Source code
pub const PF_CAN = AF.CAN

ConstantPF_TIPC[src]

Source Code

Source code
pub const PF_TIPC = AF.TIPC

ConstantPF_BLUETOOTH[src]

Source Code

Source code
pub const PF_BLUETOOTH = AF.BLUETOOTH

ConstantPF_IUCV[src]

Source Code

Source code
pub const PF_IUCV = AF.IUCV

ConstantPF_RXRPC[src]

Source Code

Source code
pub const PF_RXRPC = AF.RXRPC

ConstantPF_ISDN[src]

Source Code

Source code
pub const PF_ISDN = AF.ISDN

ConstantPF_PHONET[src]

Source Code

Source code
pub const PF_PHONET = AF.PHONET

ConstantPF_IEEE802154[src]

Source Code

Source code
pub const PF_IEEE802154 = AF.IEEE802154

ConstantPF_CAIF[src]

Source Code

Source code
pub const PF_CAIF = AF.CAIF

ConstantPF_ALG[src]

Source Code

Source code
pub const PF_ALG = AF.ALG

ConstantPF_NFC[src]

Source Code

Source code
pub const PF_NFC = AF.NFC

ConstantPF_VSOCK[src]

Source Code

Source code
pub const PF_VSOCK = AF.VSOCK

ConstantPF_KCM[src]

Source Code

Source code
pub const PF_KCM = AF.KCM

ConstantPF_QIPCRTR[src]

Source Code

Source code
pub const PF_QIPCRTR = AF.QIPCRTR

ConstantPF_MAX[src]

Source Code

Source code
pub const PF_MAX = AF.MAX

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = AF.UNSPEC

ConstantLOCAL[src]

Source Code

Source code
pub const LOCAL = AF.LOCAL

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = PF.LOCAL

ConstantINET[src]

Source Code

Source code
pub const INET = AF.INET
Source code
pub const IMPLINK = AF.IMPLINK

ConstantPUP[src]

Source Code

Source code
pub const PUP = AF.PUP

ConstantCHAOS[src]

Source Code

Source code
pub const CHAOS = AF.CHAOS

ConstantNS[src]

Source Code

Source code
pub const NS = AF.NS

ConstantISO[src]

Source Code

Source code
pub const ISO = AF.ISO

ConstantOSI[src]

Source Code

Source code
pub const OSI = AF.ISO

ConstantECMA[src]

Source Code

Source code
pub const ECMA = AF.ECMA

ConstantDATAKIT[src]

Source Code

Source code
pub const DATAKIT = AF.DATAKIT

ConstantCCITT[src]

Source Code

Source code
pub const CCITT = AF.CCITT

ConstantSNA[src]

Source Code

Source code
pub const SNA = AF.SNA

ConstantDECnet[src]

Source Code

Source code
pub const DECnet = AF.DECnet

ConstantDLI[src]

Source Code

Source code
pub const DLI = AF.DLI

ConstantLAT[src]

Source Code

Source code
pub const LAT = AF.LAT
Source code
pub const HYLINK = AF.HYLINK

ConstantAPPLETALK[src]

Source Code

Source code
pub const APPLETALK = AF.APPLETALK

ConstantROUTE[src]

Source Code

Source code
pub const ROUTE = AF.ROUTE
Source code
pub const LINK = AF.LINK

ConstantXTP[src]

Source Code

Source code
pub const XTP = AF.XTP

ConstantCOIP[src]

Source Code

Source code
pub const COIP = AF.COIP

ConstantCNT[src]

Source Code

Source code
pub const CNT = AF.CNT

ConstantSIP[src]

Source Code

Source code
pub const SIP = AF.SIP

ConstantIPX[src]

Source Code

Source code
pub const IPX = AF.IPX

ConstantRTIP[src]

Source Code

Source code
pub const RTIP = AF.RTIP

ConstantPIP[src]

Source Code

Source code
pub const PIP = AF.PIP

ConstantISDN[src]

Source Code

Source code
pub const ISDN = AF.ISDN

ConstantKEY[src]

Source Code

Source code
pub const KEY = AF.KEY

ConstantINET6[src]

Source Code

Source code
pub const INET6 = AF.INET6

ConstantNATM[src]

Source Code

Source code
pub const NATM = AF.NATM

ConstantSYSTEM[src]

Source Code

Source code
pub const SYSTEM = AF.SYSTEM

ConstantNETBIOS[src]

Source Code

Source code
pub const NETBIOS = AF.NETBIOS

ConstantPPP[src]

Source Code

Source code
pub const PPP = AF.PPP

ConstantMAX[src]

Source Code

Source code
pub const MAX = AF.MAX

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = AF.UNSPEC

ConstantLOCAL[src]

Source Code

Source code
pub const LOCAL = AF.LOCAL

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = PF.LOCAL

ConstantINET[src]

Source Code

Source code
pub const INET = AF.INET
Source code
pub const IMPLINK = AF.IMPLINK

ConstantPUP[src]

Source Code

Source code
pub const PUP = AF.PUP

ConstantCHAOS[src]

Source Code

Source code
pub const CHAOS = AF.CHAOS

ConstantNETBIOS[src]

Source Code

Source code
pub const NETBIOS = AF.NETBIOS

ConstantISO[src]

Source Code

Source code
pub const ISO = AF.ISO

ConstantOSI[src]

Source Code

Source code
pub const OSI = AF.ISO

ConstantECMA[src]

Source Code

Source code
pub const ECMA = AF.ECMA

ConstantDATAKIT[src]

Source Code

Source code
pub const DATAKIT = AF.DATAKIT

ConstantCCITT[src]

Source Code

Source code
pub const CCITT = AF.CCITT

ConstantDECnet[src]

Source Code

Source code
pub const DECnet = AF.DECnet

ConstantDLI[src]

Source Code

Source code
pub const DLI = AF.DLI

ConstantLAT[src]

Source Code

Source code
pub const LAT = AF.LAT
Source code
pub const HYLINK = AF.HYLINK

ConstantAPPLETALK[src]

Source Code

Source code
pub const APPLETALK = AF.APPLETALK

ConstantROUTE[src]

Source Code

Source code
pub const ROUTE = AF.ROUTE
Source code
pub const LINK = AF.LINK

ConstantXTP[src]

Source Code

Source code
pub const XTP = AF.pseudo_XTP

ConstantCOIP[src]

Source Code

Source code
pub const COIP = AF.COIP

ConstantCNT[src]

Source Code

Source code
pub const CNT = AF.CNT

ConstantSIP[src]

Source Code

Source code
pub const SIP = AF.SIP

ConstantIPX[src]

Source Code

Source code
pub const IPX = AF.IPX

ConstantRTIP[src]

Source Code

Source code
pub const RTIP = AF.pseudo_RTIP

ConstantPIP[src]

Source Code

Source code
pub const PIP = AF.pseudo_PIP

ConstantISDN[src]

Source Code

Source code
pub const ISDN = AF.ISDN

ConstantKEY[src]

Source Code

Source code
pub const KEY = AF.pseudo_KEY

ConstantINET6[src]

Source Code

Source code
pub const INET6 = AF.pseudo_INET6

ConstantNATM[src]

Source Code

Source code
pub const NATM = AF.NATM

ConstantATM[src]

Source Code

Source code
pub const ATM = AF.ATM

ConstantNETGRAPH[src]

Source Code

Source code
pub const NETGRAPH = AF.NETGRAPH

ConstantSLOW[src]

Source Code

Source code
pub const SLOW = AF.SLOW

ConstantSCLUSTER[src]

Source Code

Source code
pub const SCLUSTER = AF.SCLUSTER

ConstantARP[src]

Source Code

Source code
pub const ARP = AF.ARP

ConstantBLUETOOTH[src]

Source Code

Source code
pub const BLUETOOTH = AF.BLUETOOTH

ConstantIEEE80211[src]

Source Code

Source code
pub const IEEE80211 = AF.IEEE80211

ConstantINET_SDP[src]

Source Code

Source code
pub const INET_SDP = AF.INET_SDP

ConstantINET6_SDP[src]

Source Code

Source code
pub const INET6_SDP = AF.INET6_SDP

ConstantMAX[src]

Source Code

Source code
pub const MAX = AF.MAX

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = AF.UNSPEC

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = AF.UNIX

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = AF.UNIX

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = AF.UNIX

ConstantINET[src]

Source Code

Source code
pub const INET = AF.INET
Source code
pub const IMPLINK = AF.IMPLINK

ConstantPUP[src]

Source Code

Source code
pub const PUP = AF.PUP

ConstantCHAOS[src]

Source Code

Source code
pub const CHAOS = AF.CHAOS

ConstantNS[src]

Source Code

Source code
pub const NS = AF.NS

ConstantNBS[src]

Source Code

Source code
pub const NBS = AF.NBS

ConstantECMA[src]

Source Code

Source code
pub const ECMA = AF.ECMA

ConstantDATAKIT[src]

Source Code

Source code
pub const DATAKIT = AF.DATAKIT

ConstantCCITT[src]

Source Code

Source code
pub const CCITT = AF.CCITT

ConstantSNA[src]

Source Code

Source code
pub const SNA = AF.SNA

ConstantDECnet[src]

Source Code

Source code
pub const DECnet = AF.DECnet

ConstantDLI[src]

Source Code

Source code
pub const DLI = AF.DLI

ConstantLAT[src]

Source Code

Source code
pub const LAT = AF.LAT
Source code
pub const HYLINK = AF.HYLINK

ConstantAPPLETALK[src]

Source Code

Source code
pub const APPLETALK = AF.APPLETALK

ConstantNIT[src]

Source Code

Source code
pub const NIT = AF.NIT

Constant@"802"[src]

Source Code

Source code
pub const @"802" = AF.@"802"

ConstantOSI[src]

Source Code

Source code
pub const OSI = AF.OSI

ConstantX25[src]

Source Code

Source code
pub const X25 = AF.X25

ConstantOSINET[src]

Source Code

Source code
pub const OSINET = AF.OSINET

ConstantGOSIP[src]

Source Code

Source code
pub const GOSIP = AF.GOSIP

ConstantIPX[src]

Source Code

Source code
pub const IPX = AF.IPX

ConstantROUTE[src]

Source Code

Source code
pub const ROUTE = AF.ROUTE
Source code
pub const LINK = AF.LINK

ConstantINET6[src]

Source Code

Source code
pub const INET6 = AF.INET6

ConstantKEY[src]

Source Code

Source code
pub const KEY = AF.KEY

ConstantNCA[src]

Source Code

Source code
pub const NCA = AF.NCA

ConstantPOLICY[src]

Source Code

Source code
pub const POLICY = AF.POLICY

ConstantTRILL[src]

Source Code

Source code
pub const TRILL = AF.TRILL

ConstantPACKET[src]

Source Code

Source code
pub const PACKET = AF.PACKET
Source code
pub const LX_NETLINK = AF.LX_NETLINK

ConstantMAX[src]

Source Code

Source code
pub const MAX = AF.MAX

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = AF.UNSPEC

ConstantLOCAL[src]

Source Code

Source code
pub const LOCAL = AF.LOCAL

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = PF.LOCAL

ConstantINET[src]

Source Code

Source code
pub const INET = AF.INET
Source code
pub const IMPLINK = AF.IMPLINK

ConstantPUP[src]

Source Code

Source code
pub const PUP = AF.PUP

ConstantCHAOS[src]

Source Code

Source code
pub const CHAOS = AF.CHAOS

ConstantNS[src]

Source Code

Source code
pub const NS = AF.NS

ConstantISO[src]

Source Code

Source code
pub const ISO = AF.ISO

ConstantOSI[src]

Source Code

Source code
pub const OSI = AF.ISO

ConstantECMA[src]

Source Code

Source code
pub const ECMA = AF.ECMA

ConstantDATAKIT[src]

Source Code

Source code
pub const DATAKIT = AF.DATAKIT

ConstantCCITT[src]

Source Code

Source code
pub const CCITT = AF.CCITT

ConstantSNA[src]

Source Code

Source code
pub const SNA = AF.SNA

ConstantDECnet[src]

Source Code

Source code
pub const DECnet = AF.DECnet

ConstantDLI[src]

Source Code

Source code
pub const DLI = AF.DLI

ConstantLAT[src]

Source Code

Source code
pub const LAT = AF.LAT
Source code
pub const HYLINK = AF.HYLINK

ConstantAPPLETALK[src]

Source Code

Source code
pub const APPLETALK = AF.APPLETALK

ConstantOROUTE[src]

Source Code

Source code
pub const OROUTE = AF.OROUTE
Source code
pub const LINK = AF.LINK

ConstantCOIP[src]

Source Code

Source code
pub const COIP = AF.COIP

ConstantCNT[src]

Source Code

Source code
pub const CNT = AF.CNT

ConstantINET6[src]

Source Code

Source code
pub const INET6 = AF.INET6

ConstantIPX[src]

Source Code

Source code
pub const IPX = AF.IPX

ConstantISDN[src]

Source Code

Source code
pub const ISDN = AF.ISDN

ConstantE164[src]

Source Code

Source code
pub const E164 = AF.E164

ConstantNATM[src]

Source Code

Source code
pub const NATM = AF.NATM

ConstantARP[src]

Source Code

Source code
pub const ARP = AF.ARP

ConstantBLUETOOTH[src]

Source Code

Source code
pub const BLUETOOTH = AF.BLUETOOTH

ConstantMPLS[src]

Source Code

Source code
pub const MPLS = AF.MPLS

ConstantROUTE[src]

Source Code

Source code
pub const ROUTE = AF.ROUTE

ConstantCAN[src]

Source Code

Source code
pub const CAN = AF.CAN

ConstantETHER[src]

Source Code

Source code
pub const ETHER = AF.ETHER

ConstantMAX[src]

Source Code

Source code
pub const MAX = AF.MAX

ConstantINET6[src]

Source Code

Source code
pub const INET6 = AF.INET6
Source code
pub const IMPLINK = AF.IMPLINK

ConstantROUTE[src]

Source Code

Source code
pub const ROUTE = AF.ROUTE

ConstantISO[src]

Source Code

Source code
pub const ISO = AF.ISO

ConstantPIP[src]

Source Code

Source code
pub const PIP = AF.pseudo_PIP

ConstantCHAOS[src]

Source Code

Source code
pub const CHAOS = AF.CHAOS

ConstantDATAKIT[src]

Source Code

Source code
pub const DATAKIT = AF.DATAKIT

ConstantINET[src]

Source Code

Source code
pub const INET = AF.INET

ConstantAPPLETALK[src]

Source Code

Source code
pub const APPLETALK = AF.APPLETALK

ConstantSIP[src]

Source Code

Source code
pub const SIP = AF.SIP

ConstantOSI[src]

Source Code

Source code
pub const OSI = AF.ISO

ConstantCNT[src]

Source Code

Source code
pub const CNT = AF.CNT
Source code
pub const LINK = AF.LINK
Source code
pub const HYLINK = AF.HYLINK

ConstantMAX[src]

Source Code

Source code
pub const MAX = AF.MAX

ConstantKEY[src]

Source Code

Source code
pub const KEY = AF.pseudo_KEY

ConstantPUP[src]

Source Code

Source code
pub const PUP = AF.PUP

ConstantCOIP[src]

Source Code

Source code
pub const COIP = AF.COIP

ConstantSNA[src]

Source Code

Source code
pub const SNA = AF.SNA

ConstantLOCAL[src]

Source Code

Source code
pub const LOCAL = AF.LOCAL

ConstantNETBIOS[src]

Source Code

Source code
pub const NETBIOS = AF.NETBIOS

ConstantNATM[src]

Source Code

Source code
pub const NATM = AF.NATM

ConstantBLUETOOTH[src]

Source Code

Source code
pub const BLUETOOTH = AF.BLUETOOTH

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = AF.UNSPEC

ConstantNETGRAPH[src]

Source Code

Source code
pub const NETGRAPH = AF.NETGRAPH

ConstantECMA[src]

Source Code

Source code
pub const ECMA = AF.ECMA

ConstantIPX[src]

Source Code

Source code
pub const IPX = AF.IPX

ConstantDLI[src]

Source Code

Source code
pub const DLI = AF.DLI

ConstantATM[src]

Source Code

Source code
pub const ATM = AF.ATM

ConstantCCITT[src]

Source Code

Source code
pub const CCITT = AF.CCITT

ConstantISDN[src]

Source Code

Source code
pub const ISDN = AF.ISDN

ConstantRTIP[src]

Source Code

Source code
pub const RTIP = AF.pseudo_RTIP

ConstantLAT[src]

Source Code

Source code
pub const LAT = AF.LAT

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = PF.LOCAL

ConstantXTP[src]

Source Code

Source code
pub const XTP = AF.pseudo_XTP

ConstantDECnet[src]

Source Code

Source code
pub const DECnet = AF.DECnet

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = AF.UNSPEC

ConstantINET[src]

Source Code

Source code
pub const INET = AF.INET

ConstantROUTE[src]

Source Code

Source code
pub const ROUTE = AF.ROUTE
Source code
pub const LINK = AF.LINK

ConstantINET6[src]

Source Code

Source code
pub const INET6 = AF.INET6

ConstantLOCAL[src]

Source Code

Source code
pub const LOCAL = AF.LOCAL

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = AF.UNIX

ConstantBLUETOOTH[src]

Source Code

Source code
pub const BLUETOOTH = AF.BLUETOOTH

ConstantUNSPEC[src]

Source Code

Source code
pub const UNSPEC = AF.UNSPEC

ConstantLOCAL[src]

Source Code

Source code
pub const LOCAL = AF.LOCAL

ConstantUNIX[src]

Source Code

Source code
pub const UNIX = AF.UNIX

ConstantINET[src]

Source Code

Source code
pub const INET = AF.INET

ConstantAPPLETALK[src]

Source Code

Source code
pub const APPLETALK = AF.APPLETALK

ConstantINET6[src]

Source Code

Source code
pub const INET6 = AF.INET6

ConstantDECnet[src]

Source Code

Source code
pub const DECnet = AF.DECnet

ConstantKEY[src]

Source Code

Source code
pub const KEY = AF.KEY

ConstantROUTE[src]

Source Code

Source code
pub const ROUTE = AF.ROUTE

ConstantSNA[src]

Source Code

Source code
pub const SNA = AF.SNA

ConstantMPLS[src]

Source Code

Source code
pub const MPLS = AF.MPLS

ConstantBLUETOOTH[src]

Source Code

Source code
pub const BLUETOOTH = AF.BLUETOOTH

ConstantISDN[src]

Source Code

Source code
pub const ISDN = AF.ISDN

ConstantMAX[src]

Source Code

Source code
pub const MAX = AF.MAX

Source Code

Source code
pub const PF = if (builtin.abi.isAndroid()) struct {
    pub const UNSPEC = AF.UNSPEC;
    pub const UNIX = AF.UNIX;
    pub const LOCAL = AF.LOCAL;
    pub const INET = AF.INET;
    pub const AX25 = AF.AX25;
    pub const IPX = AF.IPX;
    pub const APPLETALK = AF.APPLETALK;
    pub const NETROM = AF.NETROM;
    pub const BRIDGE = AF.BRIDGE;
    pub const ATMPVC = AF.ATMPVC;
    pub const X25 = AF.X25;
    pub const PF_INET6 = AF.INET6;
    pub const PF_ROSE = AF.ROSE;
    pub const PF_DECnet = AF.DECnet;
    pub const PF_NETBEUI = AF.NETBEUI;
    pub const PF_SECURITY = AF.SECURITY;
    pub const PF_KEY = AF.KEY;
    pub const PF_NETLINK = AF.NETLINK;
    pub const PF_ROUTE = AF.ROUTE;
    pub const PF_PACKET = AF.PACKET;
    pub const PF_ASH = AF.ASH;
    pub const PF_ECONET = AF.ECONET;
    pub const PF_ATMSVC = AF.ATMSVC;
    pub const PF_RDS = AF.RDS;
    pub const PF_SNA = AF.SNA;
    pub const PF_IRDA = AF.IRDA;
    pub const PF_PPPOX = AF.PPPOX;
    pub const PF_WANPIPE = AF.WANPIPE;
    pub const PF_LLC = AF.LLC;
    pub const PF_CAN = AF.CAN;
    pub const PF_TIPC = AF.TIPC;
    pub const PF_BLUETOOTH = AF.BLUETOOTH;
    pub const PF_IUCV = AF.IUCV;
    pub const PF_RXRPC = AF.RXRPC;
    pub const PF_ISDN = AF.ISDN;
    pub const PF_PHONET = AF.PHONET;
    pub const PF_IEEE802154 = AF.IEEE802154;
    pub const PF_CAIF = AF.CAIF;
    pub const PF_ALG = AF.ALG;
    pub const PF_NFC = AF.NFC;
    pub const PF_VSOCK = AF.VSOCK;
    pub const PF_KCM = AF.KCM;
    pub const PF_QIPCRTR = AF.QIPCRTR;
    pub const PF_MAX = AF.MAX;
} else switch (native_os) {
    .linux, .emscripten => linux.PF,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const LOCAL = AF.LOCAL;
        pub const UNIX = PF.LOCAL;
        pub const INET = AF.INET;
        pub const IMPLINK = AF.IMPLINK;
        pub const PUP = AF.PUP;
        pub const CHAOS = AF.CHAOS;
        pub const NS = AF.NS;
        pub const ISO = AF.ISO;
        pub const OSI = AF.ISO;
        pub const ECMA = AF.ECMA;
        pub const DATAKIT = AF.DATAKIT;
        pub const CCITT = AF.CCITT;
        pub const SNA = AF.SNA;
        pub const DECnet = AF.DECnet;
        pub const DLI = AF.DLI;
        pub const LAT = AF.LAT;
        pub const HYLINK = AF.HYLINK;
        pub const APPLETALK = AF.APPLETALK;
        pub const ROUTE = AF.ROUTE;
        pub const LINK = AF.LINK;
        pub const XTP = AF.XTP;
        pub const COIP = AF.COIP;
        pub const CNT = AF.CNT;
        pub const SIP = AF.SIP;
        pub const IPX = AF.IPX;
        pub const RTIP = AF.RTIP;
        pub const PIP = AF.PIP;
        pub const ISDN = AF.ISDN;
        pub const KEY = AF.KEY;
        pub const INET6 = AF.INET6;
        pub const NATM = AF.NATM;
        pub const SYSTEM = AF.SYSTEM;
        pub const NETBIOS = AF.NETBIOS;
        pub const PPP = AF.PPP;
        pub const MAX = AF.MAX;
    },
    .freebsd => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const LOCAL = AF.LOCAL;
        pub const UNIX = PF.LOCAL;
        pub const INET = AF.INET;
        pub const IMPLINK = AF.IMPLINK;
        pub const PUP = AF.PUP;
        pub const CHAOS = AF.CHAOS;
        pub const NETBIOS = AF.NETBIOS;
        pub const ISO = AF.ISO;
        pub const OSI = AF.ISO;
        pub const ECMA = AF.ECMA;
        pub const DATAKIT = AF.DATAKIT;
        pub const CCITT = AF.CCITT;
        pub const DECnet = AF.DECnet;
        pub const DLI = AF.DLI;
        pub const LAT = AF.LAT;
        pub const HYLINK = AF.HYLINK;
        pub const APPLETALK = AF.APPLETALK;
        pub const ROUTE = AF.ROUTE;
        pub const LINK = AF.LINK;
        pub const XTP = AF.pseudo_XTP;
        pub const COIP = AF.COIP;
        pub const CNT = AF.CNT;
        pub const SIP = AF.SIP;
        pub const IPX = AF.IPX;
        pub const RTIP = AF.pseudo_RTIP;
        pub const PIP = AF.pseudo_PIP;
        pub const ISDN = AF.ISDN;
        pub const KEY = AF.pseudo_KEY;
        pub const INET6 = AF.pseudo_INET6;
        pub const NATM = AF.NATM;
        pub const ATM = AF.ATM;
        pub const NETGRAPH = AF.NETGRAPH;
        pub const SLOW = AF.SLOW;
        pub const SCLUSTER = AF.SCLUSTER;
        pub const ARP = AF.ARP;
        pub const BLUETOOTH = AF.BLUETOOTH;
        pub const IEEE80211 = AF.IEEE80211;
        pub const INET_SDP = AF.INET_SDP;
        pub const INET6_SDP = AF.INET6_SDP;
        pub const MAX = AF.MAX;
    },
    .solaris, .illumos => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const UNIX = AF.UNIX;
        pub const LOCAL = UNIX;
        pub const FILE = UNIX;
        pub const INET = AF.INET;
        pub const IMPLINK = AF.IMPLINK;
        pub const PUP = AF.PUP;
        pub const CHAOS = AF.CHAOS;
        pub const NS = AF.NS;
        pub const NBS = AF.NBS;
        pub const ECMA = AF.ECMA;
        pub const DATAKIT = AF.DATAKIT;
        pub const CCITT = AF.CCITT;
        pub const SNA = AF.SNA;
        pub const DECnet = AF.DECnet;
        pub const DLI = AF.DLI;
        pub const LAT = AF.LAT;
        pub const HYLINK = AF.HYLINK;
        pub const APPLETALK = AF.APPLETALK;
        pub const NIT = AF.NIT;
        pub const @"802" = AF.@"802";
        pub const OSI = AF.OSI;
        pub const X25 = AF.X25;
        pub const OSINET = AF.OSINET;
        pub const GOSIP = AF.GOSIP;
        pub const IPX = AF.IPX;
        pub const ROUTE = AF.ROUTE;
        pub const LINK = AF.LINK;
        pub const INET6 = AF.INET6;
        pub const KEY = AF.KEY;
        pub const NCA = AF.NCA;
        pub const POLICY = AF.POLICY;
        pub const TRILL = AF.TRILL;
        pub const PACKET = AF.PACKET;
        pub const LX_NETLINK = AF.LX_NETLINK;
        pub const MAX = AF.MAX;
    },
    .netbsd => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const LOCAL = AF.LOCAL;
        pub const UNIX = PF.LOCAL;
        pub const INET = AF.INET;
        pub const IMPLINK = AF.IMPLINK;
        pub const PUP = AF.PUP;
        pub const CHAOS = AF.CHAOS;
        pub const NS = AF.NS;
        pub const ISO = AF.ISO;
        pub const OSI = AF.ISO;
        pub const ECMA = AF.ECMA;
        pub const DATAKIT = AF.DATAKIT;
        pub const CCITT = AF.CCITT;
        pub const SNA = AF.SNA;
        pub const DECnet = AF.DECnet;
        pub const DLI = AF.DLI;
        pub const LAT = AF.LAT;
        pub const HYLINK = AF.HYLINK;
        pub const APPLETALK = AF.APPLETALK;
        pub const OROUTE = AF.OROUTE;
        pub const LINK = AF.LINK;
        pub const COIP = AF.COIP;
        pub const CNT = AF.CNT;
        pub const INET6 = AF.INET6;
        pub const IPX = AF.IPX;
        pub const ISDN = AF.ISDN;
        pub const E164 = AF.E164;
        pub const NATM = AF.NATM;
        pub const ARP = AF.ARP;
        pub const BLUETOOTH = AF.BLUETOOTH;
        pub const MPLS = AF.MPLS;
        pub const ROUTE = AF.ROUTE;
        pub const CAN = AF.CAN;
        pub const ETHER = AF.ETHER;
        pub const MAX = AF.MAX;
    },
    .dragonfly => struct {
        pub const INET6 = AF.INET6;
        pub const IMPLINK = AF.IMPLINK;
        pub const ROUTE = AF.ROUTE;
        pub const ISO = AF.ISO;
        pub const PIP = AF.pseudo_PIP;
        pub const CHAOS = AF.CHAOS;
        pub const DATAKIT = AF.DATAKIT;
        pub const INET = AF.INET;
        pub const APPLETALK = AF.APPLETALK;
        pub const SIP = AF.SIP;
        pub const OSI = AF.ISO;
        pub const CNT = AF.CNT;
        pub const LINK = AF.LINK;
        pub const HYLINK = AF.HYLINK;
        pub const MAX = AF.MAX;
        pub const KEY = AF.pseudo_KEY;
        pub const PUP = AF.PUP;
        pub const COIP = AF.COIP;
        pub const SNA = AF.SNA;
        pub const LOCAL = AF.LOCAL;
        pub const NETBIOS = AF.NETBIOS;
        pub const NATM = AF.NATM;
        pub const BLUETOOTH = AF.BLUETOOTH;
        pub const UNSPEC = AF.UNSPEC;
        pub const NETGRAPH = AF.NETGRAPH;
        pub const ECMA = AF.ECMA;
        pub const IPX = AF.IPX;
        pub const DLI = AF.DLI;
        pub const ATM = AF.ATM;
        pub const CCITT = AF.CCITT;
        pub const ISDN = AF.ISDN;
        pub const RTIP = AF.pseudo_RTIP;
        pub const LAT = AF.LAT;
        pub const UNIX = PF.LOCAL;
        pub const XTP = AF.pseudo_XTP;
        pub const DECnet = AF.DECnet;
    },
    .haiku => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const INET = AF.INET;
        pub const ROUTE = AF.ROUTE;
        pub const LINK = AF.LINK;
        pub const INET6 = AF.INET6;
        pub const LOCAL = AF.LOCAL;
        pub const UNIX = AF.UNIX;
        pub const BLUETOOTH = AF.BLUETOOTH;
    },
    .openbsd => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const LOCAL = AF.LOCAL;
        pub const UNIX = AF.UNIX;
        pub const INET = AF.INET;
        pub const APPLETALK = AF.APPLETALK;
        pub const INET6 = AF.INET6;
        pub const DECnet = AF.DECnet;
        pub const KEY = AF.KEY;
        pub const ROUTE = AF.ROUTE;
        pub const SNA = AF.SNA;
        pub const MPLS = AF.MPLS;
        pub const BLUETOOTH = AF.BLUETOOTH;
        pub const ISDN = AF.ISDN;
        pub const MAX = AF.MAX;
    },
    else => void,
}

TypeDT[src]

Values

ConstantUNKNOWN[src]

Source Code

Source code
pub const UNKNOWN = 0

ConstantFIFO[src]

Source Code

Source code
pub const FIFO = 1

ConstantCHR[src]

Source Code

Source code
pub const CHR = 2

ConstantDIR[src]

Source Code

Source code
pub const DIR = 4

ConstantBLK[src]

Source Code

Source code
pub const BLK = 6

ConstantREG[src]

Source Code

Source code
pub const REG = 8

ConstantLNK[src]

Source Code

Source code
pub const LNK = 10

ConstantSOCK[src]

Source Code

Source code
pub const SOCK = 12

ConstantWHT[src]

Source Code

Source code
pub const WHT = 14

ConstantUNKNOWN[src]

Source Code

Source code
pub const UNKNOWN = 0

ConstantFIFO[src]

Source Code

Source code
pub const FIFO = 1

ConstantCHR[src]

Source Code

Source code
pub const CHR = 2

ConstantDIR[src]

Source Code

Source code
pub const DIR = 4

ConstantBLK[src]

Source Code

Source code
pub const BLK = 6

ConstantREG[src]

Source Code

Source code
pub const REG = 8

ConstantLNK[src]

Source Code

Source code
pub const LNK = 10

ConstantSOCK[src]

Source Code

Source code
pub const SOCK = 12

ConstantWHT[src]

Source Code

Source code
pub const WHT = 14

ConstantDBF[src]

Source Code

Source code
pub const DBF = 15

ConstantUNKNOWN[src]

Source Code

Source code
pub const UNKNOWN = 0

ConstantFIFO[src]

Source Code

Source code
pub const FIFO = 1

ConstantCHR[src]

Source Code

Source code
pub const CHR = 2

ConstantDIR[src]

Source Code

Source code
pub const DIR = 4

ConstantBLK[src]

Source Code

Source code
pub const BLK = 6

ConstantREG[src]

Source Code

Source code
pub const REG = 8

ConstantLNK[src]

Source Code

Source code
pub const LNK = 10

ConstantSOCK[src]

Source Code

Source code
pub const SOCK = 12

ConstantWHT[src]

Source Code

Source code
pub const WHT = 14

Source Code

Source code
pub const DT = switch (native_os) {
    .linux => linux.DT,
    .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const UNKNOWN = 0;
        pub const FIFO = 1;
        pub const CHR = 2;
        pub const DIR = 4;
        pub const BLK = 6;
        pub const REG = 8;
        pub const LNK = 10;
        pub const SOCK = 12;
        pub const WHT = 14;
    },
    .dragonfly => struct {
        pub const UNKNOWN = 0;
        pub const FIFO = 1;
        pub const CHR = 2;
        pub const DIR = 4;
        pub const BLK = 6;
        pub const REG = 8;
        pub const LNK = 10;
        pub const SOCK = 12;
        pub const WHT = 14;
        pub const DBF = 15;
    },
    .openbsd => struct {
        pub const UNKNOWN = 0;
        pub const FIFO = 1;
        pub const CHR = 2;
        pub const DIR = 4;
        pub const BLK = 6;
        pub const REG = 8;
        pub const LNK = 10;
        pub const SOCK = 12;
        pub const WHT = 14; // XXX
    },
    else => void,
}

TypeMSG[src]

Values

ConstantOOB[src]

Source Code

Source code
pub const OOB = 0x0001

ConstantPEEK[src]

Source Code

Source code
pub const PEEK = 0x0002

ConstantDONTROUTE[src]

Source Code

Source code
pub const DONTROUTE = 0x0004

ConstantEOR[src]

Source Code

Source code
pub const EOR = 0x0008

ConstantTRUNC[src]

Source Code

Source code
pub const TRUNC = 0x0010

ConstantCTRUNC[src]

Source Code

Source code
pub const CTRUNC = 0x0020

ConstantWAITALL[src]

Source Code

Source code
pub const WAITALL = 0x0040

ConstantDONTWAIT[src]

Source Code

Source code
pub const DONTWAIT = 0x0080

ConstantBCAST[src]

Source Code

Source code
pub const BCAST = 0x0100

ConstantMCAST[src]

Source Code

Source code
pub const MCAST = 0x0200

ConstantEOF[src]

Source Code

Source code
pub const EOF = 0x0400

ConstantNOSIGNAL[src]

Source Code

Source code
pub const NOSIGNAL = 0x0800

Source Code

Source code
pub const MSG = switch (native_os) {
    .linux => linux.MSG,
    .emscripten => emscripten.MSG,
    .windows => ws2_32.MSG,
    .haiku => struct {
        pub const OOB = 0x0001;
        pub const PEEK = 0x0002;
        pub const DONTROUTE = 0x0004;
        pub const EOR = 0x0008;
        pub const TRUNC = 0x0010;
        pub const CTRUNC = 0x0020;
        pub const WAITALL = 0x0040;
        pub const DONTWAIT = 0x0080;
        pub const BCAST = 0x0100;
        pub const MCAST = 0x0200;
        pub const EOF = 0x0400;
        pub const NOSIGNAL = 0x0800;
    },
    else => void,
}

TypeSOCK[src]

Values

ConstantSTREAM[src]

Source Code

Source code
pub const STREAM = 1

ConstantDGRAM[src]

Source Code

Source code
pub const DGRAM = 2

ConstantRAW[src]

Source Code

Source code
pub const RAW = 3

ConstantRDM[src]

Source Code

Source code
pub const RDM = 4

ConstantSEQPACKET[src]

Source Code

Source code
pub const SEQPACKET = 5

ConstantMAXADDRLEN[src]

Source Code

Source code
pub const MAXADDRLEN = 255

ConstantCLOEXEC[src]

Not actually supported by Darwin, but Zig supplies a shim. This numerical value is not ABI-stable. It need only not conflict with any other SOCK bits.

Source Code

Source code
pub const CLOEXEC = 1 << 15

ConstantNONBLOCK[src]

Not actually supported by Darwin, but Zig supplies a shim. This numerical value is not ABI-stable. It need only not conflict with any other SOCK bits.

Source Code

Source code
pub const NONBLOCK = 1 << 16

ConstantSTREAM[src]

Source Code

Source code
pub const STREAM = 1

ConstantDGRAM[src]

Source Code

Source code
pub const DGRAM = 2

ConstantRAW[src]

Source Code

Source code
pub const RAW = 3

ConstantRDM[src]

Source Code

Source code
pub const RDM = 4

ConstantSEQPACKET[src]

Source Code

Source code
pub const SEQPACKET = 5

ConstantCLOEXEC[src]

Source Code

Source code
pub const CLOEXEC = 0x10000000

ConstantNONBLOCK[src]

Source Code

Source code
pub const NONBLOCK = 0x20000000

ConstantDGRAM[src]

Datagram.

Source Code

Source code
pub const DGRAM = 1

ConstantSTREAM[src]

STREAM.

Source Code

Source code
pub const STREAM = 2

ConstantRAW[src]

Raw-protocol interface.

Source Code

Source code
pub const RAW = 4

ConstantRDM[src]

Reliably-delivered message.

Source Code

Source code
pub const RDM = 5

ConstantSEQPACKET[src]

Sequenced packed stream.

Source Code

Source code
pub const SEQPACKET = 6

ConstantNONBLOCK[src]

Source Code

Source code
pub const NONBLOCK = 0x100000

ConstantNDELAY[src]

Source Code

Source code
pub const NDELAY = 0x200000

ConstantCLOEXEC[src]

Source Code

Source code
pub const CLOEXEC = 0x080000

ConstantSTREAM[src]

Source Code

Source code
pub const STREAM = 1

ConstantDGRAM[src]

Source Code

Source code
pub const DGRAM = 2

ConstantRAW[src]

Source Code

Source code
pub const RAW = 3

ConstantRDM[src]

Source Code

Source code
pub const RDM = 4

ConstantSEQPACKET[src]

Source Code

Source code
pub const SEQPACKET = 5

ConstantCONN_DGRAM[src]

Source Code

Source code
pub const CONN_DGRAM = 6

ConstantCONN_DGRAM[src]

Source Code

Source code
pub const CONN_DGRAM = 6

ConstantCLOEXEC[src]

Source Code

Source code
pub const CLOEXEC = 0x10000000

ConstantNONBLOCK[src]

Source Code

Source code
pub const NONBLOCK = 0x20000000

ConstantNOSIGPIPE[src]

Source Code

Source code
pub const NOSIGPIPE = 0x40000000

ConstantFLAGS_MASK[src]

Source Code

Source code
pub const FLAGS_MASK = 0xf0000000

ConstantSTREAM[src]

Source Code

Source code
pub const STREAM = 1

ConstantDGRAM[src]

Source Code

Source code
pub const DGRAM = 2

ConstantRAW[src]

Source Code

Source code
pub const RAW = 3

ConstantRDM[src]

Source Code

Source code
pub const RDM = 4

ConstantSEQPACKET[src]

Source Code

Source code
pub const SEQPACKET = 5

ConstantMAXADDRLEN[src]

Source Code

Source code
pub const MAXADDRLEN = 255

ConstantCLOEXEC[src]

Source Code

Source code
pub const CLOEXEC = 0x10000000

ConstantNONBLOCK[src]

Source Code

Source code
pub const NONBLOCK = 0x20000000

ConstantSTREAM[src]

Source Code

Source code
pub const STREAM = 1

ConstantDGRAM[src]

Source Code

Source code
pub const DGRAM = 2

ConstantRAW[src]

Source Code

Source code
pub const RAW = 3

ConstantSEQPACKET[src]

Source Code

Source code
pub const SEQPACKET = 5

ConstantMISC[src]

Source Code

Source code
pub const MISC = 255

ConstantSTREAM[src]

Source Code

Source code
pub const STREAM = 1

ConstantDGRAM[src]

Source Code

Source code
pub const DGRAM = 2

ConstantRAW[src]

Source Code

Source code
pub const RAW = 3

ConstantRDM[src]

Source Code

Source code
pub const RDM = 4

ConstantSEQPACKET[src]

Source Code

Source code
pub const SEQPACKET = 5

ConstantCLOEXEC[src]

Source Code

Source code
pub const CLOEXEC = 0x8000

ConstantNONBLOCK[src]

Source Code

Source code
pub const NONBLOCK = 0x4000

Source Code

Source code
pub const SOCK = switch (native_os) {
    .linux => linux.SOCK,
    .emscripten => emscripten.SOCK,
    .windows => ws2_32.SOCK,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const RDM = 4;
        pub const SEQPACKET = 5;
        pub const MAXADDRLEN = 255;

        /// Not actually supported by Darwin, but Zig supplies a shim.
        /// This numerical value is not ABI-stable. It need only not conflict
        /// with any other `SOCK` bits.
        pub const CLOEXEC = 1 << 15;
        /// Not actually supported by Darwin, but Zig supplies a shim.
        /// This numerical value is not ABI-stable. It need only not conflict
        /// with any other `SOCK` bits.
        pub const NONBLOCK = 1 << 16;
    },
    .freebsd => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const RDM = 4;
        pub const SEQPACKET = 5;

        pub const CLOEXEC = 0x10000000;
        pub const NONBLOCK = 0x20000000;
    },
    .solaris, .illumos => struct {
        /// Datagram.
        pub const DGRAM = 1;
        /// STREAM.
        pub const STREAM = 2;
        /// Raw-protocol interface.
        pub const RAW = 4;
        /// Reliably-delivered message.
        pub const RDM = 5;
        /// Sequenced packed stream.
        pub const SEQPACKET = 6;

        pub const NONBLOCK = 0x100000;
        pub const NDELAY = 0x200000;
        pub const CLOEXEC = 0x080000;
    },
    .netbsd => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const RDM = 4;
        pub const SEQPACKET = 5;
        pub const CONN_DGRAM = 6;
        pub const DCCP = CONN_DGRAM;

        pub const CLOEXEC = 0x10000000;
        pub const NONBLOCK = 0x20000000;
        pub const NOSIGPIPE = 0x40000000;
        pub const FLAGS_MASK = 0xf0000000;
    },
    .dragonfly => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const RDM = 4;
        pub const SEQPACKET = 5;
        pub const MAXADDRLEN = 255;
        pub const CLOEXEC = 0x10000000;
        pub const NONBLOCK = 0x20000000;
    },
    .haiku => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const SEQPACKET = 5;
        pub const MISC = 255;
    },
    .openbsd => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const RDM = 4;
        pub const SEQPACKET = 5;

        pub const CLOEXEC = 0x8000;
        pub const NONBLOCK = 0x4000;
    },
    else => void,
}

TypeTCP[src]

Source Code

Source code
pub const TCP = switch (native_os) {
    .macos => darwin.TCP,
    .linux => linux.TCP,
    .emscripten => emscripten.TCP,
    .windows => ws2_32.TCP,
    else => void,
}

TypeIPPROTO[src]

Values

ConstantICMP[src]

Source Code

Source code
pub const ICMP = 1

ConstantICMPV6[src]

Source Code

Source code
pub const ICMPV6 = 58

ConstantTCP[src]

Source Code

Source code
pub const TCP = 6

ConstantUDP[src]

Source Code

Source code
pub const UDP = 17

ConstantIP[src]

Source Code

Source code
pub const IP = 0

ConstantIPV6[src]

Source Code

Source code
pub const IPV6 = 41

ConstantIP[src]

dummy for IP

Source Code

Source code
pub const IP = 0

ConstantICMP[src]

control message protocol

Source Code

Source code
pub const ICMP = 1

ConstantTCP[src]

tcp

Source Code

Source code
pub const TCP = 6

ConstantUDP[src]

user datagram protocol

Source Code

Source code
pub const UDP = 17

ConstantIPV6[src]

IP6 header

Source Code

Source code
pub const IPV6 = 41

ConstantRAW[src]

raw IP packet

Source Code

Source code
pub const RAW = 255

ConstantHOPOPTS[src]

IP6 hop-by-hop options

Source Code

Source code
pub const HOPOPTS = 0

ConstantIGMP[src]

group mgmt protocol

Source Code

Source code
pub const IGMP = 2

ConstantGGP[src]

gateway^2 (deprecated)

Source Code

Source code
pub const GGP = 3

ConstantIPV4[src]

IPv4 encapsulation

Source Code

Source code
pub const IPV4 = 4

ConstantIPV4[src]

IPv4 encapsulation

Source Code

Source code
pub const IPV4 = 4

ConstantST[src]

Stream protocol II

Source Code

Source code
pub const ST = 7

ConstantEGP[src]

exterior gateway protocol

Source Code

Source code
pub const EGP = 8

ConstantPIGP[src]

private interior gateway

Source Code

Source code
pub const PIGP = 9

ConstantRCCMON[src]

BBN RCC Monitoring

Source Code

Source code
pub const RCCMON = 10

ConstantNVPII[src]

network voice protocol

Source Code

Source code
pub const NVPII = 11

ConstantPUP[src]

pup

Source Code

Source code
pub const PUP = 12

ConstantARGUS[src]

Argus

Source Code

Source code
pub const ARGUS = 13

ConstantEMCON[src]

EMCON

Source Code

Source code
pub const EMCON = 14

ConstantXNET[src]

Cross Net Debugger

Source Code

Source code
pub const XNET = 15

ConstantCHAOS[src]

Chaos

Source Code

Source code
pub const CHAOS = 16

ConstantMUX[src]

Multiplexing

Source Code

Source code
pub const MUX = 18

ConstantMEAS[src]

DCN Measurement Subsystems

Source Code

Source code
pub const MEAS = 19

ConstantHMP[src]

Host Monitoring

Source Code

Source code
pub const HMP = 20

ConstantPRM[src]

Packet Radio Measurement

Source Code

Source code
pub const PRM = 21

ConstantIDP[src]

xns idp

Source Code

Source code
pub const IDP = 22

ConstantTRUNK1[src]

Trunk-1

Source Code

Source code
pub const TRUNK1 = 23

ConstantTRUNK2[src]

Trunk-2

Source Code

Source code
pub const TRUNK2 = 24

ConstantLEAF1[src]

Leaf-1

Source Code

Source code
pub const LEAF1 = 25

ConstantLEAF2[src]

Leaf-2

Source Code

Source code
pub const LEAF2 = 26

ConstantRDP[src]

Reliable Data

Source Code

Source code
pub const RDP = 27

ConstantIRTP[src]

Reliable Transaction

Source Code

Source code
pub const IRTP = 28

ConstantTP[src]

tp-4 w/ class negotiation

Source Code

Source code
pub const TP = 29

ConstantBLT[src]

Bulk Data Transfer

Source Code

Source code
pub const BLT = 30

ConstantNSP[src]

Network Services

Source Code

Source code
pub const NSP = 31

ConstantINP[src]

Merit Internodal

Source Code

Source code
pub const INP = 32

ConstantDCCP[src]

Datagram Congestion Control Protocol

Source Code

Source code
pub const DCCP = 33

Constant@"3PC"[src]

Third Party Connect

Source Code

Source code
pub const @"3PC" = 34

ConstantIDPR[src]

InterDomain Policy Routing

Source Code

Source code
pub const IDPR = 35

ConstantXTP[src]

XTP

Source Code

Source code
pub const XTP = 36

ConstantDDP[src]

Datagram Delivery

Source Code

Source code
pub const DDP = 37

ConstantCMTP[src]

Control Message Transport

Source Code

Source code
pub const CMTP = 38

ConstantTPXX[src]

TP++ Transport

Source Code

Source code
pub const TPXX = 39

ConstantIL[src]

IL transport protocol

Source Code

Source code
pub const IL = 40

ConstantSDRP[src]

Source Demand Routing

Source Code

Source code
pub const SDRP = 42

ConstantROUTING[src]

IP6 routing header

Source Code

Source code
pub const ROUTING = 43

ConstantFRAGMENT[src]

IP6 fragmentation header

Source Code

Source code
pub const FRAGMENT = 44

ConstantIDRP[src]

InterDomain Routing

Source Code

Source code
pub const IDRP = 45

ConstantRSVP[src]

resource reservation

Source Code

Source code
pub const RSVP = 46

ConstantGRE[src]

General Routing Encap.

Source Code

Source code
pub const GRE = 47

ConstantMHRP[src]

Mobile Host Routing

Source Code

Source code
pub const MHRP = 48

ConstantBHA[src]

BHA

Source Code

Source code
pub const BHA = 49

ConstantESP[src]

IP6 Encap Sec. Payload

Source Code

Source code
pub const ESP = 50

ConstantAH[src]

IP6 Auth Header

Source Code

Source code
pub const AH = 51

ConstantINLSP[src]

Integ. Net Layer Security

Source Code

Source code
pub const INLSP = 52

ConstantSWIPE[src]

IP with encryption

Source Code

Source code
pub const SWIPE = 53

ConstantNHRP[src]

Next Hop Resolution

Source Code

Source code
pub const NHRP = 54

ConstantMOBILE[src]

IP Mobility

Source Code

Source code
pub const MOBILE = 55

ConstantTLSP[src]

Transport Layer Security

Source Code

Source code
pub const TLSP = 56

ConstantSKIP[src]

SKIP

Source Code

Source code
pub const SKIP = 57

ConstantICMPV6[src]

ICMP6

Source Code

Source code
pub const ICMPV6 = 58

ConstantNONE[src]

IP6 no next header

Source Code

Source code
pub const NONE = 59

ConstantDSTOPTS[src]

IP6 destination option

Source Code

Source code
pub const DSTOPTS = 60

ConstantAHIP[src]

any host internal protocol

Source Code

Source code
pub const AHIP = 61

ConstantCFTP[src]

CFTP

Source Code

Source code
pub const CFTP = 62

ConstantHELLO[src]

"hello" routing protocol

Source Code

Source code
pub const HELLO = 63

ConstantSATEXPAK[src]

SATNET/Backroom EXPAK

Source Code

Source code
pub const SATEXPAK = 64

ConstantKRYPTOLAN[src]

Kryptolan

Source Code

Source code
pub const KRYPTOLAN = 65

ConstantRVD[src]

Remote Virtual Disk

Source Code

Source code
pub const RVD = 66

ConstantIPPC[src]

Pluribus Packet Core

Source Code

Source code
pub const IPPC = 67

ConstantADFS[src]

Any distributed FS

Source Code

Source code
pub const ADFS = 68

ConstantSATMON[src]

Satnet Monitoring

Source Code

Source code
pub const SATMON = 69

ConstantVISA[src]

VISA Protocol

Source Code

Source code
pub const VISA = 70

ConstantIPCV[src]

Packet Core Utility

Source Code

Source code
pub const IPCV = 71

ConstantCPNX[src]

Comp. Prot. Net. Executive

Source Code

Source code
pub const CPNX = 72

ConstantCPHB[src]

Comp. Prot. HeartBeat

Source Code

Source code
pub const CPHB = 73

ConstantWSN[src]

Wang Span Network

Source Code

Source code
pub const WSN = 74

ConstantPVP[src]

Packet Video Protocol

Source Code

Source code
pub const PVP = 75

ConstantBRSATMON[src]

BackRoom SATNET Monitoring

Source Code

Source code
pub const BRSATMON = 76

ConstantND[src]

Sun net disk proto (temp.)

Source Code

Source code
pub const ND = 77

ConstantWBMON[src]

WIDEBAND Monitoring

Source Code

Source code
pub const WBMON = 78

ConstantWBEXPAK[src]

WIDEBAND EXPAK

Source Code

Source code
pub const WBEXPAK = 79

ConstantEON[src]

ISO cnlp

Source Code

Source code
pub const EON = 80

ConstantVMTP[src]

VMTP

Source Code

Source code
pub const VMTP = 81

ConstantSVMTP[src]

Secure VMTP

Source Code

Source code
pub const SVMTP = 82

ConstantVINES[src]

Banyon VINES

Source Code

Source code
pub const VINES = 83

ConstantTTP[src]

TTP

Source Code

Source code
pub const TTP = 84

ConstantIGP[src]

NSFNET-IGP

Source Code

Source code
pub const IGP = 85

ConstantDGP[src]

dissimilar gateway prot.

Source Code

Source code
pub const DGP = 86

ConstantTCF[src]

TCF

Source Code

Source code
pub const TCF = 87

ConstantIGRP[src]

Cisco/GXS IGRP

Source Code

Source code
pub const IGRP = 88

ConstantOSPFIGP[src]

OSPFIGP

Source Code

Source code
pub const OSPFIGP = 89

ConstantSRPC[src]

Strite RPC protocol

Source Code

Source code
pub const SRPC = 90

ConstantLARP[src]

Locus Address Resoloution

Source Code

Source code
pub const LARP = 91

ConstantMTP[src]

Multicast Transport

Source Code

Source code
pub const MTP = 92

ConstantAX25[src]

AX.25 Frames

Source Code

Source code
pub const AX25 = 93

ConstantIPEIP[src]

IP encapsulated in IP

Source Code

Source code
pub const IPEIP = 94

ConstantMICP[src]

Mobile Int.ing control

Source Code

Source code
pub const MICP = 95

ConstantSCCSP[src]

Semaphore Comm. security

Source Code

Source code
pub const SCCSP = 96

ConstantETHERIP[src]

Ethernet IP encapsulation

Source Code

Source code
pub const ETHERIP = 97

ConstantENCAP[src]

encapsulation header

Source Code

Source code
pub const ENCAP = 98

ConstantAPES[src]

any private encr. scheme

Source Code

Source code
pub const APES = 99

ConstantGMTP[src]

GMTP

Source Code

Source code
pub const GMTP = 100

ConstantIPCOMP[src]

payload compression (IPComp)

Source Code

Source code
pub const IPCOMP = 108

ConstantSCTP[src]

SCTP

Source Code

Source code
pub const SCTP = 132

ConstantMH[src]

IPv6 Mobility Header

Source Code

Source code
pub const MH = 135

ConstantUDPLITE[src]

UDP-Lite

Source Code

Source code
pub const UDPLITE = 136

ConstantHIP[src]

IP6 Host Identity Protocol

Source Code

Source code
pub const HIP = 139

ConstantSHIM6[src]

IP6 Shim6 Protocol

Source Code

Source code
pub const SHIM6 = 140

ConstantPIM[src]

Protocol Independent Mcast

Source Code

Source code
pub const PIM = 103

ConstantCARP[src]

CARP

Source Code

Source code
pub const CARP = 112

ConstantPGM[src]

PGM

Source Code

Source code
pub const PGM = 113

ConstantMPLS[src]

MPLS-in-IP

Source Code

Source code
pub const MPLS = 137

ConstantPFSYNC[src]

PFSYNC

Source Code

Source code
pub const PFSYNC = 240

ConstantRESERVED_253[src]

Reserved

Source Code

Source code
pub const RESERVED_253 = 253

ConstantRESERVED_254[src]

Reserved

Source Code

Source code
pub const RESERVED_254 = 254

ConstantIP[src]

dummy for IP

Source Code

Source code
pub const IP = 0

ConstantHOPOPTS[src]

Hop by hop header for IPv6

Source Code

Source code
pub const HOPOPTS = 0

ConstantICMP[src]

control message protocol

Source Code

Source code
pub const ICMP = 1

ConstantIGMP[src]

group control protocol

Source Code

Source code
pub const IGMP = 2

ConstantGGP[src]

gateway^2 (deprecated)

Source Code

Source code
pub const GGP = 3

ConstantENCAP[src]

IP in IP encapsulation

Source Code

Source code
pub const ENCAP = 4

ConstantTCP[src]

tcp

Source Code

Source code
pub const TCP = 6

ConstantEGP[src]

exterior gateway protocol

Source Code

Source code
pub const EGP = 8

ConstantPUP[src]

pup

Source Code

Source code
pub const PUP = 12

ConstantUDP[src]

user datagram protocol

Source Code

Source code
pub const UDP = 17

ConstantIDP[src]

xns idp

Source Code

Source code
pub const IDP = 22

ConstantIPV6[src]

IPv6 encapsulated in IP

Source Code

Source code
pub const IPV6 = 41

ConstantROUTING[src]

Routing header for IPv6

Source Code

Source code
pub const ROUTING = 43

ConstantFRAGMENT[src]

Fragment header for IPv6

Source Code

Source code
pub const FRAGMENT = 44

ConstantRSVP[src]

rsvp

Source Code

Source code
pub const RSVP = 46

ConstantESP[src]

IPsec Encap. Sec. Payload

Source Code

Source code
pub const ESP = 50

ConstantAH[src]

IPsec Authentication Hdr.

Source Code

Source code
pub const AH = 51

ConstantICMPV6[src]

ICMP for IPv6

Source Code

Source code
pub const ICMPV6 = 58

ConstantNONE[src]

No next header for IPv6

Source Code

Source code
pub const NONE = 59

ConstantDSTOPTS[src]

Destination options

Source Code

Source code
pub const DSTOPTS = 60

ConstantHELLO[src]

"hello" routing protocol

Source Code

Source code
pub const HELLO = 63

ConstantND[src]

UNOFFICIAL net disk proto

Source Code

Source code
pub const ND = 77

ConstantEON[src]

ISO clnp

Source Code

Source code
pub const EON = 80

ConstantOSPF[src]

OSPF

Source Code

Source code
pub const OSPF = 89

ConstantPIM[src]

PIM routing protocol

Source Code

Source code
pub const PIM = 103

ConstantSCTP[src]

Stream Control

Source Code

Source code
pub const SCTP = 132

ConstantRAW[src]

raw IP packet

Source Code

Source code
pub const RAW = 255

ConstantPROTO_SDP[src]

Sockets Direct Protocol

Source Code

Source code
pub const PROTO_SDP = 257

ConstantIP[src]

dummy for IP

Source Code

Source code
pub const IP = 0

ConstantHOPOPTS[src]

IP6 hop-by-hop options

Source Code

Source code
pub const HOPOPTS = 0

ConstantICMP[src]

control message protocol

Source Code

Source code
pub const ICMP = 1

ConstantIGMP[src]

group mgmt protocol

Source Code

Source code
pub const IGMP = 2

ConstantGGP[src]

gateway^2 (deprecated)

Source Code

Source code
pub const GGP = 3

ConstantIPV4[src]

IP header

Source Code

Source code
pub const IPV4 = 4

ConstantIPIP[src]

IP inside IP

Source Code

Source code
pub const IPIP = 4

ConstantTCP[src]

tcp

Source Code

Source code
pub const TCP = 6

ConstantEGP[src]

exterior gateway protocol

Source Code

Source code
pub const EGP = 8

ConstantPUP[src]

pup

Source Code

Source code
pub const PUP = 12

ConstantUDP[src]

user datagram protocol

Source Code

Source code
pub const UDP = 17

ConstantIDP[src]

xns idp

Source Code

Source code
pub const IDP = 22

ConstantTP[src]

tp-4 w/ class negotiation

Source Code

Source code
pub const TP = 29

ConstantDCCP[src]

DCCP

Source Code

Source code
pub const DCCP = 33

ConstantIPV6[src]

IP6 header

Source Code

Source code
pub const IPV6 = 41

ConstantROUTING[src]

IP6 routing header

Source Code

Source code
pub const ROUTING = 43

ConstantFRAGMENT[src]

IP6 fragmentation header

Source Code

Source code
pub const FRAGMENT = 44

ConstantRSVP[src]

resource reservation

Source Code

Source code
pub const RSVP = 46

ConstantGRE[src]

GRE encaps RFC 1701

Source Code

Source code
pub const GRE = 47

ConstantESP[src]

encap. security payload

Source Code

Source code
pub const ESP = 50

ConstantAH[src]

authentication header

Source Code

Source code
pub const AH = 51

ConstantMOBILE[src]

IP Mobility RFC 2004

Source Code

Source code
pub const MOBILE = 55

ConstantIPV6_ICMP[src]

IPv6 ICMP

Source Code

Source code
pub const IPV6_ICMP = 58

ConstantICMPV6[src]

ICMP6

Source Code

Source code
pub const ICMPV6 = 58

ConstantNONE[src]

IP6 no next header

Source Code

Source code
pub const NONE = 59

ConstantDSTOPTS[src]

IP6 destination option

Source Code

Source code
pub const DSTOPTS = 60

ConstantEON[src]

ISO cnlp

Source Code

Source code
pub const EON = 80

ConstantETHERIP[src]

Ethernet-in-IP

Source Code

Source code
pub const ETHERIP = 97

ConstantENCAP[src]

encapsulation header

Source Code

Source code
pub const ENCAP = 98

ConstantPIM[src]

Protocol indep. multicast

Source Code

Source code
pub const PIM = 103

ConstantIPCOMP[src]

IP Payload Comp. Protocol

Source Code

Source code
pub const IPCOMP = 108

ConstantVRRP[src]

VRRP RFC 2338

Source Code

Source code
pub const VRRP = 112

ConstantCARP[src]

Common Address Resolution Protocol

Source Code

Source code
pub const CARP = 112

ConstantL2TP[src]

L2TPv3

Source Code

Source code
pub const L2TP = 115

ConstantSCTP[src]

SCTP

Source Code

Source code
pub const SCTP = 132

ConstantPFSYNC[src]

PFSYNC

Source Code

Source code
pub const PFSYNC = 240

ConstantRAW[src]

raw IP packet

Source Code

Source code
pub const RAW = 255

ConstantIP[src]

Source Code

Source code
pub const IP = 0

ConstantICMP[src]

Source Code

Source code
pub const ICMP = 1

ConstantTCP[src]

Source Code

Source code
pub const TCP = 6

ConstantUDP[src]

Source Code

Source code
pub const UDP = 17

ConstantIPV6[src]

Source Code

Source code
pub const IPV6 = 41

ConstantRAW[src]

Source Code

Source code
pub const RAW = 255

ConstantHOPOPTS[src]

Source Code

Source code
pub const HOPOPTS = 0

ConstantIGMP[src]

Source Code

Source code
pub const IGMP = 2

ConstantGGP[src]

Source Code

Source code
pub const GGP = 3

ConstantIPV4[src]

Source Code

Source code
pub const IPV4 = 4

ConstantIPV4[src]

Source Code

Source code
pub const IPV4 = 4

ConstantST[src]

Source Code

Source code
pub const ST = 7

ConstantEGP[src]

Source Code

Source code
pub const EGP = 8

ConstantPIGP[src]

Source Code

Source code
pub const PIGP = 9

ConstantRCCMON[src]

Source Code

Source code
pub const RCCMON = 10

ConstantNVPII[src]

Source Code

Source code
pub const NVPII = 11

ConstantPUP[src]

Source Code

Source code
pub const PUP = 12

ConstantARGUS[src]

Source Code

Source code
pub const ARGUS = 13

ConstantEMCON[src]

Source Code

Source code
pub const EMCON = 14

ConstantXNET[src]

Source Code

Source code
pub const XNET = 15

ConstantCHAOS[src]

Source Code

Source code
pub const CHAOS = 16

ConstantMUX[src]

Source Code

Source code
pub const MUX = 18

ConstantMEAS[src]

Source Code

Source code
pub const MEAS = 19

ConstantHMP[src]

Source Code

Source code
pub const HMP = 20

ConstantPRM[src]

Source Code

Source code
pub const PRM = 21

ConstantIDP[src]

Source Code

Source code
pub const IDP = 22

ConstantTRUNK1[src]

Source Code

Source code
pub const TRUNK1 = 23

ConstantTRUNK2[src]

Source Code

Source code
pub const TRUNK2 = 24

ConstantLEAF1[src]

Source Code

Source code
pub const LEAF1 = 25

ConstantLEAF2[src]

Source Code

Source code
pub const LEAF2 = 26

ConstantRDP[src]

Source Code

Source code
pub const RDP = 27

ConstantIRTP[src]

Source Code

Source code
pub const IRTP = 28

ConstantTP[src]

Source Code

Source code
pub const TP = 29

ConstantBLT[src]

Source Code

Source code
pub const BLT = 30

ConstantNSP[src]

Source Code

Source code
pub const NSP = 31

ConstantINP[src]

Source Code

Source code
pub const INP = 32

ConstantSEP[src]

Source Code

Source code
pub const SEP = 33

Constant@"3PC"[src]

Source Code

Source code
pub const @"3PC" = 34

ConstantIDPR[src]

Source Code

Source code
pub const IDPR = 35

ConstantXTP[src]

Source Code

Source code
pub const XTP = 36

ConstantDDP[src]

Source Code

Source code
pub const DDP = 37

ConstantCMTP[src]

Source Code

Source code
pub const CMTP = 38

ConstantTPXX[src]

Source Code

Source code
pub const TPXX = 39

ConstantIL[src]

Source Code

Source code
pub const IL = 40

ConstantSDRP[src]

Source Code

Source code
pub const SDRP = 42

ConstantROUTING[src]

Source Code

Source code
pub const ROUTING = 43

ConstantFRAGMENT[src]

Source Code

Source code
pub const FRAGMENT = 44

ConstantIDRP[src]

Source Code

Source code
pub const IDRP = 45

ConstantRSVP[src]

Source Code

Source code
pub const RSVP = 46

ConstantGRE[src]

Source Code

Source code
pub const GRE = 47

ConstantMHRP[src]

Source Code

Source code
pub const MHRP = 48

ConstantBHA[src]

Source Code

Source code
pub const BHA = 49

ConstantESP[src]

Source Code

Source code
pub const ESP = 50

ConstantAH[src]

Source Code

Source code
pub const AH = 51

ConstantINLSP[src]

Source Code

Source code
pub const INLSP = 52

ConstantSWIPE[src]

Source Code

Source code
pub const SWIPE = 53

ConstantNHRP[src]

Source Code

Source code
pub const NHRP = 54

ConstantMOBILE[src]

Source Code

Source code
pub const MOBILE = 55

ConstantTLSP[src]

Source Code

Source code
pub const TLSP = 56

ConstantSKIP[src]

Source Code

Source code
pub const SKIP = 57

ConstantICMPV6[src]

Source Code

Source code
pub const ICMPV6 = 58

ConstantNONE[src]

Source Code

Source code
pub const NONE = 59

ConstantDSTOPTS[src]

Source Code

Source code
pub const DSTOPTS = 60

ConstantAHIP[src]

Source Code

Source code
pub const AHIP = 61

ConstantCFTP[src]

Source Code

Source code
pub const CFTP = 62

ConstantHELLO[src]

Source Code

Source code
pub const HELLO = 63

ConstantSATEXPAK[src]

Source Code

Source code
pub const SATEXPAK = 64

ConstantKRYPTOLAN[src]

Source Code

Source code
pub const KRYPTOLAN = 65

ConstantRVD[src]

Source Code

Source code
pub const RVD = 66

ConstantIPPC[src]

Source Code

Source code
pub const IPPC = 67

ConstantADFS[src]

Source Code

Source code
pub const ADFS = 68

ConstantSATMON[src]

Source Code

Source code
pub const SATMON = 69

ConstantVISA[src]

Source Code

Source code
pub const VISA = 70

ConstantIPCV[src]

Source Code

Source code
pub const IPCV = 71

ConstantCPNX[src]

Source Code

Source code
pub const CPNX = 72

ConstantCPHB[src]

Source Code

Source code
pub const CPHB = 73

ConstantWSN[src]

Source Code

Source code
pub const WSN = 74

ConstantPVP[src]

Source Code

Source code
pub const PVP = 75

ConstantBRSATMON[src]

Source Code

Source code
pub const BRSATMON = 76

ConstantND[src]

Source Code

Source code
pub const ND = 77

ConstantWBMON[src]

Source Code

Source code
pub const WBMON = 78

ConstantWBEXPAK[src]

Source Code

Source code
pub const WBEXPAK = 79

ConstantEON[src]

Source Code

Source code
pub const EON = 80

ConstantVMTP[src]

Source Code

Source code
pub const VMTP = 81

ConstantSVMTP[src]

Source Code

Source code
pub const SVMTP = 82

ConstantVINES[src]

Source Code

Source code
pub const VINES = 83

ConstantTTP[src]

Source Code

Source code
pub const TTP = 84

ConstantIGP[src]

Source Code

Source code
pub const IGP = 85

ConstantDGP[src]

Source Code

Source code
pub const DGP = 86

ConstantTCF[src]

Source Code

Source code
pub const TCF = 87

ConstantIGRP[src]

Source Code

Source code
pub const IGRP = 88

ConstantOSPFIGP[src]

Source Code

Source code
pub const OSPFIGP = 89

ConstantSRPC[src]

Source Code

Source code
pub const SRPC = 90

ConstantLARP[src]

Source Code

Source code
pub const LARP = 91

ConstantMTP[src]

Source Code

Source code
pub const MTP = 92

ConstantAX25[src]

Source Code

Source code
pub const AX25 = 93

ConstantIPEIP[src]

Source Code

Source code
pub const IPEIP = 94

ConstantMICP[src]

Source Code

Source code
pub const MICP = 95

ConstantSCCSP[src]

Source Code

Source code
pub const SCCSP = 96

ConstantETHERIP[src]

Source Code

Source code
pub const ETHERIP = 97

ConstantENCAP[src]

Source Code

Source code
pub const ENCAP = 98

ConstantAPES[src]

Source Code

Source code
pub const APES = 99

ConstantGMTP[src]

Source Code

Source code
pub const GMTP = 100

ConstantIPCOMP[src]

Source Code

Source code
pub const IPCOMP = 108

ConstantPIM[src]

Source Code

Source code
pub const PIM = 103

ConstantCARP[src]

Source Code

Source code
pub const CARP = 112

ConstantPGM[src]

Source Code

Source code
pub const PGM = 113

ConstantPFSYNC[src]

Source Code

Source code
pub const PFSYNC = 240

ConstantDIVERT[src]

Source Code

Source code
pub const DIVERT = 254

ConstantMAX[src]

Source Code

Source code
pub const MAX = 256

ConstantDONE[src]

Source Code

Source code
pub const DONE = 257

ConstantUNKNOWN[src]

Source Code

Source code
pub const UNKNOWN = 258

ConstantIP[src]

Source Code

Source code
pub const IP = 0

ConstantHOPOPTS[src]

Source Code

Source code
pub const HOPOPTS = 0

ConstantICMP[src]

Source Code

Source code
pub const ICMP = 1

ConstantIGMP[src]

Source Code

Source code
pub const IGMP = 2

ConstantTCP[src]

Source Code

Source code
pub const TCP = 6

ConstantUDP[src]

Source Code

Source code
pub const UDP = 17

ConstantIPV6[src]

Source Code

Source code
pub const IPV6 = 41

ConstantROUTING[src]

Source Code

Source code
pub const ROUTING = 43

ConstantFRAGMENT[src]

Source Code

Source code
pub const FRAGMENT = 44

ConstantESP[src]

Source Code

Source code
pub const ESP = 50

ConstantAH[src]

Source Code

Source code
pub const AH = 51

ConstantICMPV6[src]

Source Code

Source code
pub const ICMPV6 = 58

ConstantNONE[src]

Source Code

Source code
pub const NONE = 59

ConstantDSTOPTS[src]

Source Code

Source code
pub const DSTOPTS = 60

ConstantETHERIP[src]

Source Code

Source code
pub const ETHERIP = 97

ConstantRAW[src]

Source Code

Source code
pub const RAW = 255

ConstantMAX[src]

Source Code

Source code
pub const MAX = 256

ConstantIP[src]

dummy for IP

Source Code

Source code
pub const IP = 0

ConstantIP[src]

dummy for IP

Source Code

Source code
pub const IP = 0

ConstantICMP[src]

control message protocol

Source Code

Source code
pub const ICMP = 1

ConstantIGMP[src]

group mgmt protocol

Source Code

Source code
pub const IGMP = 2

ConstantGGP[src]

gateway^2 (deprecated)

Source Code

Source code
pub const GGP = 3

ConstantIPIP[src]

IP inside IP

Source Code

Source code
pub const IPIP = 4

ConstantIPIP[src]

IP inside IP

Source Code

Source code
pub const IPIP = 4

ConstantTCP[src]

tcp

Source Code

Source code
pub const TCP = 6

ConstantEGP[src]

exterior gateway protocol

Source Code

Source code
pub const EGP = 8

ConstantPUP[src]

pup

Source Code

Source code
pub const PUP = 12

ConstantUDP[src]

user datagram protocol

Source Code

Source code
pub const UDP = 17

ConstantIDP[src]

xns idp

Source Code

Source code
pub const IDP = 22

ConstantTP[src]

tp-4 w/ class negotiation

Source Code

Source code
pub const TP = 29

ConstantIPV6[src]

IP6 header

Source Code

Source code
pub const IPV6 = 41

ConstantROUTING[src]

IP6 routing header

Source Code

Source code
pub const ROUTING = 43

ConstantFRAGMENT[src]

IP6 fragmentation header

Source Code

Source code
pub const FRAGMENT = 44

ConstantRSVP[src]

resource reservation

Source Code

Source code
pub const RSVP = 46

ConstantGRE[src]

GRE encaps RFC 1701

Source Code

Source code
pub const GRE = 47

ConstantESP[src]

encap. security payload

Source Code

Source code
pub const ESP = 50

ConstantAH[src]

authentication header

Source Code

Source code
pub const AH = 51

ConstantMOBILE[src]

IP Mobility RFC 2004

Source Code

Source code
pub const MOBILE = 55

ConstantIPV6_ICMP[src]

IPv6 ICMP

Source Code

Source code
pub const IPV6_ICMP = 58

ConstantICMPV6[src]

ICMP6

Source Code

Source code
pub const ICMPV6 = 58

ConstantNONE[src]

IP6 no next header

Source Code

Source code
pub const NONE = 59

ConstantDSTOPTS[src]

IP6 destination option

Source Code

Source code
pub const DSTOPTS = 60

ConstantEON[src]

ISO cnlp

Source Code

Source code
pub const EON = 80

ConstantETHERIP[src]

Ethernet-in-IP

Source Code

Source code
pub const ETHERIP = 97

ConstantENCAP[src]

encapsulation header

Source Code

Source code
pub const ENCAP = 98

ConstantPIM[src]

Protocol indep. multicast

Source Code

Source code
pub const PIM = 103

ConstantIPCOMP[src]

IP Payload Comp. Protocol

Source Code

Source code
pub const IPCOMP = 108

ConstantVRRP[src]

VRRP RFC 2338

Source Code

Source code
pub const VRRP = 112

ConstantCARP[src]

Common Address Resolution Protocol

Source Code

Source code
pub const CARP = 112

ConstantPFSYNC[src]

PFSYNC

Source Code

Source code
pub const PFSYNC = 240

ConstantRAW[src]

raw IP packet

Source Code

Source code
pub const RAW = 255

Source Code

Source code
pub const IPPROTO = switch (native_os) {
    .linux, .emscripten => linux.IPPROTO,
    .windows => ws2_32.IPPROTO,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const ICMP = 1;
        pub const ICMPV6 = 58;
        pub const TCP = 6;
        pub const UDP = 17;
        pub const IP = 0;
        pub const IPV6 = 41;
    },
    .freebsd => struct {
        /// dummy for IP
        pub const IP = 0;
        /// control message protocol
        pub const ICMP = 1;
        /// tcp
        pub const TCP = 6;
        /// user datagram protocol
        pub const UDP = 17;
        /// IP6 header
        pub const IPV6 = 41;
        /// raw IP packet
        pub const RAW = 255;
        /// IP6 hop-by-hop options
        pub const HOPOPTS = 0;
        /// group mgmt protocol
        pub const IGMP = 2;
        /// gateway^2 (deprecated)
        pub const GGP = 3;
        /// IPv4 encapsulation
        pub const IPV4 = 4;
        /// for compatibility
        pub const IPIP = IPV4;
        /// Stream protocol II
        pub const ST = 7;
        /// exterior gateway protocol
        pub const EGP = 8;
        /// private interior gateway
        pub const PIGP = 9;
        /// BBN RCC Monitoring
        pub const RCCMON = 10;
        /// network voice protocol
        pub const NVPII = 11;
        /// pup
        pub const PUP = 12;
        /// Argus
        pub const ARGUS = 13;
        /// EMCON
        pub const EMCON = 14;
        /// Cross Net Debugger
        pub const XNET = 15;
        /// Chaos
        pub const CHAOS = 16;
        /// Multiplexing
        pub const MUX = 18;
        /// DCN Measurement Subsystems
        pub const MEAS = 19;
        /// Host Monitoring
        pub const HMP = 20;
        /// Packet Radio Measurement
        pub const PRM = 21;
        /// xns idp
        pub const IDP = 22;
        /// Trunk-1
        pub const TRUNK1 = 23;
        /// Trunk-2
        pub const TRUNK2 = 24;
        /// Leaf-1
        pub const LEAF1 = 25;
        /// Leaf-2
        pub const LEAF2 = 26;
        /// Reliable Data
        pub const RDP = 27;
        /// Reliable Transaction
        pub const IRTP = 28;
        /// tp-4 w/ class negotiation
        pub const TP = 29;
        /// Bulk Data Transfer
        pub const BLT = 30;
        /// Network Services
        pub const NSP = 31;
        /// Merit Internodal
        pub const INP = 32;
        /// Datagram Congestion Control Protocol
        pub const DCCP = 33;
        /// Third Party Connect
        pub const @"3PC" = 34;
        /// InterDomain Policy Routing
        pub const IDPR = 35;
        /// XTP
        pub const XTP = 36;
        /// Datagram Delivery
        pub const DDP = 37;
        /// Control Message Transport
        pub const CMTP = 38;
        /// TP++ Transport
        pub const TPXX = 39;
        /// IL transport protocol
        pub const IL = 40;
        /// Source Demand Routing
        pub const SDRP = 42;
        /// IP6 routing header
        pub const ROUTING = 43;
        /// IP6 fragmentation header
        pub const FRAGMENT = 44;
        /// InterDomain Routing
        pub const IDRP = 45;
        /// resource reservation
        pub const RSVP = 46;
        /// General Routing Encap.
        pub const GRE = 47;
        /// Mobile Host Routing
        pub const MHRP = 48;
        /// BHA
        pub const BHA = 49;
        /// IP6 Encap Sec. Payload
        pub const ESP = 50;
        /// IP6 Auth Header
        pub const AH = 51;
        /// Integ. Net Layer Security
        pub const INLSP = 52;
        /// IP with encryption
        pub const SWIPE = 53;
        /// Next Hop Resolution
        pub const NHRP = 54;
        /// IP Mobility
        pub const MOBILE = 55;
        /// Transport Layer Security
        pub const TLSP = 56;
        /// SKIP
        pub const SKIP = 57;
        /// ICMP6
        pub const ICMPV6 = 58;
        /// IP6 no next header
        pub const NONE = 59;
        /// IP6 destination option
        pub const DSTOPTS = 60;
        /// any host internal protocol
        pub const AHIP = 61;
        /// CFTP
        pub const CFTP = 62;
        /// "hello" routing protocol
        pub const HELLO = 63;
        /// SATNET/Backroom EXPAK
        pub const SATEXPAK = 64;
        /// Kryptolan
        pub const KRYPTOLAN = 65;
        /// Remote Virtual Disk
        pub const RVD = 66;
        /// Pluribus Packet Core
        pub const IPPC = 67;
        /// Any distributed FS
        pub const ADFS = 68;
        /// Satnet Monitoring
        pub const SATMON = 69;
        /// VISA Protocol
        pub const VISA = 70;
        /// Packet Core Utility
        pub const IPCV = 71;
        /// Comp. Prot. Net. Executive
        pub const CPNX = 72;
        /// Comp. Prot. HeartBeat
        pub const CPHB = 73;
        /// Wang Span Network
        pub const WSN = 74;
        /// Packet Video Protocol
        pub const PVP = 75;
        /// BackRoom SATNET Monitoring
        pub const BRSATMON = 76;
        /// Sun net disk proto (temp.)
        pub const ND = 77;
        /// WIDEBAND Monitoring
        pub const WBMON = 78;
        /// WIDEBAND EXPAK
        pub const WBEXPAK = 79;
        /// ISO cnlp
        pub const EON = 80;
        /// VMTP
        pub const VMTP = 81;
        /// Secure VMTP
        pub const SVMTP = 82;
        /// Banyon VINES
        pub const VINES = 83;
        /// TTP
        pub const TTP = 84;
        /// NSFNET-IGP
        pub const IGP = 85;
        /// dissimilar gateway prot.
        pub const DGP = 86;
        /// TCF
        pub const TCF = 87;
        /// Cisco/GXS IGRP
        pub const IGRP = 88;
        /// OSPFIGP
        pub const OSPFIGP = 89;
        /// Strite RPC protocol
        pub const SRPC = 90;
        /// Locus Address Resoloution
        pub const LARP = 91;
        /// Multicast Transport
        pub const MTP = 92;
        /// AX.25 Frames
        pub const AX25 = 93;
        /// IP encapsulated in IP
        pub const IPEIP = 94;
        /// Mobile Int.ing control
        pub const MICP = 95;
        /// Semaphore Comm. security
        pub const SCCSP = 96;
        /// Ethernet IP encapsulation
        pub const ETHERIP = 97;
        /// encapsulation header
        pub const ENCAP = 98;
        /// any private encr. scheme
        pub const APES = 99;
        /// GMTP
        pub const GMTP = 100;
        /// payload compression (IPComp)
        pub const IPCOMP = 108;
        /// SCTP
        pub const SCTP = 132;
        /// IPv6 Mobility Header
        pub const MH = 135;
        /// UDP-Lite
        pub const UDPLITE = 136;
        /// IP6 Host Identity Protocol
        pub const HIP = 139;
        /// IP6 Shim6 Protocol
        pub const SHIM6 = 140;
        /// Protocol Independent Mcast
        pub const PIM = 103;
        /// CARP
        pub const CARP = 112;
        /// PGM
        pub const PGM = 113;
        /// MPLS-in-IP
        pub const MPLS = 137;
        /// PFSYNC
        pub const PFSYNC = 240;
        /// Reserved
        pub const RESERVED_253 = 253;
        /// Reserved
        pub const RESERVED_254 = 254;
    },
    .solaris, .illumos => struct {
        /// dummy for IP
        pub const IP = 0;
        /// Hop by hop header for IPv6
        pub const HOPOPTS = 0;
        /// control message protocol
        pub const ICMP = 1;
        /// group control protocol
        pub const IGMP = 2;
        /// gateway^2 (deprecated)
        pub const GGP = 3;
        /// IP in IP encapsulation
        pub const ENCAP = 4;
        /// tcp
        pub const TCP = 6;
        /// exterior gateway protocol
        pub const EGP = 8;
        /// pup
        pub const PUP = 12;
        /// user datagram protocol
        pub const UDP = 17;
        /// xns idp
        pub const IDP = 22;
        /// IPv6 encapsulated in IP
        pub const IPV6 = 41;
        /// Routing header for IPv6
        pub const ROUTING = 43;
        /// Fragment header for IPv6
        pub const FRAGMENT = 44;
        /// rsvp
        pub const RSVP = 46;
        /// IPsec Encap. Sec. Payload
        pub const ESP = 50;
        /// IPsec Authentication Hdr.
        pub const AH = 51;
        /// ICMP for IPv6
        pub const ICMPV6 = 58;
        /// No next header for IPv6
        pub const NONE = 59;
        /// Destination options
        pub const DSTOPTS = 60;
        /// "hello" routing protocol
        pub const HELLO = 63;
        /// UNOFFICIAL net disk proto
        pub const ND = 77;
        /// ISO clnp
        pub const EON = 80;
        /// OSPF
        pub const OSPF = 89;
        /// PIM routing protocol
        pub const PIM = 103;
        /// Stream Control
        pub const SCTP = 132;
        /// raw IP packet
        pub const RAW = 255;
        /// Sockets Direct Protocol
        pub const PROTO_SDP = 257;
    },
    .netbsd => struct {
        /// dummy for IP
        pub const IP = 0;
        /// IP6 hop-by-hop options
        pub const HOPOPTS = 0;
        /// control message protocol
        pub const ICMP = 1;
        /// group mgmt protocol
        pub const IGMP = 2;
        /// gateway^2 (deprecated)
        pub const GGP = 3;
        /// IP header
        pub const IPV4 = 4;
        /// IP inside IP
        pub const IPIP = 4;
        /// tcp
        pub const TCP = 6;
        /// exterior gateway protocol
        pub const EGP = 8;
        /// pup
        pub const PUP = 12;
        /// user datagram protocol
        pub const UDP = 17;
        /// xns idp
        pub const IDP = 22;
        /// tp-4 w/ class negotiation
        pub const TP = 29;
        /// DCCP
        pub const DCCP = 33;
        /// IP6 header
        pub const IPV6 = 41;
        /// IP6 routing header
        pub const ROUTING = 43;
        /// IP6 fragmentation header
        pub const FRAGMENT = 44;
        /// resource reservation
        pub const RSVP = 46;
        /// GRE encaps RFC 1701
        pub const GRE = 47;
        /// encap. security payload
        pub const ESP = 50;
        /// authentication header
        pub const AH = 51;
        /// IP Mobility RFC 2004
        pub const MOBILE = 55;
        /// IPv6 ICMP
        pub const IPV6_ICMP = 58;
        /// ICMP6
        pub const ICMPV6 = 58;
        /// IP6 no next header
        pub const NONE = 59;
        /// IP6 destination option
        pub const DSTOPTS = 60;
        /// ISO cnlp
        pub const EON = 80;
        /// Ethernet-in-IP
        pub const ETHERIP = 97;
        /// encapsulation header
        pub const ENCAP = 98;
        /// Protocol indep. multicast
        pub const PIM = 103;
        /// IP Payload Comp. Protocol
        pub const IPCOMP = 108;
        /// VRRP RFC 2338
        pub const VRRP = 112;
        /// Common Address Resolution Protocol
        pub const CARP = 112;
        /// L2TPv3
        pub const L2TP = 115;
        /// SCTP
        pub const SCTP = 132;
        /// PFSYNC
        pub const PFSYNC = 240;
        /// raw IP packet
        pub const RAW = 255;
    },
    .dragonfly => struct {
        pub const IP = 0;
        pub const ICMP = 1;
        pub const TCP = 6;
        pub const UDP = 17;
        pub const IPV6 = 41;
        pub const RAW = 255;
        pub const HOPOPTS = 0;
        pub const IGMP = 2;
        pub const GGP = 3;
        pub const IPV4 = 4;
        pub const IPIP = IPV4;
        pub const ST = 7;
        pub const EGP = 8;
        pub const PIGP = 9;
        pub const RCCMON = 10;
        pub const NVPII = 11;
        pub const PUP = 12;
        pub const ARGUS = 13;
        pub const EMCON = 14;
        pub const XNET = 15;
        pub const CHAOS = 16;
        pub const MUX = 18;
        pub const MEAS = 19;
        pub const HMP = 20;
        pub const PRM = 21;
        pub const IDP = 22;
        pub const TRUNK1 = 23;
        pub const TRUNK2 = 24;
        pub const LEAF1 = 25;
        pub const LEAF2 = 26;
        pub const RDP = 27;
        pub const IRTP = 28;
        pub const TP = 29;
        pub const BLT = 30;
        pub const NSP = 31;
        pub const INP = 32;
        pub const SEP = 33;
        pub const @"3PC" = 34;
        pub const IDPR = 35;
        pub const XTP = 36;
        pub const DDP = 37;
        pub const CMTP = 38;
        pub const TPXX = 39;
        pub const IL = 40;
        pub const SDRP = 42;
        pub const ROUTING = 43;
        pub const FRAGMENT = 44;
        pub const IDRP = 45;
        pub const RSVP = 46;
        pub const GRE = 47;
        pub const MHRP = 48;
        pub const BHA = 49;
        pub const ESP = 50;
        pub const AH = 51;
        pub const INLSP = 52;
        pub const SWIPE = 53;
        pub const NHRP = 54;
        pub const MOBILE = 55;
        pub const TLSP = 56;
        pub const SKIP = 57;
        pub const ICMPV6 = 58;
        pub const NONE = 59;
        pub const DSTOPTS = 60;
        pub const AHIP = 61;
        pub const CFTP = 62;
        pub const HELLO = 63;
        pub const SATEXPAK = 64;
        pub const KRYPTOLAN = 65;
        pub const RVD = 66;
        pub const IPPC = 67;
        pub const ADFS = 68;
        pub const SATMON = 69;
        pub const VISA = 70;
        pub const IPCV = 71;
        pub const CPNX = 72;
        pub const CPHB = 73;
        pub const WSN = 74;
        pub const PVP = 75;
        pub const BRSATMON = 76;
        pub const ND = 77;
        pub const WBMON = 78;
        pub const WBEXPAK = 79;
        pub const EON = 80;
        pub const VMTP = 81;
        pub const SVMTP = 82;
        pub const VINES = 83;
        pub const TTP = 84;
        pub const IGP = 85;
        pub const DGP = 86;
        pub const TCF = 87;
        pub const IGRP = 88;
        pub const OSPFIGP = 89;
        pub const SRPC = 90;
        pub const LARP = 91;
        pub const MTP = 92;
        pub const AX25 = 93;
        pub const IPEIP = 94;
        pub const MICP = 95;
        pub const SCCSP = 96;
        pub const ETHERIP = 97;
        pub const ENCAP = 98;
        pub const APES = 99;
        pub const GMTP = 100;
        pub const IPCOMP = 108;
        pub const PIM = 103;
        pub const CARP = 112;
        pub const PGM = 113;
        pub const PFSYNC = 240;
        pub const DIVERT = 254;
        pub const MAX = 256;
        pub const DONE = 257;
        pub const UNKNOWN = 258;
    },
    .haiku => struct {
        pub const IP = 0;
        pub const HOPOPTS = 0;
        pub const ICMP = 1;
        pub const IGMP = 2;
        pub const TCP = 6;
        pub const UDP = 17;
        pub const IPV6 = 41;
        pub const ROUTING = 43;
        pub const FRAGMENT = 44;
        pub const ESP = 50;
        pub const AH = 51;
        pub const ICMPV6 = 58;
        pub const NONE = 59;
        pub const DSTOPTS = 60;
        pub const ETHERIP = 97;
        pub const RAW = 255;
        pub const MAX = 256;
    },
    .openbsd => struct {
        /// dummy for IP
        pub const IP = 0;
        /// IP6 hop-by-hop options
        pub const HOPOPTS = IP;
        /// control message protocol
        pub const ICMP = 1;
        /// group mgmt protocol
        pub const IGMP = 2;
        /// gateway^2 (deprecated)
        pub const GGP = 3;
        /// IP header
        pub const IPV4 = IPIP;
        /// IP inside IP
        pub const IPIP = 4;
        /// tcp
        pub const TCP = 6;
        /// exterior gateway protocol
        pub const EGP = 8;
        /// pup
        pub const PUP = 12;
        /// user datagram protocol
        pub const UDP = 17;
        /// xns idp
        pub const IDP = 22;
        /// tp-4 w/ class negotiation
        pub const TP = 29;
        /// IP6 header
        pub const IPV6 = 41;
        /// IP6 routing header
        pub const ROUTING = 43;
        /// IP6 fragmentation header
        pub const FRAGMENT = 44;
        /// resource reservation
        pub const RSVP = 46;
        /// GRE encaps RFC 1701
        pub const GRE = 47;
        /// encap. security payload
        pub const ESP = 50;
        /// authentication header
        pub const AH = 51;
        /// IP Mobility RFC 2004
        pub const MOBILE = 55;
        /// IPv6 ICMP
        pub const IPV6_ICMP = 58;
        /// ICMP6
        pub const ICMPV6 = 58;
        /// IP6 no next header
        pub const NONE = 59;
        /// IP6 destination option
        pub const DSTOPTS = 60;
        /// ISO cnlp
        pub const EON = 80;
        /// Ethernet-in-IP
        pub const ETHERIP = 97;
        /// encapsulation header
        pub const ENCAP = 98;
        /// Protocol indep. multicast
        pub const PIM = 103;
        /// IP Payload Comp. Protocol
        pub const IPCOMP = 108;
        /// VRRP RFC 2338
        pub const VRRP = 112;
        /// Common Address Resolution Protocol
        pub const CARP = 112;
        /// PFSYNC
        pub const PFSYNC = 240;
        /// raw IP packet
        pub const RAW = 255;
    },
    else => void,
}

TypeSOL[src]

Values

ConstantSOCKET[src]

Source Code

Source code
pub const SOCKET = 0xffff

ConstantSOCKET[src]

Source Code

Source code
pub const SOCKET = 0xffff

ConstantROUTE[src]

Source Code

Source code
pub const ROUTE = 0xfffe

ConstantPACKET[src]

Source Code

Source code
pub const PACKET = 0xfffd

ConstantFILTER[src]

Source Code

Source code
pub const FILTER = 0xfffc

Source Code

Source code
pub const SOL = switch (native_os) {
    .linux => linux.SOL,
    .emscripten => emscripten.SOL,
    .windows => ws2_32.SOL,
    .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const SOCKET = 0xffff;
    },
    .solaris, .illumos => struct {
        pub const SOCKET = 0xffff;
        pub const ROUTE = 0xfffe;
        pub const PACKET = 0xfffd;
        pub const FILTER = 0xfffc;
    },
    else => void,
}

TypeSO[src]

Values

ConstantDEBUG[src]

Source Code

Source code
pub const DEBUG = 0x0001

ConstantACCEPTCONN[src]

Source Code

Source code
pub const ACCEPTCONN = 0x0002

ConstantREUSEADDR[src]

Source Code

Source code
pub const REUSEADDR = 0x0004

ConstantKEEPALIVE[src]

Source Code

Source code
pub const KEEPALIVE = 0x0008

ConstantDONTROUTE[src]

Source Code

Source code
pub const DONTROUTE = 0x0010

ConstantBROADCAST[src]

Source Code

Source code
pub const BROADCAST = 0x0020

ConstantUSELOOPBACK[src]

Source Code

Source code
pub const USELOOPBACK = 0x0040

ConstantLINGER[src]

Source Code

Source code
pub const LINGER = 0x1080

ConstantOOBINLINE[src]

Source Code

Source code
pub const OOBINLINE = 0x0100

ConstantREUSEPORT[src]

Source Code

Source code
pub const REUSEPORT = 0x0200

ConstantACCEPTFILTER[src]

Source Code

Source code
pub const ACCEPTFILTER = 0x1000

ConstantSNDBUF[src]

Source Code

Source code
pub const SNDBUF = 0x1001

ConstantRCVBUF[src]

Source Code

Source code
pub const RCVBUF = 0x1002

ConstantSNDLOWAT[src]

Source Code

Source code
pub const SNDLOWAT = 0x1003

ConstantRCVLOWAT[src]

Source Code

Source code
pub const RCVLOWAT = 0x1004

ConstantSNDTIMEO[src]

Source Code

Source code
pub const SNDTIMEO = 0x1005

ConstantRCVTIMEO[src]

Source Code

Source code
pub const RCVTIMEO = 0x1006

ConstantERROR[src]

Source Code

Source code
pub const ERROR = 0x1007

ConstantTYPE[src]

Source Code

Source code
pub const TYPE = 0x1008

ConstantNREAD[src]

Source Code

Source code
pub const NREAD = 0x1020

ConstantNKE[src]

Source Code

Source code
pub const NKE = 0x1021

ConstantNOSIGPIPE[src]

Source Code

Source code
pub const NOSIGPIPE = 0x1022

ConstantNOADDRERR[src]

Source Code

Source code
pub const NOADDRERR = 0x1023

ConstantNWRITE[src]

Source Code

Source code
pub const NWRITE = 0x1024

ConstantREUSESHAREUID[src]

Source Code

Source code
pub const REUSESHAREUID = 0x1025

ConstantDEBUG[src]

Source Code

Source code
pub const DEBUG = 0x00000001

ConstantACCEPTCONN[src]

Source Code

Source code
pub const ACCEPTCONN = 0x00000002

ConstantREUSEADDR[src]

Source Code

Source code
pub const REUSEADDR = 0x00000004

ConstantKEEPALIVE[src]

Source Code

Source code
pub const KEEPALIVE = 0x00000008

ConstantDONTROUTE[src]

Source Code

Source code
pub const DONTROUTE = 0x00000010

ConstantBROADCAST[src]

Source Code

Source code
pub const BROADCAST = 0x00000020

ConstantUSELOOPBACK[src]

Source Code

Source code
pub const USELOOPBACK = 0x00000040

ConstantLINGER[src]

Source Code

Source code
pub const LINGER = 0x00000080

ConstantOOBINLINE[src]

Source Code

Source code
pub const OOBINLINE = 0x00000100

ConstantREUSEPORT[src]

Source Code

Source code
pub const REUSEPORT = 0x00000200

ConstantTIMESTAMP[src]

Source Code

Source code
pub const TIMESTAMP = 0x00000400

ConstantNOSIGPIPE[src]

Source Code

Source code
pub const NOSIGPIPE = 0x00000800

ConstantACCEPTFILTER[src]

Source Code

Source code
pub const ACCEPTFILTER = 0x00001000

ConstantBINTIME[src]

Source Code

Source code
pub const BINTIME = 0x00002000

ConstantNO_OFFLOAD[src]

Source Code

Source code
pub const NO_OFFLOAD = 0x00004000

ConstantNO_DDP[src]

Source Code

Source code
pub const NO_DDP = 0x00008000

ConstantREUSEPORT_LB[src]

Source Code

Source code
pub const REUSEPORT_LB = 0x00010000

ConstantSNDBUF[src]

Source Code

Source code
pub const SNDBUF = 0x1001

ConstantRCVBUF[src]

Source Code

Source code
pub const RCVBUF = 0x1002

ConstantSNDLOWAT[src]

Source Code

Source code
pub const SNDLOWAT = 0x1003

ConstantRCVLOWAT[src]

Source Code

Source code
pub const RCVLOWAT = 0x1004

ConstantSNDTIMEO[src]

Source Code

Source code
pub const SNDTIMEO = 0x1005

ConstantRCVTIMEO[src]

Source Code

Source code
pub const RCVTIMEO = 0x1006

ConstantERROR[src]

Source Code

Source code
pub const ERROR = 0x1007

ConstantTYPE[src]

Source Code

Source code
pub const TYPE = 0x1008

ConstantLABEL[src]

Source Code

Source code
pub const LABEL = 0x1009

ConstantPEERLABEL[src]

Source Code

Source code
pub const PEERLABEL = 0x1010

ConstantLISTENQLIMIT[src]

Source Code

Source code
pub const LISTENQLIMIT = 0x1011

ConstantLISTENQLEN[src]

Source Code

Source code
pub const LISTENQLEN = 0x1012

ConstantLISTENINCQLEN[src]

Source Code

Source code
pub const LISTENINCQLEN = 0x1013

ConstantSETFIB[src]

Source Code

Source code
pub const SETFIB = 0x1014
Source code
pub const USER_COOKIE = 0x1015

ConstantPROTOCOL[src]

Source Code

Source code
pub const PROTOCOL = 0x1016

ConstantPROTOCOL[src]

Source Code

Source code
pub const PROTOCOL = 0x1016

ConstantTS_CLOCK[src]

Source Code

Source code
pub const TS_CLOCK = 0x1017

ConstantMAX_PACING_RATE[src]

Source Code

Source code
pub const MAX_PACING_RATE = 0x1018

ConstantDOMAIN[src]

Source Code

Source code
pub const DOMAIN = 0x1019

ConstantDEBUG[src]

Source Code

Source code
pub const DEBUG = 0x0001

ConstantACCEPTCONN[src]

Source Code

Source code
pub const ACCEPTCONN = 0x0002

ConstantREUSEADDR[src]

Source Code

Source code
pub const REUSEADDR = 0x0004

ConstantKEEPALIVE[src]

Source Code

Source code
pub const KEEPALIVE = 0x0008

ConstantDONTROUTE[src]

Source Code

Source code
pub const DONTROUTE = 0x0010

ConstantBROADCAST[src]

Source Code

Source code
pub const BROADCAST = 0x0020

ConstantUSELOOPBACK[src]

Source Code

Source code
pub const USELOOPBACK = 0x0040

ConstantLINGER[src]

Source Code

Source code
pub const LINGER = 0x0080

ConstantOOBINLINE[src]

Source Code

Source code
pub const OOBINLINE = 0x0100

ConstantDGRAM_ERRIND[src]

Source Code

Source code
pub const DGRAM_ERRIND = 0x0200

ConstantRECVUCRED[src]

Source Code

Source code
pub const RECVUCRED = 0x0400

ConstantSNDBUF[src]

Source Code

Source code
pub const SNDBUF = 0x1001

ConstantRCVBUF[src]

Source Code

Source code
pub const RCVBUF = 0x1002

ConstantSNDLOWAT[src]

Source Code

Source code
pub const SNDLOWAT = 0x1003

ConstantRCVLOWAT[src]

Source Code

Source code
pub const RCVLOWAT = 0x1004

ConstantSNDTIMEO[src]

Source Code

Source code
pub const SNDTIMEO = 0x1005

ConstantRCVTIMEO[src]

Source Code

Source code
pub const RCVTIMEO = 0x1006

ConstantERROR[src]

Source Code

Source code
pub const ERROR = 0x1007

ConstantTYPE[src]

Source Code

Source code
pub const TYPE = 0x1008

ConstantPROTOTYPE[src]

Source Code

Source code
pub const PROTOTYPE = 0x1009

ConstantANON_MLP[src]

Source Code

Source code
pub const ANON_MLP = 0x100a

ConstantMAC_EXEMPT[src]

Source Code

Source code
pub const MAC_EXEMPT = 0x100b

ConstantDOMAIN[src]

Source Code

Source code
pub const DOMAIN = 0x100c

ConstantRCVPSH[src]

Source Code

Source code
pub const RCVPSH = 0x100d

ConstantSECATTR[src]

Source Code

Source code
pub const SECATTR = 0x1011

ConstantTIMESTAMP[src]

Source Code

Source code
pub const TIMESTAMP = 0x1013

ConstantALLZONES[src]

Source Code

Source code
pub const ALLZONES = 0x1014

ConstantEXCLBIND[src]

Source Code

Source code
pub const EXCLBIND = 0x1015

ConstantMAC_IMPLICIT[src]

Source Code

Source code
pub const MAC_IMPLICIT = 0x1016

ConstantVRRP[src]

Source Code

Source code
pub const VRRP = 0x1017

ConstantDEBUG[src]

Source Code

Source code
pub const DEBUG = 0x0001

ConstantACCEPTCONN[src]

Source Code

Source code
pub const ACCEPTCONN = 0x0002

ConstantREUSEADDR[src]

Source Code

Source code
pub const REUSEADDR = 0x0004

ConstantKEEPALIVE[src]

Source Code

Source code
pub const KEEPALIVE = 0x0008

ConstantDONTROUTE[src]

Source Code

Source code
pub const DONTROUTE = 0x0010

ConstantBROADCAST[src]

Source Code

Source code
pub const BROADCAST = 0x0020

ConstantUSELOOPBACK[src]

Source Code

Source code
pub const USELOOPBACK = 0x0040

ConstantLINGER[src]

Source Code

Source code
pub const LINGER = 0x0080

ConstantOOBINLINE[src]

Source Code

Source code
pub const OOBINLINE = 0x0100

ConstantREUSEPORT[src]

Source Code

Source code
pub const REUSEPORT = 0x0200

ConstantNOSIGPIPE[src]

Source Code

Source code
pub const NOSIGPIPE = 0x0800

ConstantACCEPTFILTER[src]

Source Code

Source code
pub const ACCEPTFILTER = 0x1000

ConstantTIMESTAMP[src]

Source Code

Source code
pub const TIMESTAMP = 0x2000

ConstantRERROR[src]

Source Code

Source code
pub const RERROR = 0x4000

ConstantSNDBUF[src]

Source Code

Source code
pub const SNDBUF = 0x1001

ConstantRCVBUF[src]

Source Code

Source code
pub const RCVBUF = 0x1002

ConstantSNDLOWAT[src]

Source Code

Source code
pub const SNDLOWAT = 0x1003

ConstantRCVLOWAT[src]

Source Code

Source code
pub const RCVLOWAT = 0x1004

ConstantERROR[src]

Source Code

Source code
pub const ERROR = 0x1007

ConstantTYPE[src]

Source Code

Source code
pub const TYPE = 0x1008

ConstantOVERFLOWED[src]

Source Code

Source code
pub const OVERFLOWED = 0x1009

ConstantNOHEADER[src]

Source Code

Source code
pub const NOHEADER = 0x100a

ConstantSNDTIMEO[src]

Source Code

Source code
pub const SNDTIMEO = 0x100b

ConstantRCVTIMEO[src]

Source Code

Source code
pub const RCVTIMEO = 0x100c

ConstantDEBUG[src]

Source Code

Source code
pub const DEBUG = 0x0001

ConstantACCEPTCONN[src]

Source Code

Source code
pub const ACCEPTCONN = 0x0002

ConstantREUSEADDR[src]

Source Code

Source code
pub const REUSEADDR = 0x0004

ConstantKEEPALIVE[src]

Source Code

Source code
pub const KEEPALIVE = 0x0008

ConstantDONTROUTE[src]

Source Code

Source code
pub const DONTROUTE = 0x0010

ConstantBROADCAST[src]

Source Code

Source code
pub const BROADCAST = 0x0020

ConstantUSELOOPBACK[src]

Source Code

Source code
pub const USELOOPBACK = 0x0040

ConstantLINGER[src]

Source Code

Source code
pub const LINGER = 0x0080

ConstantOOBINLINE[src]

Source Code

Source code
pub const OOBINLINE = 0x0100

ConstantREUSEPORT[src]

Source Code

Source code
pub const REUSEPORT = 0x0200

ConstantTIMESTAMP[src]

Source Code

Source code
pub const TIMESTAMP = 0x0400

ConstantNOSIGPIPE[src]

Source Code

Source code
pub const NOSIGPIPE = 0x0800

ConstantACCEPTFILTER[src]

Source Code

Source code
pub const ACCEPTFILTER = 0x1000

ConstantRERROR[src]

Source Code

Source code
pub const RERROR = 0x2000

ConstantPASSCRED[src]

Source Code

Source code
pub const PASSCRED = 0x4000

ConstantSNDBUF[src]

Source Code

Source code
pub const SNDBUF = 0x1001

ConstantRCVBUF[src]

Source Code

Source code
pub const RCVBUF = 0x1002

ConstantSNDLOWAT[src]

Source Code

Source code
pub const SNDLOWAT = 0x1003

ConstantRCVLOWAT[src]

Source Code

Source code
pub const RCVLOWAT = 0x1004

ConstantSNDTIMEO[src]

Source Code

Source code
pub const SNDTIMEO = 0x1005

ConstantRCVTIMEO[src]

Source Code

Source code
pub const RCVTIMEO = 0x1006

ConstantERROR[src]

Source Code

Source code
pub const ERROR = 0x1007

ConstantTYPE[src]

Source Code

Source code
pub const TYPE = 0x1008

ConstantSNDSPACE[src]

Source Code

Source code
pub const SNDSPACE = 0x100a

ConstantCPUHINT[src]

Source Code

Source code
pub const CPUHINT = 0x1030

ConstantACCEPTCONN[src]

Source Code

Source code
pub const ACCEPTCONN = 0x00000001

ConstantBROADCAST[src]

Source Code

Source code
pub const BROADCAST = 0x00000002

ConstantDEBUG[src]

Source Code

Source code
pub const DEBUG = 0x00000004

ConstantDONTROUTE[src]

Source Code

Source code
pub const DONTROUTE = 0x00000008

ConstantKEEPALIVE[src]

Source Code

Source code
pub const KEEPALIVE = 0x00000010

ConstantOOBINLINE[src]

Source Code

Source code
pub const OOBINLINE = 0x00000020

ConstantREUSEADDR[src]

Source Code

Source code
pub const REUSEADDR = 0x00000040

ConstantREUSEPORT[src]

Source Code

Source code
pub const REUSEPORT = 0x00000080

ConstantUSELOOPBACK[src]

Source Code

Source code
pub const USELOOPBACK = 0x00000100

ConstantLINGER[src]

Source Code

Source code
pub const LINGER = 0x00000200

ConstantSNDBUF[src]

Source Code

Source code
pub const SNDBUF = 0x40000001

ConstantSNDLOWAT[src]

Source Code

Source code
pub const SNDLOWAT = 0x40000002

ConstantSNDTIMEO[src]

Source Code

Source code
pub const SNDTIMEO = 0x40000003

ConstantRCVBUF[src]

Source Code

Source code
pub const RCVBUF = 0x40000004

ConstantRCVLOWAT[src]

Source Code

Source code
pub const RCVLOWAT = 0x40000005

ConstantRCVTIMEO[src]

Source Code

Source code
pub const RCVTIMEO = 0x40000006

ConstantERROR[src]

Source Code

Source code
pub const ERROR = 0x40000007

ConstantTYPE[src]

Source Code

Source code
pub const TYPE = 0x40000008

ConstantNONBLOCK[src]

Source Code

Source code
pub const NONBLOCK = 0x40000009

ConstantBINDTODEVICE[src]

Source Code

Source code
pub const BINDTODEVICE = 0x4000000a

ConstantPEERCRED[src]

Source Code

Source code
pub const PEERCRED = 0x4000000b

ConstantDEBUG[src]

Source Code

Source code
pub const DEBUG = 0x0001

ConstantACCEPTCONN[src]

Source Code

Source code
pub const ACCEPTCONN = 0x0002

ConstantREUSEADDR[src]

Source Code

Source code
pub const REUSEADDR = 0x0004

ConstantKEEPALIVE[src]

Source Code

Source code
pub const KEEPALIVE = 0x0008

ConstantDONTROUTE[src]

Source Code

Source code
pub const DONTROUTE = 0x0010

ConstantBROADCAST[src]

Source Code

Source code
pub const BROADCAST = 0x0020

ConstantUSELOOPBACK[src]

Source Code

Source code
pub const USELOOPBACK = 0x0040

ConstantLINGER[src]

Source Code

Source code
pub const LINGER = 0x0080

ConstantOOBINLINE[src]

Source Code

Source code
pub const OOBINLINE = 0x0100

ConstantREUSEPORT[src]

Source Code

Source code
pub const REUSEPORT = 0x0200

ConstantTIMESTAMP[src]

Source Code

Source code
pub const TIMESTAMP = 0x0800

ConstantBINDANY[src]

Source Code

Source code
pub const BINDANY = 0x1000

ConstantZEROIZE[src]

Source Code

Source code
pub const ZEROIZE = 0x2000

ConstantSNDBUF[src]

Source Code

Source code
pub const SNDBUF = 0x1001

ConstantRCVBUF[src]

Source Code

Source code
pub const RCVBUF = 0x1002

ConstantSNDLOWAT[src]

Source Code

Source code
pub const SNDLOWAT = 0x1003

ConstantRCVLOWAT[src]

Source Code

Source code
pub const RCVLOWAT = 0x1004

ConstantSNDTIMEO[src]

Source Code

Source code
pub const SNDTIMEO = 0x1005

ConstantRCVTIMEO[src]

Source Code

Source code
pub const RCVTIMEO = 0x1006

ConstantERROR[src]

Source Code

Source code
pub const ERROR = 0x1007

ConstantTYPE[src]

Source Code

Source code
pub const TYPE = 0x1008

ConstantNETPROC[src]

Source Code

Source code
pub const NETPROC = 0x1020

ConstantRTABLE[src]

Source Code

Source code
pub const RTABLE = 0x1021

ConstantPEERCRED[src]

Source Code

Source code
pub const PEERCRED = 0x1022

ConstantSPLICE[src]

Source Code

Source code
pub const SPLICE = 0x1023

ConstantDOMAIN[src]

Source Code

Source code
pub const DOMAIN = 0x1024

ConstantPROTOCOL[src]

Source Code

Source code
pub const PROTOCOL = 0x1025

Source Code

Source code
pub const SO = switch (native_os) {
    .linux => linux.SO,
    .emscripten => emscripten.SO,
    .windows => ws2_32.SO,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const DEBUG = 0x0001;
        pub const ACCEPTCONN = 0x0002;
        pub const REUSEADDR = 0x0004;
        pub const KEEPALIVE = 0x0008;
        pub const DONTROUTE = 0x0010;
        pub const BROADCAST = 0x0020;
        pub const USELOOPBACK = 0x0040;
        pub const LINGER = 0x1080;
        pub const OOBINLINE = 0x0100;
        pub const REUSEPORT = 0x0200;
        pub const ACCEPTFILTER = 0x1000;
        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const SNDTIMEO = 0x1005;
        pub const RCVTIMEO = 0x1006;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;

        pub const NREAD = 0x1020;
        pub const NKE = 0x1021;
        pub const NOSIGPIPE = 0x1022;
        pub const NOADDRERR = 0x1023;
        pub const NWRITE = 0x1024;
        pub const REUSESHAREUID = 0x1025;
    },
    .freebsd => struct {
        pub const DEBUG = 0x00000001;
        pub const ACCEPTCONN = 0x00000002;
        pub const REUSEADDR = 0x00000004;
        pub const KEEPALIVE = 0x00000008;
        pub const DONTROUTE = 0x00000010;
        pub const BROADCAST = 0x00000020;
        pub const USELOOPBACK = 0x00000040;
        pub const LINGER = 0x00000080;
        pub const OOBINLINE = 0x00000100;
        pub const REUSEPORT = 0x00000200;
        pub const TIMESTAMP = 0x00000400;
        pub const NOSIGPIPE = 0x00000800;
        pub const ACCEPTFILTER = 0x00001000;
        pub const BINTIME = 0x00002000;
        pub const NO_OFFLOAD = 0x00004000;
        pub const NO_DDP = 0x00008000;
        pub const REUSEPORT_LB = 0x00010000;

        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const SNDTIMEO = 0x1005;
        pub const RCVTIMEO = 0x1006;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;
        pub const LABEL = 0x1009;
        pub const PEERLABEL = 0x1010;
        pub const LISTENQLIMIT = 0x1011;
        pub const LISTENQLEN = 0x1012;
        pub const LISTENINCQLEN = 0x1013;
        pub const SETFIB = 0x1014;
        pub const USER_COOKIE = 0x1015;
        pub const PROTOCOL = 0x1016;
        pub const PROTOTYPE = PROTOCOL;
        pub const TS_CLOCK = 0x1017;
        pub const MAX_PACING_RATE = 0x1018;
        pub const DOMAIN = 0x1019;
    },
    .solaris, .illumos => struct {
        pub const DEBUG = 0x0001;
        pub const ACCEPTCONN = 0x0002;
        pub const REUSEADDR = 0x0004;
        pub const KEEPALIVE = 0x0008;
        pub const DONTROUTE = 0x0010;
        pub const BROADCAST = 0x0020;
        pub const USELOOPBACK = 0x0040;
        pub const LINGER = 0x0080;
        pub const OOBINLINE = 0x0100;
        pub const DGRAM_ERRIND = 0x0200;
        pub const RECVUCRED = 0x0400;

        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const SNDTIMEO = 0x1005;
        pub const RCVTIMEO = 0x1006;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;
        pub const PROTOTYPE = 0x1009;
        pub const ANON_MLP = 0x100a;
        pub const MAC_EXEMPT = 0x100b;
        pub const DOMAIN = 0x100c;
        pub const RCVPSH = 0x100d;

        pub const SECATTR = 0x1011;
        pub const TIMESTAMP = 0x1013;
        pub const ALLZONES = 0x1014;
        pub const EXCLBIND = 0x1015;
        pub const MAC_IMPLICIT = 0x1016;
        pub const VRRP = 0x1017;
    },
    .netbsd => struct {
        pub const DEBUG = 0x0001;
        pub const ACCEPTCONN = 0x0002;
        pub const REUSEADDR = 0x0004;
        pub const KEEPALIVE = 0x0008;
        pub const DONTROUTE = 0x0010;
        pub const BROADCAST = 0x0020;
        pub const USELOOPBACK = 0x0040;
        pub const LINGER = 0x0080;
        pub const OOBINLINE = 0x0100;
        pub const REUSEPORT = 0x0200;
        pub const NOSIGPIPE = 0x0800;
        pub const ACCEPTFILTER = 0x1000;
        pub const TIMESTAMP = 0x2000;
        pub const RERROR = 0x4000;

        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;
        pub const OVERFLOWED = 0x1009;

        pub const NOHEADER = 0x100a;
        pub const SNDTIMEO = 0x100b;
        pub const RCVTIMEO = 0x100c;
    },
    .dragonfly => struct {
        pub const DEBUG = 0x0001;
        pub const ACCEPTCONN = 0x0002;
        pub const REUSEADDR = 0x0004;
        pub const KEEPALIVE = 0x0008;
        pub const DONTROUTE = 0x0010;
        pub const BROADCAST = 0x0020;
        pub const USELOOPBACK = 0x0040;
        pub const LINGER = 0x0080;
        pub const OOBINLINE = 0x0100;
        pub const REUSEPORT = 0x0200;
        pub const TIMESTAMP = 0x0400;
        pub const NOSIGPIPE = 0x0800;
        pub const ACCEPTFILTER = 0x1000;
        pub const RERROR = 0x2000;
        pub const PASSCRED = 0x4000;

        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const SNDTIMEO = 0x1005;
        pub const RCVTIMEO = 0x1006;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;
        pub const SNDSPACE = 0x100a;
        pub const CPUHINT = 0x1030;
    },
    .haiku => struct {
        pub const ACCEPTCONN = 0x00000001;
        pub const BROADCAST = 0x00000002;
        pub const DEBUG = 0x00000004;
        pub const DONTROUTE = 0x00000008;
        pub const KEEPALIVE = 0x00000010;
        pub const OOBINLINE = 0x00000020;
        pub const REUSEADDR = 0x00000040;
        pub const REUSEPORT = 0x00000080;
        pub const USELOOPBACK = 0x00000100;
        pub const LINGER = 0x00000200;

        pub const SNDBUF = 0x40000001;
        pub const SNDLOWAT = 0x40000002;
        pub const SNDTIMEO = 0x40000003;
        pub const RCVBUF = 0x40000004;
        pub const RCVLOWAT = 0x40000005;
        pub const RCVTIMEO = 0x40000006;
        pub const ERROR = 0x40000007;
        pub const TYPE = 0x40000008;
        pub const NONBLOCK = 0x40000009;
        pub const BINDTODEVICE = 0x4000000a;
        pub const PEERCRED = 0x4000000b;
    },
    .openbsd => struct {
        pub const DEBUG = 0x0001;
        pub const ACCEPTCONN = 0x0002;
        pub const REUSEADDR = 0x0004;
        pub const KEEPALIVE = 0x0008;
        pub const DONTROUTE = 0x0010;
        pub const BROADCAST = 0x0020;
        pub const USELOOPBACK = 0x0040;
        pub const LINGER = 0x0080;
        pub const OOBINLINE = 0x0100;
        pub const REUSEPORT = 0x0200;
        pub const TIMESTAMP = 0x0800;
        pub const BINDANY = 0x1000;
        pub const ZEROIZE = 0x2000;
        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const SNDTIMEO = 0x1005;
        pub const RCVTIMEO = 0x1006;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;
        pub const NETPROC = 0x1020;
        pub const RTABLE = 0x1021;
        pub const PEERCRED = 0x1022;
        pub const SPLICE = 0x1023;
        pub const DOMAIN = 0x1024;
        pub const PROTOCOL = 0x1025;
    },
    else => void,
}

TypeSOMAXCONN[src]

Source Code

Source code
pub const SOMAXCONN = switch (native_os) {
    .linux => linux.SOMAXCONN,
    .windows => ws2_32.SOMAXCONN,
    .solaris, .illumos => 128,
    .openbsd => 28,
    else => void,
}

TypeIFNAMESIZE[src]

Source Code

Source code
pub const IFNAMESIZE = switch (native_os) {
    .linux => linux.IFNAMESIZE,
    .emscripten => emscripten.IFNAMESIZE,
    .windows => 30,
    .openbsd, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => 16,
    .solaris, .illumos => 32,
    else => void,
}

Typestack_t[src]

Source Code

Source code
pub const stack_t = switch (native_os) {
    .linux => linux.stack_t,
    .emscripten => emscripten.stack_t,
    .freebsd, .openbsd => extern struct {
        /// Signal stack base.
        sp: *anyopaque,
        /// Signal stack length.
        size: usize,
        /// SS_DISABLE and/or SS_ONSTACK.
        flags: i32,
    },
    else => extern struct {
        sp: [*]u8,
        size: isize,
        flags: i32,
    },
}

Typetime_t[src]

Source Code

Source code
pub const time_t = switch (native_os) {
    .linux => linux.time_t,
    .emscripten => emscripten.time_t,
    .haiku, .dragonfly => isize,
    else => i64,
}

Typesuseconds_t[src]

Source Code

Source code
pub const suseconds_t = switch (native_os) {
    .solaris, .illumos => i64,
    .freebsd, .dragonfly => c_long,
    .netbsd => c_int,
    .haiku => i32,
    else => void,
}

Typetimeval[src]

Source Code

Source code
pub const timeval = switch (native_os) {
    .linux => linux.timeval,
    .emscripten => emscripten.timeval,
    .windows => extern struct {
        sec: c_long,
        usec: c_long,
    },
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        sec: c_long,
        usec: i32,
    },
    .dragonfly, .netbsd, .freebsd, .solaris, .illumos => extern struct {
        /// seconds
        sec: time_t,
        /// microseconds
        usec: suseconds_t,
    },
    .openbsd => extern struct {
        sec: time_t,
        usec: c_long,
    },
    else => void,
}

Typetimezone[src]

Source Code

Source code
pub const timezone = switch (native_os) {
    .linux => linux.timezone,
    .emscripten => emscripten.timezone,
    .openbsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        minuteswest: i32,
        dsttime: i32,
    },
    else => void,
}

Typeucontext_t[src]

Source Code

Source code
pub const ucontext_t = switch (native_os) {
    .linux => linux.ucontext_t,
    .emscripten => emscripten.ucontext_t,
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        onstack: c_int,
        sigmask: sigset_t,
        stack: stack_t,
        link: ?*ucontext_t,
        mcsize: u64,
        mcontext: *mcontext_t,
        __mcontext_data: mcontext_t,
    },
    .freebsd => extern struct {
        sigmask: sigset_t,
        mcontext: mcontext_t,
        link: ?*ucontext_t,
        stack: stack_t,
        flags: c_int,
        __spare__: [4]c_int,
    },
    .solaris, .illumos => extern struct {
        flags: u64,
        link: ?*ucontext_t,
        sigmask: sigset_t,
        stack: stack_t,
        mcontext: mcontext_t,
        brand_data: [3]?*anyopaque,
        filler: [2]i64,
    },
    .netbsd => extern struct {
        flags: u32,
        link: ?*ucontext_t,
        sigmask: sigset_t,
        stack: stack_t,
        mcontext: mcontext_t,
        __pad: [
            switch (builtin.cpu.arch) {
                .x86 => 4,
                .mips, .mipsel, .mips64, .mips64el => 14,
                .arm, .armeb, .thumb, .thumbeb => 1,
                .sparc, .sparc64 => if (@sizeOf(usize) == 4) 43 else 8,
                else => 0,
            }
        ]u32,
    },
    .dragonfly => extern struct {
        sigmask: sigset_t,
        mcontext: mcontext_t,
        link: ?*ucontext_t,
        stack: stack_t,
        cofunc: ?*fn (?*ucontext_t, ?*anyopaque) void,
        arg: ?*void,
        _spare: [4]c_int,
    },
    .haiku => extern struct {
        link: ?*ucontext_t,
        sigmask: sigset_t,
        stack: stack_t,
        mcontext: mcontext_t,
    },
    .openbsd => openbsd.ucontext_t,
    else => void,
}

Typemcontext_t[src]

Source Code

Source code
pub const mcontext_t = switch (native_os) {
    .linux => linux.mcontext_t,
    .emscripten => emscripten.mcontext_t,
    .macos, .ios, .tvos, .watchos, .visionos => darwin.mcontext_t,
    .freebsd => switch (builtin.cpu.arch) {
        .x86_64 => extern struct {
            onstack: u64,
            rdi: u64,
            rsi: u64,
            rdx: u64,
            rcx: u64,
            r8: u64,
            r9: u64,
            rax: u64,
            rbx: u64,
            rbp: u64,
            r10: u64,
            r11: u64,
            r12: u64,
            r13: u64,
            r14: u64,
            r15: u64,
            trapno: u32,
            fs: u16,
            gs: u16,
            addr: u64,
            flags: u32,
            es: u16,
            ds: u16,
            err: u64,
            rip: u64,
            cs: u64,
            rflags: u64,
            rsp: u64,
            ss: u64,
            len: u64,
            fpformat: u64,
            ownedfp: u64,
            fpstate: [64]u64 align(16),
            fsbase: u64,
            gsbase: u64,
            xfpustate: u64,
            xfpustate_len: u64,
            spare: [4]u64,
        },
        .aarch64 => extern struct {
            gpregs: extern struct {
                x: [30]u64,
                lr: u64,
                sp: u64,
                elr: u64,
                spsr: u32,
                _pad: u32,
            },
            fpregs: extern struct {
                q: [32]u128,
                sr: u32,
                cr: u32,
                flags: u32,
                _pad: u32,
            },
            flags: u32,
            _pad: u32,
            _spare: [8]u64,
        },
        else => struct {},
    },
    .solaris, .illumos => extern struct {
        gregs: [28]u64,
        fpregs: solaris.fpregset_t,
    },
    .netbsd => switch (builtin.cpu.arch) {
        .aarch64 => extern struct {
            gregs: [35]u64,
            fregs: [528]u8 align(16),
            spare: [8]u64,
        },
        .x86_64 => extern struct {
            gregs: [26]u64,
            mc_tlsbase: u64,
            fpregs: [512]u8 align(8),
        },
        else => struct {},
    },
    .dragonfly => dragonfly.mcontext_t,
    .haiku => haiku.mcontext_t,
    else => void,
}

Typeuser_desc[src]

Source Code

Source code
pub const user_desc = switch (native_os) {
    .linux => linux.user_desc,
    else => void,
}

Typeutsname[src]

Source Code

Source code
pub const utsname = switch (native_os) {
    .linux => linux.utsname,
    .emscripten => emscripten.utsname,
    .solaris, .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,
    },
    .macos => extern struct {
        sysname: [256:0]u8,
        nodename: [256:0]u8,
        release: [256:0]u8,
        version: [256:0]u8,
        machine: [256:0]u8,
    },
    else => void,
}

TypePR[src]

Source Code

Source code
pub const PR = switch (native_os) {
    .linux => linux.PR,
    else => void,
}

TypeRTLD[src]

Source Code

Source code
pub const RTLD = switch (native_os) {
    .linux, .emscripten => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        NOLOAD: bool = false,
        _3: u5 = 0,
        GLOBAL: bool = false,
        _9: u3 = 0,
        NODELETE: bool = false,
        _: u19 = 0,
    },
    .dragonfly, .freebsd => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        _2: u6 = 0,
        GLOBAL: bool = false,
        TRACE: bool = false,
        _10: u2 = 0,
        NODELETE: bool = false,
        NOLOAD: bool = false,
        _: u18 = 0,
    },
    .haiku => packed struct(u32) {
        NOW: bool = false,
        GLOBAL: bool = false,
        _: u30 = 0,
    },
    .netbsd => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        _2: u6 = 0,
        GLOBAL: bool = false,
        LOCAL: bool = false,
        _10: u2 = 0,
        NODELETE: bool = false,
        NOLOAD: bool = false,
        _: u18 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        NOLOAD: bool = false,
        _3: u5 = 0,
        GLOBAL: bool = false,
        PARENT: bool = false,
        GROUP: bool = false,
        WORLD: bool = false,
        NODELETE: bool = false,
        FIRST: bool = false,
        _14: u2 = 0,
        CONFGEN: bool = false,
        _: u15 = 0,
    },
    .openbsd => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        _2: u6 = 0,
        GLOBAL: bool = false,
        TRACE: bool = false,
        _: u22 = 0,
    },
    .macos, .ios, .tvos, .watchos, .visionos => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        LOCAL: bool = false,
        GLOBAL: bool = false,
        NOLOAD: bool = false,
        _5: u2 = 0,
        NODELETE: bool = false,
        FIRST: bool = false,
        _: u23 = 0,
    },
    else => void,
}

Typedirent[src]

Functions

Functionreclen[src]

pub fn reclen(self: dirent) u16

Parameters

self: dirent

Source Code

Source code
pub fn reclen(self: dirent) u16 {
    return (@offsetOf(dirent, "name") + self.namlen + 1 + 7) & ~@as(u16, 7);
}

Source Code

Source code
pub const dirent = switch (native_os) {
    .linux, .emscripten => extern struct {
        ino: c_uint,
        off: c_uint,
        reclen: c_ushort,
        type: u8,
        name: [256]u8,
    },
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        ino: u64,
        seekoff: u64,
        reclen: u16,
        namlen: u16,
        type: u8,
        name: [1024]u8,
    },
    .freebsd => extern struct {
        /// File number of entry.
        fileno: ino_t,
        /// Directory offset of entry.
        off: off_t,
        /// Length of this record.
        reclen: u16,
        /// File type, one of DT_.
        type: u8,
        pad0: u8 = 0,
        /// Length of the name member.
        namlen: u16,
        pad1: u16 = 0,
        /// Name of entry.
        name: [255:0]u8,
    },
    .solaris, .illumos => extern struct {
        /// Inode number of entry.
        ino: ino_t,
        /// Offset of this entry on disk.
        off: off_t,
        /// Length of this record.
        reclen: u16,
        /// File name.
        name: [MAXNAMLEN:0]u8,
    },
    .netbsd => extern struct {
        fileno: ino_t,
        reclen: u16,
        namlen: u16,
        type: u8,
        name: [MAXNAMLEN:0]u8,
    },
    .dragonfly => extern struct {
        fileno: c_ulong,
        namlen: u16,
        type: u8,
        unused1: u8,
        unused2: u32,
        name: [256]u8,

        pub fn reclen(self: dirent) u16 {
            return (@offsetOf(dirent, "name") + self.namlen + 1 + 7) & ~@as(u16, 7);
        }
    },
    .openbsd => extern struct {
        fileno: ino_t,
        off: off_t,
        reclen: u16,
        type: u8,
        namlen: u8,
        _: u32 align(1) = 0,
        name: [MAXNAMLEN:0]u8,
    },
    else => void,
}

Typedirent64[src]

Source Code

Source code
pub const dirent64 = switch (native_os) {
    .linux => extern struct {
        ino: c_ulong,
        off: c_ulong,
        reclen: c_ushort,
        type: u8,
        name: [256]u8,
    },
    else => void,
}

TypeAI[src]

Source Code

Source code
pub const AI = if (builtin.abi.isAndroid()) packed struct(u32) {
    PASSIVE: bool = false,
    CANONNAME: bool = false,
    NUMERICHOST: bool = false,
    NUMERICSERV: bool = false,
    _4: u4 = 0,
    ALL: bool = false,
    V4MAPPED_CFG: bool = false,
    ADDRCONFIG: bool = false,
    V4MAPPED: bool = false,
    _: u20 = 0,
} else switch (native_os) {
    .linux, .emscripten => linux.AI,
    .dragonfly, .haiku, .freebsd => packed struct(u32) {
        PASSIVE: bool = false,
        CANONNAME: bool = false,
        NUMERICHOST: bool = false,
        NUMERICSERV: bool = false,
        _4: u4 = 0,
        ALL: bool = false,
        V4MAPPED_CFG: bool = false,
        ADDRCONFIG: bool = false,
        V4MAPPED: bool = false,
        _: u20 = 0,
    },
    .netbsd => packed struct(u32) {
        PASSIVE: bool = false,
        CANONNAME: bool = false,
        NUMERICHOST: bool = false,
        NUMERICSERV: bool = false,
        _4: u6 = 0,
        ADDRCONFIG: bool = false,
        _: u21 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        V4MAPPED: bool = false,
        ALL: bool = false,
        ADDRCONFIG: bool = false,
        PASSIVE: bool = false,
        CANONNAME: bool = false,
        NUMERICHOST: bool = false,
        NUMERICSERV: bool = false,
        _: u25 = 0,
    },
    .openbsd => packed struct(u32) {
        PASSIVE: bool = false,
        CANONNAME: bool = false,
        NUMERICHOST: bool = false,
        _3: u1 = 0,
        NUMERICSERV: bool = false,
        _5: u1 = 0,
        ADDRCONFIG: bool = false,
        _: u25 = 0,
    },
    .macos, .ios, .tvos, .watchos, .visionos => packed struct(u32) {
        PASSIVE: bool = false,
        CANONNAME: bool = false,
        NUMERICHOST: bool = false,
        _3: u5 = 0,
        ALL: bool = false,
        V4MAPPED_CFG: bool = false,
        ADDRCONFIG: bool = false,
        V4MAPPED: bool = false,
        NUMERICSERV: bool = false,
        _: u19 = 0,
    },
    .windows => ws2_32.AI,
    else => void,
}

TypeNI[src]

Source Code

Source code
pub const NI = switch (native_os) {
    .linux, .emscripten => packed struct(u32) {
        NUMERICHOST: bool = false,
        NUMERICSERV: bool = false,
        NOFQDN: bool = false,
        NAMEREQD: bool = false,
        DGRAM: bool = false,
        _5: u3 = 0,
        NUMERICSCOPE: bool = false,
        _: u23 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        NOFQDN: bool = false,
        NUMERICHOST: bool = false,
        NAMEREQD: bool = false,
        NUMERICSERV: bool = false,
        DGRAM: bool = false,
        WITHSCOPEID: bool = false,
        NUMERICSCOPE: bool = false,
        _: u25 = 0,
    },
    else => void,
}

TypeEAI[src]

Source Code

Source code
pub const EAI = if (builtin.abi.isAndroid()) enum(c_int) {
    /// address family for hostname not supported
    ADDRFAMILY = 1,
    /// temporary failure in name resolution
    AGAIN = 2,
    /// invalid value for ai_flags
    BADFLAGS = 3,
    /// non-recoverable failure in name resolution
    FAIL = 4,
    /// ai_family not supported
    FAMILY = 5,
    /// memory allocation failure
    MEMORY = 6,
    /// no address associated with hostname
    NODATA = 7,
    /// hostname nor servname provided, or not known
    NONAME = 8,
    /// servname not supported for ai_socktype
    SERVICE = 9,
    /// ai_socktype not supported
    SOCKTYPE = 10,
    /// system error returned in errno
    SYSTEM = 11,
    /// invalid value for hints
    BADHINTS = 12,
    /// resolved protocol is unknown
    PROTOCOL = 13,
    /// argument buffer overflow
    OVERFLOW = 14,

    MAX = 15,

    _,
} else switch (native_os) {
    .linux, .emscripten => enum(c_int) {
        BADFLAGS = -1,
        NONAME = -2,
        AGAIN = -3,
        FAIL = -4,
        FAMILY = -6,
        SOCKTYPE = -7,
        SERVICE = -8,
        MEMORY = -10,
        SYSTEM = -11,
        OVERFLOW = -12,

        NODATA = -5,
        ADDRFAMILY = -9,
        INPROGRESS = -100,
        CANCELED = -101,
        NOTCANCELED = -102,
        ALLDONE = -103,
        INTR = -104,
        IDN_ENCODE = -105,

        _,
    },
    .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => enum(c_int) {
        /// address family for hostname not supported
        ADDRFAMILY = 1,
        /// temporary failure in name resolution
        AGAIN = 2,
        /// invalid value for ai_flags
        BADFLAGS = 3,
        /// non-recoverable failure in name resolution
        FAIL = 4,
        /// ai_family not supported
        FAMILY = 5,
        /// memory allocation failure
        MEMORY = 6,
        /// no address associated with hostname
        NODATA = 7,
        /// hostname nor servname provided, or not known
        NONAME = 8,
        /// servname not supported for ai_socktype
        SERVICE = 9,
        /// ai_socktype not supported
        SOCKTYPE = 10,
        /// system error returned in errno
        SYSTEM = 11,
        /// invalid value for hints
        BADHINTS = 12,
        /// resolved protocol is unknown
        PROTOCOL = 13,
        /// argument buffer overflow
        OVERFLOW = 14,
        _,
    },
    .solaris, .illumos => enum(c_int) {
        /// address family for hostname not supported
        ADDRFAMILY = 1,
        /// name could not be resolved at this time
        AGAIN = 2,
        /// flags parameter had an invalid value
        BADFLAGS = 3,
        /// non-recoverable failure in name resolution
        FAIL = 4,
        /// address family not recognized
        FAMILY = 5,
        /// memory allocation failure
        MEMORY = 6,
        /// no address associated with hostname
        NODATA = 7,
        /// name does not resolve
        NONAME = 8,
        /// service not recognized for socket type
        SERVICE = 9,
        /// intended socket type was not recognized
        SOCKTYPE = 10,
        /// system error returned in errno
        SYSTEM = 11,
        /// argument buffer overflow
        OVERFLOW = 12,
        /// resolved protocol is unknown
        PROTOCOL = 13,

        _,
    },
    .openbsd => enum(c_int) {
        /// address family for hostname not supported
        ADDRFAMILY = -9,
        /// name could not be resolved at this time
        AGAIN = -3,
        /// flags parameter had an invalid value
        BADFLAGS = -1,
        /// non-recoverable failure in name resolution
        FAIL = -4,
        /// address family not recognized
        FAMILY = -6,
        /// memory allocation failure
        MEMORY = -10,
        /// no address associated with hostname
        NODATA = -5,
        /// name does not resolve
        NONAME = -2,
        /// service not recognized for socket type
        SERVICE = -8,
        /// intended socket type was not recognized
        SOCKTYPE = -7,
        /// system error returned in errno
        SYSTEM = -11,
        /// invalid value for hints
        BADHINTS = -12,
        /// resolved protocol is unknown
        PROTOCOL = -13,
        /// argument buffer overflow
        OVERFLOW = -14,
        _,
    },
    else => void,
}

Typedl_iterate_phdr_callback[src]

Source Code

Source code
pub const dl_iterate_phdr_callback = *const fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.c) c_int

TypeStat[src]

Functions

Functionatime[src]

pub fn atime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn atime(self: @This()) timespec {
    return self.atim;
}

Functionmtime[src]

pub fn mtime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn mtime(self: @This()) timespec {
    return self.mtim;
}

Functionctime[src]

pub fn ctime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn ctime(self: @This()) timespec {
    return self.ctim;
}

Functionatime[src]

pub fn atime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn atime(self: @This()) timespec {
    return self.atim;
}

Functionmtime[src]

pub fn mtime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn mtime(self: @This()) timespec {
    return self.mtim;
}

Functionctime[src]

pub fn ctime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn ctime(self: @This()) timespec {
    return self.ctim;
}

Functionatime[src]

pub fn atime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn atime(self: @This()) timespec {
    return self.atim;
}

Functionmtime[src]

pub fn mtime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn mtime(self: @This()) timespec {
    return self.mtim;
}

Functionctime[src]

pub fn ctime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn ctime(self: @This()) timespec {
    return self.ctim;
}

Functionatime[src]

pub fn atime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn atime(self: @This()) timespec {
    return self.atim;
}

Functionmtime[src]

pub fn mtime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn mtime(self: @This()) timespec {
    return self.mtim;
}

Functionctime[src]

pub fn ctime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn ctime(self: @This()) timespec {
    return self.ctim;
}

Functionatime[src]

pub fn atime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn atime(self: @This()) timespec {
    return self.atim;
}

Functionmtime[src]

pub fn mtime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn mtime(self: @This()) timespec {
    return self.mtim;
}

Functionctime[src]

pub fn ctime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn ctime(self: @This()) timespec {
    return self.ctim;
}

Functionatime[src]

pub fn atime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn atime(self: @This()) timespec {
    return self.atim;
}

Functionmtime[src]

pub fn mtime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn mtime(self: @This()) timespec {
    return self.mtim;
}

Functionctime[src]

pub fn ctime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn ctime(self: @This()) timespec {
    return self.ctim;
}

FunctionfromFilestat[src]

pub fn fromFilestat(st: wasi.filestat_t) Stat

Parameters

Source Code

Source code
pub fn fromFilestat(st: wasi.filestat_t) Stat {
    return .{
        .dev = st.dev,
        .ino = st.ino,
        .mode = switch (st.filetype) {
            .UNKNOWN => 0,
            .BLOCK_DEVICE => S.IFBLK,
            .CHARACTER_DEVICE => S.IFCHR,
            .DIRECTORY => S.IFDIR,
            .REGULAR_FILE => S.IFREG,
            .SOCKET_DGRAM => S.IFSOCK,
            .SOCKET_STREAM => S.IFIFO,
            .SYMBOLIC_LINK => S.IFLNK,
            _ => 0,
        },
        .nlink = st.nlink,
        .size = @intCast(st.size),
        .atim = timespec.fromTimestamp(st.atim),
        .mtim = timespec.fromTimestamp(st.mtim),
        .ctim = timespec.fromTimestamp(st.ctim),

        .uid = 0,
        .gid = 0,
        .rdev = 0,
        .blksize = 0,
        .blocks = 0,
    };
}

Functionatime[src]

pub fn atime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn atime(self: @This()) timespec {
    return self.atimespec;
}

Functionmtime[src]

pub fn mtime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn mtime(self: @This()) timespec {
    return self.mtimespec;
}

Functionctime[src]

pub fn ctime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn ctime(self: @This()) timespec {
    return self.ctimespec;
}

Functionbirthtime[src]

pub fn birthtime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn birthtime(self: @This()) timespec {
    return self.birthtimespec;
}

Functionatime[src]

pub fn atime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn atime(self: @This()) timespec {
    return self.atim;
}

Functionmtime[src]

pub fn mtime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn mtime(self: @This()) timespec {
    return self.mtim;
}

Functionctime[src]

pub fn ctime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn ctime(self: @This()) timespec {
    return self.ctim;
}

Functionatime[src]

pub fn atime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn atime(self: @This()) timespec {
    return self.atim;
}

Functionmtime[src]

pub fn mtime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn mtime(self: @This()) timespec {
    return self.mtim;
}

Functionctime[src]

pub fn ctime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn ctime(self: @This()) timespec {
    return self.ctim;
}

Functionbirthtime[src]

pub fn birthtime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn birthtime(self: @This()) timespec {
    return self.birthtim;
}

Functionatime[src]

pub fn atime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn atime(self: @This()) timespec {
    return self.atim;
}

Functionmtime[src]

pub fn mtime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn mtime(self: @This()) timespec {
    return self.mtim;
}

Functionctime[src]

pub fn ctime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn ctime(self: @This()) timespec {
    return self.ctim;
}

Functionatime[src]

pub fn atime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn atime(self: @This()) timespec {
    return self.atim;
}

Functionmtime[src]

pub fn mtime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn mtime(self: @This()) timespec {
    return self.mtim;
}

Functionctime[src]

pub fn ctime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn ctime(self: @This()) timespec {
    return self.ctim;
}

Functionbirthtime[src]

pub fn birthtime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn birthtime(self: @This()) timespec {
    return self.crtim;
}

Functionatime[src]

pub fn atime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn atime(self: @This()) timespec {
    return self.atim;
}

Functionmtime[src]

pub fn mtime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn mtime(self: @This()) timespec {
    return self.mtim;
}

Functionctime[src]

pub fn ctime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn ctime(self: @This()) timespec {
    return self.ctim;
}

Functionbirthtime[src]

pub fn birthtime(self: @This()) timespec

Parameters

self: @This()

Source Code

Source code
pub fn birthtime(self: @This()) timespec {
    return self.birthtim;
}

Source Code

Source code
pub const Stat = switch (native_os) {
    .linux => switch (native_arch) {
        .sparc64 => extern struct {
            dev: u64,
            __pad1: u16,
            ino: ino_t,
            mode: u32,
            nlink: u32,

            uid: u32,
            gid: u32,
            rdev: u64,
            __pad2: u16,

            size: off_t,
            blksize: isize,
            blocks: i64,

            atim: timespec,
            mtim: timespec,
            ctim: timespec,
            __reserved: [2]usize,

            pub fn atime(self: @This()) timespec {
                return self.atim;
            }

            pub fn mtime(self: @This()) timespec {
                return self.mtim;
            }

            pub fn ctime(self: @This()) timespec {
                return self.ctim;
            }
        },
        .mips, .mipsel => if (builtin.target.abi.isMusl()) extern struct {
            dev: dev_t,
            __pad0: [2]i32,
            ino: ino_t,
            mode: mode_t,
            nlink: nlink_t,
            uid: uid_t,
            gid: gid_t,
            rdev: dev_t,
            __pad1: [2]i32,
            size: off_t,
            atim: timespec,
            mtim: timespec,
            ctim: timespec,
            blksize: blksize_t,
            __pad3: i32,
            blocks: blkcnt_t,
            __pad4: [14]i32,

            pub fn atime(self: @This()) timespec {
                return self.atim;
            }

            pub fn mtime(self: @This()) timespec {
                return self.mtim;
            }

            pub fn ctime(self: @This()) timespec {
                return self.ctim;
            }
        } else extern struct {
            dev: u32,
            __pad0: [3]u32,
            ino: ino_t,
            mode: mode_t,
            nlink: nlink_t,
            uid: uid_t,
            gid: gid_t,
            rdev: u32,
            __pad1: [3]u32,
            size: off_t,
            atim: timespec,
            mtim: timespec,
            ctim: timespec,
            blksize: blksize_t,
            __pad3: u32,
            blocks: blkcnt_t,
            __pad4: [14]u32,

            pub fn atime(self: @This()) timespec {
                return self.atim;
            }

            pub fn mtime(self: @This()) timespec {
                return self.mtim;
            }

            pub fn ctime(self: @This()) timespec {
                return self.ctim;
            }
        },
        .mips64, .mips64el => if (builtin.target.abi.isMusl()) extern struct {
            dev: dev_t,
            __pad0: [3]i32,
            ino: ino_t,
            mode: mode_t,
            nlink: nlink_t,
            uid: uid_t,
            gid: gid_t,
            rdev: dev_t,
            __pad1: [2]u32,
            size: off_t,
            __pad2: i32,
            atim: timespec,
            mtim: timespec,
            ctim: timespec,
            blksize: blksize_t,
            __pad3: u32,
            blocks: blkcnt_t,
            __pad4: [14]i32,

            pub fn atime(self: @This()) timespec {
                return self.atim;
            }

            pub fn mtime(self: @This()) timespec {
                return self.mtim;
            }

            pub fn ctime(self: @This()) timespec {
                return self.ctim;
            }
        } else extern struct {
            dev: dev_t,
            __pad0: [3]u32,
            ino: ino_t,
            mode: mode_t,
            nlink: nlink_t,
            uid: uid_t,
            gid: gid_t,
            rdev: dev_t,
            __pad1: [3]u32,
            size: off_t,
            atim: timespec,
            mtim: timespec,
            ctim: timespec,
            blksize: blksize_t,
            __pad3: u32,
            blocks: blkcnt_t,
            __pad4: [14]i32,

            pub fn atime(self: @This()) timespec {
                return self.atim;
            }

            pub fn mtime(self: @This()) timespec {
                return self.mtim;
            }

            pub fn ctime(self: @This()) timespec {
                return self.ctim;
            }
        },

        else => std.os.linux.Stat, // libc stat is the same as kernel stat.
    },
    .emscripten => emscripten.Stat,
    .wasi => extern struct {
        // Match wasi-libc's `struct stat` in lib/libc/include/wasm-wasi-musl/__struct_stat.h
        dev: dev_t,
        ino: ino_t,
        nlink: nlink_t,
        mode: mode_t,
        uid: uid_t,
        gid: gid_t,
        __pad0: c_uint = 0,
        rdev: dev_t,
        size: off_t,
        blksize: blksize_t,
        blocks: blkcnt_t,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        __reserved: [3]c_longlong = [3]c_longlong{ 0, 0, 0 },

        pub fn atime(self: @This()) timespec {
            return self.atim;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }

        pub fn fromFilestat(st: wasi.filestat_t) Stat {
            return .{
                .dev = st.dev,
                .ino = st.ino,
                .mode = switch (st.filetype) {
                    .UNKNOWN => 0,
                    .BLOCK_DEVICE => S.IFBLK,
                    .CHARACTER_DEVICE => S.IFCHR,
                    .DIRECTORY => S.IFDIR,
                    .REGULAR_FILE => S.IFREG,
                    .SOCKET_DGRAM => S.IFSOCK,
                    .SOCKET_STREAM => S.IFIFO,
                    .SYMBOLIC_LINK => S.IFLNK,
                    _ => 0,
                },
                .nlink = st.nlink,
                .size = @intCast(st.size),
                .atim = timespec.fromTimestamp(st.atim),
                .mtim = timespec.fromTimestamp(st.mtim),
                .ctim = timespec.fromTimestamp(st.ctim),

                .uid = 0,
                .gid = 0,
                .rdev = 0,
                .blksize = 0,
                .blocks = 0,
            };
        }
    },
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        dev: i32,
        mode: u16,
        nlink: u16,
        ino: ino_t,
        uid: uid_t,
        gid: gid_t,
        rdev: i32,
        atimespec: timespec,
        mtimespec: timespec,
        ctimespec: timespec,
        birthtimespec: timespec,
        size: off_t,
        blocks: i64,
        blksize: i32,
        flags: u32,
        gen: u32,
        lspare: i32,
        qspare: [2]i64,

        pub fn atime(self: @This()) timespec {
            return self.atimespec;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtimespec;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctimespec;
        }

        pub fn birthtime(self: @This()) timespec {
            return self.birthtimespec;
        }
    },
    .freebsd => freebsd.Stat,
    .solaris, .illumos => extern struct {
        dev: dev_t,
        ino: ino_t,
        mode: mode_t,
        nlink: nlink_t,
        uid: uid_t,
        gid: gid_t,
        rdev: dev_t,
        size: off_t,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        blksize: blksize_t,
        blocks: blkcnt_t,
        fstype: [16]u8,

        pub fn atime(self: @This()) timespec {
            return self.atim;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }
    },
    .netbsd => extern struct {
        dev: dev_t,
        mode: mode_t,
        ino: ino_t,
        nlink: nlink_t,
        uid: uid_t,
        gid: gid_t,
        rdev: dev_t,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        birthtim: timespec,
        size: off_t,
        blocks: blkcnt_t,
        blksize: blksize_t,
        flags: u32,
        gen: u32,
        __spare: [2]u32,

        pub fn atime(self: @This()) timespec {
            return self.atim;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }

        pub fn birthtime(self: @This()) timespec {
            return self.birthtim;
        }
    },
    .dragonfly => extern struct {
        ino: ino_t,
        nlink: c_uint,
        dev: c_uint,
        mode: c_ushort,
        padding1: u16,
        uid: uid_t,
        gid: gid_t,
        rdev: c_uint,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        size: c_ulong,
        blocks: i64,
        blksize: u32,
        flags: u32,
        gen: u32,
        lspare: i32,
        qspare1: i64,
        qspare2: i64,
        pub fn atime(self: @This()) timespec {
            return self.atim;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }
    },
    .haiku => extern struct {
        dev: dev_t,
        ino: ino_t,
        mode: mode_t,
        nlink: nlink_t,
        uid: uid_t,
        gid: gid_t,
        size: off_t,
        rdev: dev_t,
        blksize: blksize_t,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        crtim: timespec,
        type: u32,
        blocks: blkcnt_t,

        pub fn atime(self: @This()) timespec {
            return self.atim;
        }
        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }
        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }
        pub fn birthtime(self: @This()) timespec {
            return self.crtim;
        }
    },
    .openbsd => extern struct {
        mode: mode_t,
        dev: dev_t,
        ino: ino_t,
        nlink: nlink_t,
        uid: uid_t,
        gid: gid_t,
        rdev: dev_t,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        size: off_t,
        blocks: blkcnt_t,
        blksize: blksize_t,
        flags: u32,
        gen: u32,
        birthtim: timespec,

        pub fn atime(self: @This()) timespec {
            return self.atim;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }

        pub fn birthtime(self: @This()) timespec {
            return self.birthtim;
        }
    },
    else => void,
}

Typepthread_mutex_t[src]

Source Code

Source code
pub const pthread_mutex_t = switch (native_os) {
    .linux => extern struct {
        data: [data_len]u8 align(@alignOf(usize)) = [_]u8{0} ** data_len,

        const data_len = switch (native_abi) {
            .musl, .musleabi, .musleabihf => if (@sizeOf(usize) == 8) 40 else 24,
            .gnu, .gnuabin32, .gnuabi64, .gnueabi, .gnueabihf, .gnux32 => switch (native_arch) {
                .aarch64 => 48,
                .x86_64 => if (native_abi == .gnux32) 32 else 40,
                .mips64, .powerpc64, .powerpc64le, .sparc64 => 40,
                else => if (@sizeOf(usize) == 8) 40 else 24,
            },
            .android, .androideabi => if (@sizeOf(usize) == 8) 40 else 4,
            else => @compileError("unsupported ABI"),
        };
    },
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        sig: c_long = 0x32AAABA7,
        data: [data_len]u8 = [_]u8{0} ** data_len,

        const data_len = if (@sizeOf(usize) == 8) 56 else 40;
    },
    .freebsd, .dragonfly, .openbsd => extern struct {
        inner: ?*anyopaque = null,
    },
    .hermit => extern struct {
        ptr: usize = maxInt(usize),
    },
    .netbsd => extern struct {
        magic: u32 = 0x33330003,
        errorcheck: padded_pthread_spin_t = 0,
        ceiling: padded_pthread_spin_t = 0,
        owner: usize = 0,
        waiters: ?*u8 = null,
        recursed: u32 = 0,
        spare2: ?*anyopaque = null,
    },
    .haiku => extern struct {
        flags: u32 = 0,
        lock: i32 = 0,
        unused: i32 = -42,
        owner: i32 = -1,
        owner_count: i32 = 0,
    },
    .solaris, .illumos => extern struct {
        flag1: u16 = 0,
        flag2: u8 = 0,
        ceiling: u8 = 0,
        type: u16 = 0,
        magic: u16 = 0x4d58,
        lock: u64 = 0,
        data: u64 = 0,
    },
    .fuchsia => extern struct {
        data: [40]u8 align(@alignOf(usize)) = [_]u8{0} ** 40,
    },
    .emscripten => extern struct {
        data: [24]u8 align(4) = [_]u8{0} ** 24,
    },
    else => void,
}

Typepthread_cond_t[src]

Source Code

Source code
pub const pthread_cond_t = switch (native_os) {
    .linux => extern struct {
        data: [48]u8 align(@alignOf(usize)) = [_]u8{0} ** 48,
    },
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        sig: c_long = 0x3CB0B1BB,
        data: [data_len]u8 = [_]u8{0} ** data_len,
        const data_len = if (@sizeOf(usize) == 8) 40 else 24;
    },
    .freebsd, .dragonfly, .openbsd => extern struct {
        inner: ?*anyopaque = null,
    },
    .hermit => extern struct {
        ptr: usize = maxInt(usize),
    },
    .netbsd => extern struct {
        magic: u32 = 0x55550005,
        lock: pthread_spin_t = 0,
        waiters_first: ?*u8 = null,
        waiters_last: ?*u8 = null,
        mutex: ?*pthread_mutex_t = null,
        private: ?*anyopaque = null,
    },
    .haiku => extern struct {
        flags: u32 = 0,
        unused: i32 = -42,
        mutex: ?*anyopaque = null,
        waiter_count: i32 = 0,
        lock: i32 = 0,
    },
    .solaris, .illumos => extern struct {
        flag: [4]u8 = [_]u8{0} ** 4,
        type: u16 = 0,
        magic: u16 = 0x4356,
        data: u64 = 0,
    },
    .fuchsia, .emscripten => extern struct {
        data: [48]u8 align(@alignOf(usize)) = [_]u8{0} ** 48,
    },
    else => void,
}

Typepthread_rwlock_t[src]

Source Code

Source code
pub const pthread_rwlock_t = switch (native_os) {
    .linux => switch (native_abi) {
        .android, .androideabi => switch (@sizeOf(usize)) {
            4 => extern struct {
                data: [40]u8 align(@alignOf(usize)) = [_]u8{0} ** 40,
            },
            8 => extern struct {
                data: [56]u8 align(@alignOf(usize)) = [_]u8{0} ** 56,
            },
            else => @compileError("impossible pointer size"),
        },
        else => extern struct {
            data: [56]u8 align(@alignOf(usize)) = [_]u8{0} ** 56,
        },
    },
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        sig: c_long = 0x2DA8B3B4,
        data: [192]u8 = [_]u8{0} ** 192,
    },
    .freebsd, .dragonfly, .openbsd => extern struct {
        ptr: ?*anyopaque = null,
    },
    .hermit => extern struct {
        ptr: usize = maxInt(usize),
    },
    .netbsd => extern struct {
        magic: c_uint = 0x99990009,
        interlock: switch (builtin.cpu.arch) {
            .aarch64, .sparc, .x86_64, .x86 => u8,
            .arm, .powerpc => c_int,
            else => unreachable,
        } = 0,
        rblocked_first: ?*u8 = null,
        rblocked_last: ?*u8 = null,
        wblocked_first: ?*u8 = null,
        wblocked_last: ?*u8 = null,
        nreaders: c_uint = 0,
        owner: ?pthread_t = null,
        private: ?*anyopaque = null,
    },
    .solaris, .illumos => extern struct {
        readers: i32 = 0,
        type: u16 = 0,
        magic: u16 = 0x5257,
        mutex: pthread_mutex_t = .{},
        readercv: pthread_cond_t = .{},
        writercv: pthread_cond_t = .{},
    },
    .fuchsia => extern struct {
        size: [56]u8 align(@alignOf(usize)) = [_]u8{0} ** 56,
    },
    .emscripten => extern struct {
        size: [32]u8 align(4) = [_]u8{0} ** 32,
    },
    else => void,
}

Typepthread_attr_t[src]

Source Code

Source code
pub const pthread_attr_t = switch (native_os) {
    .linux, .emscripten, .dragonfly => extern struct {
        __size: [56]u8,
        __align: c_long,
    },
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        __sig: c_long,
        __opaque: [56]u8,
    },
    .freebsd => extern struct {
        inner: ?*anyopaque = null,
    },
    .solaris, .illumos => extern struct {
        mutexattr: ?*anyopaque = null,
    },
    .netbsd => extern struct {
        magic: u32,
        flags: i32,
        private: ?*anyopaque,
    },
    .haiku => extern struct {
        detach_state: i32,
        sched_priority: i32,
        stack_size: i32,
        guard_size: i32,
        stack_address: ?*anyopaque,
    },
    .openbsd => extern struct {
        inner: ?*anyopaque = null,
    },
    else => void,
}

Typepthread_key_t[src]

Source Code

Source code
pub const pthread_key_t = switch (native_os) {
    .linux, .emscripten => c_uint,
    .macos, .ios, .tvos, .watchos, .visionos => c_ulong,
    .openbsd, .solaris, .illumos => c_int,
    else => void,
}

Typepadded_pthread_spin_t[src]

Source Code

Source code
pub const padded_pthread_spin_t = switch (native_os) {
    .netbsd => switch (builtin.cpu.arch) {
        .x86, .x86_64 => u32,
        .sparc, .sparc64 => u32,
        else => pthread_spin_t,
    },
    else => void,
}

Typepthread_spin_t[src]

Source Code

Source code
pub const pthread_spin_t = switch (native_os) {
    .netbsd => switch (builtin.cpu.arch) {
        .aarch64, .aarch64_be => u8,
        .mips, .mipsel, .mips64, .mips64el => u32,
        .powerpc, .powerpc64, .powerpc64le => i32,
        .x86, .x86_64 => u8,
        .arm, .armeb, .thumb, .thumbeb => i32,
        .sparc, .sparc64 => u8,
        .riscv32, .riscv64 => u32,
        else => @compileError("undefined pthread_spin_t for this arch"),
    },
    else => void,
}

Typesem_t[src]

Source Code

Source code
pub const sem_t = switch (native_os) {
    .linux, .emscripten => extern struct {
        __size: [4 * @sizeOf(usize)]u8 align(@alignOf(usize)),
    },
    .macos, .ios, .tvos, .watchos, .visionos => c_int,
    .freebsd => extern struct {
        _magic: u32,
        _kern: extern struct {
            _count: u32,
            _flags: u32,
        },
        _padding: u32,
    },
    .solaris, .illumos => extern struct {
        count: u32 = 0,
        type: u16 = 0,
        magic: u16 = 0x534d,
        __pad1: [3]u64 = [_]u64{0} ** 3,
        __pad2: [2]u64 = [_]u64{0} ** 2,
    },
    .openbsd, .netbsd, .dragonfly => ?*opaque {},
    .haiku => extern struct {
        type: i32,
        u: extern union {
            named_sem_id: i32,
            unnamed_sem: i32,
        },
        padding: [2]i32,
    },
    else => void,
}

TypeKevent[src]

Renamed from kevent to Kevent to avoid conflict with function name.

Source Code

Source code
pub const Kevent = switch (native_os) {
    .netbsd => extern struct {
        ident: usize,
        filter: i32,
        flags: u32,
        fflags: u32,
        data: i64,
        udata: usize,
    },
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        ident: usize,
        filter: i16,
        flags: u16,
        fflags: u32,
        data: isize,
        udata: usize,

        // sys/types.h on macos uses #pragma pack(4) so these checks are
        // to make sure the struct is laid out the same. These values were
        // produced from C code using the offsetof macro.
        comptime {
            assert(@offsetOf(@This(), "ident") == 0);
            assert(@offsetOf(@This(), "filter") == 8);
            assert(@offsetOf(@This(), "flags") == 10);
            assert(@offsetOf(@This(), "fflags") == 12);
            assert(@offsetOf(@This(), "data") == 16);
            assert(@offsetOf(@This(), "udata") == 24);
        }
    },
    .freebsd => extern struct {
        /// Identifier for this event.
        ident: usize,
        /// Filter for event.
        filter: i16,
        /// Action flags for kqueue.
        flags: u16,
        /// Filter flag value.
        fflags: u32,
        /// Filter data value.
        data: i64,
        /// Opaque user data identifier.
        udata: usize,
        /// Future extensions.
        _ext: [4]u64 = [_]u64{0} ** 4,
    },
    .dragonfly => extern struct {
        ident: usize,
        filter: c_short,
        flags: c_ushort,
        fflags: c_uint,
        data: isize,
        udata: usize,
    },
    .openbsd => extern struct {
        ident: usize,
        filter: c_short,
        flags: u16,
        fflags: c_uint,
        data: i64,
        udata: usize,
    },
    else => void,
}

Typeport_t[src]

Source Code

Source code
pub const port_t = switch (native_os) {
    .solaris, .illumos => c_int,
    else => void,
}

Typeport_event[src]

Source Code

Source code
pub const port_event = switch (native_os) {
    .solaris, .illumos => extern struct {
        events: u32,
        /// Event source.
        source: u16,
        __pad: u16,
        /// Source-specific object.
        object: ?*anyopaque,
        /// User cookie.
        cookie: ?*anyopaque,
    },
    else => void,
}

TypeAT[src]

Values

ConstantREMOVEDIR[src]

Remove directory instead of unlinking file

Source Code

Source code
pub const REMOVEDIR = 0x200

ConstantFDCWD[src]

Source Code

Source code
pub const FDCWD = -2

ConstantEACCESS[src]

Use effective ids in access check

Source Code

Source code
pub const EACCESS = 0x0010

Act on the symlink itself not the target

Source code
pub const SYMLINK_NOFOLLOW = 0x0020

Act on target of symlink

Source code
pub const SYMLINK_FOLLOW = 0x0040

ConstantREMOVEDIR[src]

Path refers to directory

Source Code

Source code
pub const REMOVEDIR = 0x0080

ConstantFDCWD[src]

Magic value that specify the use of the current working directory to determine the target of relative file paths in the openat() and similar syscalls.

Source Code

Source code
pub const FDCWD = -100

ConstantEACCESS[src]

Check access using effective user and group ID

Source Code

Source code
pub const EACCESS = 0x0100

Do not follow symbolic links

Source code
pub const SYMLINK_NOFOLLOW = 0x0200

Follow symbolic link

Source code
pub const SYMLINK_FOLLOW = 0x0400

ConstantREMOVEDIR[src]

Remove directory instead of file

Source Code

Source code
pub const REMOVEDIR = 0x0800

ConstantBENEATH[src]

Fail if not under dirfd

Source Code

Source code
pub const BENEATH = 0x1000

ConstantFDCWD[src]

Magic value that specify the use of the current working directory to determine the target of relative file paths in the openat() and similar syscalls.

Source Code

Source code
pub const FDCWD = -100

ConstantEACCESS[src]

Check access using effective user and group ID

Source Code

Source code
pub const EACCESS = 0x0100

Do not follow symbolic links

Source code
pub const SYMLINK_NOFOLLOW = 0x0200

Follow symbolic link

Source code
pub const SYMLINK_FOLLOW = 0x0400

ConstantREMOVEDIR[src]

Remove directory instead of file

Source Code

Source code
pub const REMOVEDIR = 0x0800

ConstantFDCWD[src]

Source Code

Source code
pub const FDCWD = -328243
Source code
pub const SYMLINK_NOFOLLOW = 1

ConstantREMOVEDIR[src]

Source Code

Source code
pub const REMOVEDIR = 2

ConstantEACCESS[src]

Source Code

Source code
pub const EACCESS = 4
Source code
pub const SYMLINK_FOLLOW = 8

ConstantFDCWD[src]

Magic value that specify the use of the current working directory to determine the target of relative file paths in the openat() and similar syscalls.

Source Code

Source code
pub const FDCWD = -100

ConstantEACCESS[src]

Check access using effective user and group ID

Source Code

Source code
pub const EACCESS = 0x01

Do not follow symbolic links

Source code
pub const SYMLINK_NOFOLLOW = 0x02

Follow symbolic link

Source code
pub const SYMLINK_FOLLOW = 0x04

ConstantREMOVEDIR[src]

Remove directory instead of file

Source Code

Source code
pub const REMOVEDIR = 0x08

ConstantFDCWD[src]

Source Code

Source code
pub const FDCWD = -1
Source code
pub const SYMLINK_NOFOLLOW = 0x01
Source code
pub const SYMLINK_FOLLOW = 0x02

ConstantREMOVEDIR[src]

Source Code

Source code
pub const REMOVEDIR = 0x04

ConstantEACCESS[src]

Source Code

Source code
pub const EACCESS = 0x08

ConstantFDCWD[src]

Magic value that specify the use of the current working directory to determine the target of relative file paths in the openat() and similar syscalls.

Source Code

Source code
pub const FDCWD: fd_t = @bitCast(@as(u32, 0xffd19553))

Do not follow symbolic links

Source code
pub const SYMLINK_NOFOLLOW = 0x1000

Follow symbolic link

Source code
pub const SYMLINK_FOLLOW = 0x2000

ConstantREMOVEDIR[src]

Remove directory instead of file

Source Code

Source code
pub const REMOVEDIR = 0x1

ConstantTRIGGER[src]

Source Code

Source code
pub const TRIGGER = 0x2

ConstantEACCESS[src]

Check access using effective user and group ID

Source Code

Source code
pub const EACCESS = 0x4

ConstantFDCWD[src]

Source Code

Source code
pub const FDCWD = -100
Source code
pub const SYMLINK_NOFOLLOW = 0x100

ConstantREMOVEDIR[src]

Source Code

Source code
pub const REMOVEDIR = 0x200
Source code
pub const SYMLINK_FOLLOW = 0x400

ConstantNO_AUTOMOUNT[src]

Source Code

Source code
pub const NO_AUTOMOUNT = 0x800

ConstantEMPTY_PATH[src]

Source Code

Source code
pub const EMPTY_PATH = 0x1000

ConstantSTATX_SYNC_TYPE[src]

Source Code

Source code
pub const STATX_SYNC_TYPE = 0x6000

ConstantSTATX_SYNC_AS_STAT[src]

Source Code

Source code
pub const STATX_SYNC_AS_STAT = 0x0000

ConstantSTATX_FORCE_SYNC[src]

Source Code

Source code
pub const STATX_FORCE_SYNC = 0x2000

ConstantSTATX_DONT_SYNC[src]

Source Code

Source code
pub const STATX_DONT_SYNC = 0x4000

ConstantRECURSIVE[src]

Source Code

Source code
pub const RECURSIVE = 0x8000

ConstantEACCESS[src]

Source Code

Source code
pub const EACCESS = 0x0
Source code
pub const SYMLINK_NOFOLLOW = 0x1
Source code
pub const SYMLINK_FOLLOW = 0x2

ConstantREMOVEDIR[src]

Source Code

Source code
pub const REMOVEDIR = 0x4

ConstantFDCWD[src]

When linking libc, we follow their convention and use -2 for current working directory. However, without libc, Zig does a different convention: it assumes the current working directory is the first preopen. This behavior can be overridden with a public function called wasi_cwd in the root source file.

Source Code

Source code
pub const FDCWD: fd_t = if (builtin.link_libc) -2 else 3

Source Code

Source code
pub const AT = switch (native_os) {
    .linux => linux.AT,
    .windows => struct {
        /// Remove directory instead of unlinking file
        pub const REMOVEDIR = 0x200;
    },
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const FDCWD = -2;
        /// Use effective ids in access check
        pub const EACCESS = 0x0010;
        /// Act on the symlink itself not the target
        pub const SYMLINK_NOFOLLOW = 0x0020;
        /// Act on target of symlink
        pub const SYMLINK_FOLLOW = 0x0040;
        /// Path refers to directory
        pub const REMOVEDIR = 0x0080;
    },
    .freebsd => struct {
        /// Magic value that specify the use of the current working directory
        /// to determine the target of relative file paths in the openat() and
        /// similar syscalls.
        pub const FDCWD = -100;
        /// Check access using effective user and group ID
        pub const EACCESS = 0x0100;
        /// Do not follow symbolic links
        pub const SYMLINK_NOFOLLOW = 0x0200;
        /// Follow symbolic link
        pub const SYMLINK_FOLLOW = 0x0400;
        /// Remove directory instead of file
        pub const REMOVEDIR = 0x0800;
        /// Fail if not under dirfd
        pub const BENEATH = 0x1000;
    },
    .netbsd => struct {
        /// Magic value that specify the use of the current working directory
        /// to determine the target of relative file paths in the openat() and
        /// similar syscalls.
        pub const FDCWD = -100;
        /// Check access using effective user and group ID
        pub const EACCESS = 0x0100;
        /// Do not follow symbolic links
        pub const SYMLINK_NOFOLLOW = 0x0200;
        /// Follow symbolic link
        pub const SYMLINK_FOLLOW = 0x0400;
        /// Remove directory instead of file
        pub const REMOVEDIR = 0x0800;
    },
    .dragonfly => struct {
        pub const FDCWD = -328243;
        pub const SYMLINK_NOFOLLOW = 1;
        pub const REMOVEDIR = 2;
        pub const EACCESS = 4;
        pub const SYMLINK_FOLLOW = 8;
    },
    .openbsd => struct {
        /// Magic value that specify the use of the current working directory
        /// to determine the target of relative file paths in the openat() and
        /// similar syscalls.
        pub const FDCWD = -100;
        /// Check access using effective user and group ID
        pub const EACCESS = 0x01;
        /// Do not follow symbolic links
        pub const SYMLINK_NOFOLLOW = 0x02;
        /// Follow symbolic link
        pub const SYMLINK_FOLLOW = 0x04;
        /// Remove directory instead of file
        pub const REMOVEDIR = 0x08;
    },
    .haiku => struct {
        pub const FDCWD = -1;
        pub const SYMLINK_NOFOLLOW = 0x01;
        pub const SYMLINK_FOLLOW = 0x02;
        pub const REMOVEDIR = 0x04;
        pub const EACCESS = 0x08;
    },
    .solaris, .illumos => struct {
        /// Magic value that specify the use of the current working directory
        /// to determine the target of relative file paths in the openat() and
        /// similar syscalls.
        pub const FDCWD: fd_t = @bitCast(@as(u32, 0xffd19553));
        /// Do not follow symbolic links
        pub const SYMLINK_NOFOLLOW = 0x1000;
        /// Follow symbolic link
        pub const SYMLINK_FOLLOW = 0x2000;
        /// Remove directory instead of file
        pub const REMOVEDIR = 0x1;
        pub const TRIGGER = 0x2;
        /// Check access using effective user and group ID
        pub const EACCESS = 0x4;
    },
    .emscripten => struct {
        pub const FDCWD = -100;
        pub const SYMLINK_NOFOLLOW = 0x100;
        pub const REMOVEDIR = 0x200;
        pub const SYMLINK_FOLLOW = 0x400;
        pub const NO_AUTOMOUNT = 0x800;
        pub const EMPTY_PATH = 0x1000;
        pub const STATX_SYNC_TYPE = 0x6000;
        pub const STATX_SYNC_AS_STAT = 0x0000;
        pub const STATX_FORCE_SYNC = 0x2000;
        pub const STATX_DONT_SYNC = 0x4000;
        pub const RECURSIVE = 0x8000;
    },
    .wasi => struct {
        // Match `AT_*` constants in lib/libc/include/wasm-wasi-musl/__header_fcntl.h
        pub const EACCESS = 0x0;
        pub const SYMLINK_NOFOLLOW = 0x1;
        pub const SYMLINK_FOLLOW = 0x2;
        pub const REMOVEDIR = 0x4;
        /// When linking libc, we follow their convention and use -2 for current working directory.
        /// However, without libc, Zig does a different convention: it assumes the
        /// current working directory is the first preopen. This behavior can be
        /// overridden with a public function called `wasi_cwd` in the root source
        /// file.
        pub const FDCWD: fd_t = if (builtin.link_libc) -2 else 3;
    },
    else => void,
}

TypeO[src]

Source Code

Source code
pub const O = switch (native_os) {
    .linux => linux.O,
    .emscripten => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        _2: u4 = 0,
        CREAT: bool = false,
        EXCL: bool = false,
        NOCTTY: bool = false,
        TRUNC: bool = false,
        APPEND: bool = false,
        NONBLOCK: bool = false,
        DSYNC: bool = false,
        ASYNC: bool = false,
        DIRECT: bool = false,
        LARGEFILE: bool = false,
        DIRECTORY: bool = false,
        NOFOLLOW: bool = false,
        NOATIME: bool = false,
        CLOEXEC: bool = false,
        SYNC: bool = false,
        PATH: bool = false,
        TMPFILE: bool = false,
        _: u9 = 0,
    },
    .wasi => packed struct(u32) {
        // Match `O_*` bits from lib/libc/include/wasm-wasi-musl/__header_fcntl.h
        APPEND: bool = false,
        DSYNC: bool = false,
        NONBLOCK: bool = false,
        RSYNC: bool = false,
        SYNC: bool = false,
        _5: u7 = 0,
        CREAT: bool = false,
        DIRECTORY: bool = false,
        EXCL: bool = false,
        TRUNC: bool = false,
        _16: u8 = 0,
        NOFOLLOW: bool = false,
        EXEC: bool = false,
        read: bool = false,
        SEARCH: bool = false,
        write: bool = false,
        // O_CLOEXEC, O_TTY_ININT, O_NOCTTY are 0 in wasi-musl, so they're silently
        // ignored in C code.  Thus no mapping in Zig.
        _: u3 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NDELAY: bool = false,
        APPEND: bool = false,
        SYNC: bool = false,
        _5: u1 = 0,
        DSYNC: bool = false,
        NONBLOCK: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        NOCTTY: bool = false,
        _12: u1 = 0,
        LARGEFILE: bool = false,
        XATTR: bool = false,
        RSYNC: bool = false,
        _16: u1 = 0,
        NOFOLLOW: bool = false,
        NOLINKS: bool = false,
        _19: u2 = 0,
        SEARCH: bool = false,
        EXEC: bool = false,
        CLOEXEC: bool = false,
        DIRECTORY: bool = false,
        DIRECT: bool = false,
        _: u6 = 0,
    },
    .netbsd => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NONBLOCK: bool = false,
        APPEND: bool = false,
        SHLOCK: bool = false,
        EXLOCK: bool = false,
        ASYNC: bool = false,
        SYNC: bool = false,
        NOFOLLOW: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        _12: u3 = 0,
        NOCTTY: bool = false,
        DSYNC: bool = false,
        RSYNC: bool = false,
        ALT_IO: bool = false,
        DIRECT: bool = false,
        _20: u1 = 0,
        DIRECTORY: bool = false,
        CLOEXEC: bool = false,
        SEARCH: bool = false,
        _: u8 = 0,
    },
    .openbsd => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NONBLOCK: bool = false,
        APPEND: bool = false,
        SHLOCK: bool = false,
        EXLOCK: bool = false,
        ASYNC: bool = false,
        SYNC: bool = false,
        NOFOLLOW: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        _12: u3 = 0,
        NOCTTY: bool = false,
        CLOEXEC: bool = false,
        DIRECTORY: bool = false,
        _: u14 = 0,
    },
    .haiku => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        _2: u4 = 0,
        CLOEXEC: bool = false,
        NONBLOCK: bool = false,
        EXCL: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        APPEND: bool = false,
        NOCTTY: bool = false,
        NOTRAVERSE: bool = false,
        _14: u2 = 0,
        SYNC: bool = false,
        RSYNC: bool = false,
        DSYNC: bool = false,
        NOFOLLOW: bool = false,
        DIRECT: bool = false,
        DIRECTORY: bool = false,
        _: u10 = 0,
    },
    .macos, .ios, .tvos, .watchos, .visionos => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NONBLOCK: bool = false,
        APPEND: bool = false,
        SHLOCK: bool = false,
        EXLOCK: bool = false,
        ASYNC: bool = false,
        SYNC: bool = false,
        NOFOLLOW: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        _12: u3 = 0,
        EVTONLY: bool = false,
        _16: u1 = 0,
        NOCTTY: bool = false,
        _18: u2 = 0,
        DIRECTORY: bool = false,
        SYMLINK: bool = false,
        DSYNC: bool = false,
        _23: u1 = 0,
        CLOEXEC: bool = false,
        _25: u4 = 0,
        ALERT: bool = false,
        _30: u1 = 0,
        POPUP: bool = false,
    },
    .dragonfly => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NONBLOCK: bool = false,
        APPEND: bool = false,
        SHLOCK: bool = false,
        EXLOCK: bool = false,
        ASYNC: bool = false,
        SYNC: bool = false,
        NOFOLLOW: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        _12: u3 = 0,
        NOCTTY: bool = false,
        DIRECT: bool = false,
        CLOEXEC: bool = false,
        FBLOCKING: bool = false,
        FNONBLOCKING: bool = false,
        FAPPEND: bool = false,
        FOFFSET: bool = false,
        FSYNCWRITE: bool = false,
        FASYNCWRITE: bool = false,
        _24: u3 = 0,
        DIRECTORY: bool = false,
        _: u4 = 0,
    },
    .freebsd => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NONBLOCK: bool = false,
        APPEND: bool = false,
        SHLOCK: bool = false,
        EXLOCK: bool = false,
        ASYNC: bool = false,
        SYNC: bool = false,
        NOFOLLOW: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        DSYNC: bool = false,
        _13: u2 = 0,
        NOCTTY: bool = false,
        DIRECT: bool = false,
        DIRECTORY: bool = false,
        NOATIME: bool = false,
        _19: u1 = 0,
        CLOEXEC: bool = false,
        PATH: bool = false,
        TMPFILE: bool = false,
        _: u9 = 0,
    },
    else => void,
}

TypeMAP[src]

Source Code

Source code
pub const MAP = switch (native_os) {
    .linux => linux.MAP,
    .emscripten => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
            SHARED_VALIDATE = 0x03,
        },
        FIXED: bool = false,
        ANONYMOUS: bool = false,
        _6: u2 = 0,
        GROWSDOWN: bool = false,
        _9: u2 = 0,
        DENYWRITE: bool = false,
        EXECUTABLE: bool = false,
        LOCKED: bool = false,
        NORESERVE: bool = false,
        POPULATE: bool = false,
        NONBLOCK: bool = false,
        STACK: bool = false,
        HUGETLB: bool = false,
        SYNC: bool = false,
        FIXED_NOREPLACE: bool = false,
        _: u11 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        RENAME: bool = false,
        NORESERVE: bool = false,
        @"32BIT": bool = false,
        ANONYMOUS: bool = false,
        ALIGN: bool = false,
        TEXT: bool = false,
        INITDATA: bool = false,
        _: u20 = 0,
    },
    .netbsd => packed struct(u32) {
        TYPE: enum(u2) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        REMAPDUP: bool = false,
        _3: u1 = 0,
        FIXED: bool = false,
        RENAME: bool = false,
        NORESERVE: bool = false,
        INHERIT: bool = false,
        _8: u1 = 0,
        HASSEMAPHORE: bool = false,
        TRYFIXED: bool = false,
        WIRED: bool = false,
        ANONYMOUS: bool = false,
        STACK: bool = false,
        _: u18 = 0,
    },
    .openbsd => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        _5: u7 = 0,
        ANONYMOUS: bool = false,
        _13: u1 = 0,
        STACK: bool = false,
        CONCEAL: bool = false,
        _: u16 = 0,
    },
    .haiku => packed struct(u32) {
        TYPE: enum(u2) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        ANONYMOUS: bool = false,
        NORESERVE: bool = false,
        _: u27 = 0,
    },
    .macos, .ios, .tvos, .watchos, .visionos => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        _5: u1 = 0,
        NORESERVE: bool = false,
        _7: u2 = 0,
        HASSEMAPHORE: bool = false,
        NOCACHE: bool = false,
        JIT: bool = false,
        ANONYMOUS: bool = false,
        _: u19 = 0,
    },
    .dragonfly => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        RENAME: bool = false,
        NORESERVE: bool = false,
        INHERIT: bool = false,
        NOEXTEND: bool = false,
        HASSEMAPHORE: bool = false,
        STACK: bool = false,
        NOSYNC: bool = false,
        ANONYMOUS: bool = false,
        VPAGETABLE: bool = false,
        _14: u2 = 0,
        TRYFIXED: bool = false,
        NOCORE: bool = false,
        SIZEALIGN: bool = false,
        _: u13 = 0,
    },
    .freebsd => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        _5: u5 = 0,
        STACK: bool = false,
        NOSYNC: bool = false,
        ANONYMOUS: bool = false,
        GUARD: bool = false,
        EXCL: bool = false,
        _15: u2 = 0,
        NOCORE: bool = false,
        PREFAULT_READ: bool = false,
        @"32BIT": bool = false,
        _: u12 = 0,
    },
    else => void,
}

TypeMREMAP[src]

Source Code

Source code
pub const MREMAP = switch (native_os) {
    .linux => linux.MREMAP,
    else => void,
}

Typecc_t[src]

Source Code

Source code
pub const cc_t = u8

TypeV[src]

Indices into the cc array in the termios struct.

Source Code

Source code
pub const V = switch (native_os) {
    .linux => linux.V,
    .macos, .ios, .tvos, .watchos, .visionos, .netbsd, .openbsd => enum {
        EOF,
        EOL,
        EOL2,
        ERASE,
        WERASE,
        KILL,
        REPRINT,
        reserved,
        INTR,
        QUIT,
        SUSP,
        DSUSP,
        START,
        STOP,
        LNEXT,
        DISCARD,
        MIN,
        TIME,
        STATUS,
    },
    .freebsd => enum {
        EOF,
        EOL,
        EOL2,
        ERASE,
        WERASE,
        KILL,
        REPRINT,
        ERASE2,
        INTR,
        QUIT,
        SUSP,
        DSUSP,
        START,
        STOP,
        LNEXT,
        DISCARD,
        MIN,
        TIME,
        STATUS,
    },
    .haiku => enum {
        INTR,
        QUIT,
        ERASE,
        KILL,
        EOF,
        EOL,
        EOL2,
        SWTCH,
        START,
        STOP,
        SUSP,
    },
    .solaris, .illumos => enum {
        INTR,
        QUIT,
        ERASE,
        KILL,
        EOF,
        EOL,
        EOL2,
        SWTCH,
        START,
        STOP,
        SUSP,
        DSUSP,
        REPRINT,
        DISCARD,
        WERASE,
        LNEXT,
        STATUS,
        ERASE2,
    },
    .emscripten, .wasi => enum {
        INTR,
        QUIT,
        ERASE,
        KILL,
        EOF,
        TIME,
        MIN,
        SWTC,
        START,
        STOP,
        SUSP,
        EOL,
        REPRINT,
        DISCARD,
        WERASE,
        LNEXT,
        EOL2,
    },
    else => void,
}

TypeNCCS[src]

Source Code

Source code
pub const NCCS = switch (native_os) {
    .linux => linux.NCCS,
    .macos, .ios, .tvos, .watchos, .visionos, .freebsd, .netbsd, .openbsd, .dragonfly => 20,
    .haiku => 11,
    .solaris, .illumos => 19,
    .emscripten, .wasi => 32,
    else => void,
}

Typetermios[src]

Source Code

Source code
pub const termios = switch (native_os) {
    .linux => linux.termios,
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        iflag: tc_iflag_t,
        oflag: tc_oflag_t,
        cflag: tc_cflag_t,
        lflag: tc_lflag_t,
        cc: [NCCS]cc_t,
        ispeed: speed_t align(8),
        ospeed: speed_t,
    },
    .freebsd, .netbsd, .dragonfly, .openbsd => extern struct {
        iflag: tc_iflag_t,
        oflag: tc_oflag_t,
        cflag: tc_cflag_t,
        lflag: tc_lflag_t,
        cc: [NCCS]cc_t,
        ispeed: speed_t,
        ospeed: speed_t,
    },
    .haiku => extern struct {
        iflag: tc_iflag_t,
        oflag: tc_oflag_t,
        cflag: tc_cflag_t,
        lflag: tc_lflag_t,
        line: cc_t,
        ispeed: speed_t,
        ospeed: speed_t,
        cc: [NCCS]cc_t,
    },
    .solaris, .illumos => extern struct {
        iflag: tc_iflag_t,
        oflag: tc_oflag_t,
        cflag: tc_cflag_t,
        lflag: tc_lflag_t,
        cc: [NCCS]cc_t,
    },
    .emscripten, .wasi => extern struct {
        iflag: tc_iflag_t,
        oflag: tc_oflag_t,
        cflag: tc_cflag_t,
        lflag: tc_lflag_t,
        line: cc_t,
        cc: [NCCS]cc_t,
        ispeed: speed_t,
        ospeed: speed_t,
    },
    else => void,
}

Typetc_iflag_t[src]

Source Code

Source code
pub const tc_iflag_t = switch (native_os) {
    .linux => linux.tc_iflag_t,
    .macos, .ios, .tvos, .watchos, .visionos => packed struct(u64) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IXON: bool = false,
        IXOFF: bool = false,
        IXANY: bool = false,
        _12: u1 = 0,
        IMAXBEL: bool = false,
        IUTF8: bool = false,
        _: u49 = 0,
    },
    .netbsd, .freebsd, .dragonfly => packed struct(u32) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IXON: bool = false,
        IXOFF: bool = false,
        IXANY: bool = false,
        _12: u1 = 0,
        IMAXBEL: bool = false,
        _: u18 = 0,
    },
    .openbsd => packed struct(u32) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IXON: bool = false,
        IXOFF: bool = false,
        IXANY: bool = false,
        IUCLC: bool = false,
        IMAXBEL: bool = false,
        _: u18 = 0,
    },
    .haiku => packed struct(u32) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IUCLC: bool = false,
        IXON: bool = false,
        IXANY: bool = false,
        IXOFF: bool = false,
        _: u19 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IUCLC: bool = false,
        IXON: bool = false,
        IXANY: bool = false,
        _12: u1 = 0,
        IMAXBEL: bool = false,
        _14: u1 = 0,
        DOSMODE: bool = false,
        _: u16 = 0,
    },
    .emscripten, .wasi => packed struct(u32) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IUCLC: bool = false,
        IXON: bool = false,
        IXANY: bool = false,
        IXOFF: bool = false,
        IMAXBEL: bool = false,
        IUTF8: bool = false,
        _: u17 = 0,
    },
    else => void,
}

Typetc_oflag_t[src]

Source Code

Source code
pub const tc_oflag_t = switch (native_os) {
    .linux => linux.tc_oflag_t,
    .macos, .ios, .tvos, .watchos, .visionos => packed struct(u64) {
        OPOST: bool = false,
        ONLCR: bool = false,
        OXTABS: bool = false,
        ONOEOT: bool = false,
        OCRNL: bool = false,
        ONOCR: bool = false,
        ONLRET: bool = false,
        OFILL: bool = false,
        NLDLY: u2 = 0,
        TABDLY: u2 = 0,
        CRDLY: u2 = 0,
        FFDLY: u1 = 0,
        BSDLY: u1 = 0,
        VTDLY: u1 = 0,
        OFDEL: bool = false,
        _: u46 = 0,
    },
    .netbsd => packed struct(u32) {
        OPOST: bool = false,
        ONLCR: bool = false,
        OXTABS: bool = false,
        ONOEOT: bool = false,
        OCRNL: bool = false,
        _5: u1 = 0,
        ONOCR: bool = false,
        ONLRET: bool = false,
        _: u24 = 0,
    },
    .openbsd => packed struct(u32) {
        OPOST: bool = false,
        ONLCR: bool = false,
        OXTABS: bool = false,
        ONOEOT: bool = false,
        OCRNL: bool = false,
        OLCUC: bool = false,
        ONOCR: bool = false,
        ONLRET: bool = false,
        _: u24 = 0,
    },
    .freebsd, .dragonfly => packed struct(u32) {
        OPOST: bool = false,
        ONLCR: bool = false,
        _2: u1 = 0,
        ONOEOT: bool = false,
        OCRNL: bool = false,
        ONOCR: bool = false,
        ONLRET: bool = false,
        _: u25 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        OPOST: bool = false,
        OLCUC: bool = false,
        ONLCR: bool = false,
        OCRNL: bool = false,
        ONOCR: bool = false,
        ONLRET: bool = false,
        OFILL: bool = false,
        OFDEL: bool = false,
        NLDLY: u1 = 0,
        CRDLY: u2 = 0,
        TABDLY: u2 = 0,
        BSDLY: u1 = 0,
        VTDLY: u1 = 0,
        FFDLY: u1 = 0,
        PAGEOUT: bool = false,
        WRAP: bool = false,
        _: u14 = 0,
    },
    .haiku, .wasi, .emscripten => packed struct(u32) {
        OPOST: bool = false,
        OLCUC: bool = false,
        ONLCR: bool = false,
        OCRNL: bool = false,
        ONOCR: bool = false,
        ONLRET: bool = false,
        OFILL: bool = false,
        OFDEL: bool = false,
        NLDLY: u1 = 0,
        CRDLY: u2 = 0,
        TABDLY: u2 = 0,
        BSDLY: u1 = 0,
        VTDLY: u1 = 0,
        FFDLY: u1 = 0,
        _: u16 = 0,
    },
    else => void,
}

TypeCSIZE[src]

Source Code

Source code
pub const CSIZE = switch (native_os) {
    .linux => linux.CSIZE,
    .haiku => enum(u1) { CS7, CS8 },
    else => enum(u2) { CS5, CS6, CS7, CS8 },
}

Typetc_cflag_t[src]

Source Code

Source code
pub const tc_cflag_t = switch (native_os) {
    .linux => linux.tc_cflag_t,
    .macos, .ios, .tvos, .watchos, .visionos => packed struct(u64) {
        CIGNORE: bool = false,
        _1: u5 = 0,
        CSTOPB: bool = false,
        _7: u1 = 0,
        CSIZE: CSIZE = .CS5,
        _10: u1 = 0,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        CCTS_OFLOW: bool = false,
        CRTS_IFLOW: bool = false,
        CDTR_IFLOW: bool = false,
        CDSR_OFLOW: bool = false,
        CCAR_OFLOW: bool = false,
        _: u43 = 0,
    },
    .freebsd => packed struct(u32) {
        CIGNORE: bool = false,
        _1: u7 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        CCTS_OFLOW: bool = false,
        CRTS_IFLOW: bool = false,
        CDTR_IFLOW: bool = false,
        CDSR_OFLOW: bool = false,
        CCAR_OFLOW: bool = false,
        CNO_RTSDTR: bool = false,
        _: u10 = 0,
    },
    .netbsd => packed struct(u32) {
        CIGNORE: bool = false,
        _1: u7 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        CRTSCTS: bool = false,
        CDTRCTS: bool = false,
        _18: u2 = 0,
        MDMBUF: bool = false,
        _: u11 = 0,
    },
    .dragonfly => packed struct(u32) {
        CIGNORE: bool = false,
        _1: u7 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        CCTS_OFLOW: bool = false,
        CRTS_IFLOW: bool = false,
        CDTR_IFLOW: bool = false,
        CDSR_OFLOW: bool = false,
        CCAR_OFLOW: bool = false,
        _: u11 = 0,
    },
    .openbsd => packed struct(u32) {
        CIGNORE: bool = false,
        _1: u7 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        CRTSCTS: bool = false,
        _17: u3 = 0,
        MDMBUF: bool = false,
        _: u11 = 0,
    },
    .haiku => packed struct(u32) {
        _0: u5 = 0,
        CSIZE: CSIZE = .CS7,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        XLOBLK: bool = false,
        CTSFLOW: bool = false,
        RTSFLOW: bool = false,
        _: u17 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        _0: u4 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        RCV1EN: bool = false,
        XMT1EN: bool = false,
        LOBLK: bool = false,
        XCLUDE: bool = false,
        _16: u4 = 0,
        PAREXT: bool = false,
        CBAUDEXT: bool = false,
        CIBAUDEXT: bool = false,
        _23: u7 = 0,
        CRTSXOFF: bool = false,
        CRTSCTS: bool = false,
    },
    .wasi, .emscripten => packed struct(u32) {
        _0: u4 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        _: u20 = 0,
    },
    else => void,
}

Typetc_lflag_t[src]

Source Code

Source code
pub const tc_lflag_t = switch (native_os) {
    .linux => linux.tc_lflag_t,
    .macos, .ios, .tvos, .watchos, .visionos => packed struct(u64) {
        ECHOKE: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHO: bool = false,
        ECHONL: bool = false,
        ECHOPRT: bool = false,
        ECHOCTL: bool = false,
        ISIG: bool = false,
        ICANON: bool = false,
        ALTWERASE: bool = false,
        IEXTEN: bool = false,
        EXTPROC: bool = false,
        _12: u10 = 0,
        TOSTOP: bool = false,
        FLUSHO: bool = false,
        _24: u1 = 0,
        NOKERNINFO: bool = false,
        _26: u3 = 0,
        PENDIN: bool = false,
        _30: u1 = 0,
        NOFLSH: bool = false,
        _: u32 = 0,
    },
    .netbsd, .freebsd, .dragonfly => packed struct(u32) {
        ECHOKE: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHO: bool = false,
        ECHONL: bool = false,
        ECHOPRT: bool = false,
        ECHOCTL: bool = false,
        ISIG: bool = false,
        ICANON: bool = false,
        ALTWERASE: bool = false,
        IEXTEN: bool = false,
        EXTPROC: bool = false,
        _12: u10 = 0,
        TOSTOP: bool = false,
        FLUSHO: bool = false,
        _24: u1 = 0,
        NOKERNINFO: bool = false,
        _26: u3 = 0,
        PENDIN: bool = false,
        _30: u1 = 0,
        NOFLSH: bool = false,
    },
    .openbsd => packed struct(u32) {
        ECHOKE: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHO: bool = false,
        ECHONL: bool = false,
        ECHOPRT: bool = false,
        ECHOCTL: bool = false,
        ISIG: bool = false,
        ICANON: bool = false,
        ALTWERASE: bool = false,
        IEXTEN: bool = false,
        EXTPROC: bool = false,
        _12: u10 = 0,
        TOSTOP: bool = false,
        FLUSHO: bool = false,
        XCASE: bool = false,
        NOKERNINFO: bool = false,
        _26: u3 = 0,
        PENDIN: bool = false,
        _30: u1 = 0,
        NOFLSH: bool = false,
    },
    .haiku => packed struct(u32) {
        ISIG: bool = false,
        ICANON: bool = false,
        XCASE: bool = false,
        ECHO: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHONL: bool = false,
        NOFLSH: bool = false,
        TOSTOP: bool = false,
        IEXTEN: bool = false,
        ECHOCTL: bool = false,
        ECHOPRT: bool = false,
        ECHOKE: bool = false,
        FLUSHO: bool = false,
        PENDIN: bool = false,
        _: u17 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        ISIG: bool = false,
        ICANON: bool = false,
        XCASE: bool = false,
        ECHO: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHONL: bool = false,
        NOFLSH: bool = false,
        TOSTOP: bool = false,
        ECHOCTL: bool = false,
        ECHOPRT: bool = false,
        ECHOKE: bool = false,
        DEFECHO: bool = false,
        FLUSHO: bool = false,
        PENDIN: bool = false,
        IEXTEN: bool = false,
        _: u16 = 0,
    },
    .wasi, .emscripten => packed struct(u32) {
        ISIG: bool = false,
        ICANON: bool = false,
        _2: u1 = 0,
        ECHO: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHONL: bool = false,
        NOFLSH: bool = false,
        TOSTOP: bool = false,
        _9: u6 = 0,
        IEXTEN: bool = false,
        _: u16 = 0,
    },
    else => void,
}

Typespeed_t[src]

Source Code

Source code
pub const speed_t = switch (native_os) {
    .linux => linux.speed_t,
    .macos, .ios, .tvos, .watchos, .visionos, .openbsd => enum(u64) {
        B0 = 0,
        B50 = 50,
        B75 = 75,
        B110 = 110,
        B134 = 134,
        B150 = 150,
        B200 = 200,
        B300 = 300,
        B600 = 600,
        B1200 = 1200,
        B1800 = 1800,
        B2400 = 2400,
        B4800 = 4800,
        B9600 = 9600,
        B19200 = 19200,
        B38400 = 38400,
        B7200 = 7200,
        B14400 = 14400,
        B28800 = 28800,
        B57600 = 57600,
        B76800 = 76800,
        B115200 = 115200,
        B230400 = 230400,
    },
    .freebsd, .netbsd => enum(c_uint) {
        B0 = 0,
        B50 = 50,
        B75 = 75,
        B110 = 110,
        B134 = 134,
        B150 = 150,
        B200 = 200,
        B300 = 300,
        B600 = 600,
        B1200 = 1200,
        B1800 = 1800,
        B2400 = 2400,
        B4800 = 4800,
        B9600 = 9600,
        B19200 = 19200,
        B38400 = 38400,
        B7200 = 7200,
        B14400 = 14400,
        B28800 = 28800,
        B57600 = 57600,
        B76800 = 76800,
        B115200 = 115200,
        B230400 = 230400,
        B460800 = 460800,
        B500000 = 500000,
        B921600 = 921600,
        B1000000 = 1000000,
        B1500000 = 1500000,
        B2000000 = 2000000,
        B2500000 = 2500000,
        B3000000 = 3000000,
        B3500000 = 3500000,
        B4000000 = 4000000,
    },
    .dragonfly => enum(c_uint) {
        B0 = 0,
        B50 = 50,
        B75 = 75,
        B110 = 110,
        B134 = 134,
        B150 = 150,
        B200 = 200,
        B300 = 300,
        B600 = 600,
        B1200 = 1200,
        B1800 = 1800,
        B2400 = 2400,
        B4800 = 4800,
        B9600 = 9600,
        B19200 = 19200,
        B38400 = 38400,
        B7200 = 7200,
        B14400 = 14400,
        B28800 = 28800,
        B57600 = 57600,
        B76800 = 76800,
        B115200 = 115200,
        B230400 = 230400,
        B460800 = 460800,
        B921600 = 921600,
    },
    .haiku => enum(u8) {
        B0 = 0x00,
        B50 = 0x01,
        B75 = 0x02,
        B110 = 0x03,
        B134 = 0x04,
        B150 = 0x05,
        B200 = 0x06,
        B300 = 0x07,
        B600 = 0x08,
        B1200 = 0x09,
        B1800 = 0x0A,
        B2400 = 0x0B,
        B4800 = 0x0C,
        B9600 = 0x0D,
        B19200 = 0x0E,
        B38400 = 0x0F,
        B57600 = 0x10,
        B115200 = 0x11,
        B230400 = 0x12,
        B31250 = 0x13,
    },
    .solaris, .illumos => enum(c_uint) {
        B0 = 0,
        B50 = 1,
        B75 = 2,
        B110 = 3,
        B134 = 4,
        B150 = 5,
        B200 = 6,
        B300 = 7,
        B600 = 8,
        B1200 = 9,
        B1800 = 10,
        B2400 = 11,
        B4800 = 12,
        B9600 = 13,
        B19200 = 14,
        B38400 = 15,
        B57600 = 16,
        B76800 = 17,
        B115200 = 18,
        B153600 = 19,
        B230400 = 20,
        B307200 = 21,
        B460800 = 22,
        B921600 = 23,
        B1000000 = 24,
        B1152000 = 25,
        B1500000 = 26,
        B2000000 = 27,
        B2500000 = 28,
        B3000000 = 29,
        B3500000 = 30,
        B4000000 = 31,
    },
    .emscripten, .wasi => enum(u32) {
        B0 = 0o0000000,
        B50 = 0o0000001,
        B75 = 0o0000002,
        B110 = 0o0000003,
        B134 = 0o0000004,
        B150 = 0o0000005,
        B200 = 0o0000006,
        B300 = 0o0000007,
        B600 = 0o0000010,
        B1200 = 0o0000011,
        B1800 = 0o0000012,
        B2400 = 0o0000013,
        B4800 = 0o0000014,
        B9600 = 0o0000015,
        B19200 = 0o0000016,
        B38400 = 0o0000017,

        B57600 = 0o0010001,
        B115200 = 0o0010002,
        B230400 = 0o0010003,
        B460800 = 0o0010004,
        B500000 = 0o0010005,
        B576000 = 0o0010006,
        B921600 = 0o0010007,
        B1000000 = 0o0010010,
        B1152000 = 0o0010011,
        B1500000 = 0o0010012,
        B2000000 = 0o0010013,
        B2500000 = 0o0010014,
        B3000000 = 0o0010015,
        B3500000 = 0o0010016,
        B4000000 = 0o0010017,
    },
    else => void,
}

Typewhence_t[src]

Source Code

Source code
pub const whence_t = if (native_os == .wasi) std.os.wasi.whence_t else c_int

Typesig_atomic_t[src]

Source Code

Source code
pub const sig_atomic_t = c_int

TypeSS[src]

Values

ConstantONSTACK[src]

Source Code

Source code
pub const ONSTACK = 1

ConstantDISABLE[src]

Source Code

Source code
pub const DISABLE = 4

ConstantONSTACK[src]

Source Code

Source code
pub const ONSTACK = 0x1

ConstantDISABLE[src]

Source Code

Source code
pub const DISABLE = 0x2

Source Code

Source code
pub const SS = switch (native_os) {
    .linux => linux.SS,
    .openbsd, .macos, .ios, .tvos, .watchos, .visionos, .netbsd, .freebsd => struct {
        pub const ONSTACK = 1;
        pub const DISABLE = 4;
    },
    .haiku, .solaris, .illumos => struct {
        pub const ONSTACK = 0x1;
        pub const DISABLE = 0x2;
    },
    else => void,
}

TypeEV[src]

Values

ConstantADD[src]

add event to kq (implies enable)

Source Code

Source code
pub const ADD = 0x0001

ConstantDELETE[src]

delete event from kq

Source Code

Source code
pub const DELETE = 0x0002

ConstantENABLE[src]

enable event

Source Code

Source code
pub const ENABLE = 0x0004

ConstantDISABLE[src]

disable event (not reported)

Source Code

Source code
pub const DISABLE = 0x0008

ConstantONESHOT[src]

only report one occurrence

Source Code

Source code
pub const ONESHOT = 0x0010

ConstantCLEAR[src]

clear event state after reporting

Source Code

Source code
pub const CLEAR = 0x0020

ConstantRECEIPT[src]

force immediate event output ... with or without ERROR ... use KEVENT_FLAG_ERROR_EVENTS on syscalls supporting flags

Source Code

Source code
pub const RECEIPT = 0x0040

ConstantDISPATCH[src]

disable event after reporting

Source Code

Source code
pub const DISPATCH = 0x0080

ConstantUDATA_SPECIFIC[src]

unique kevent per udata value

Source Code

Source code
pub const UDATA_SPECIFIC = 0x0100

ConstantDISPATCH2[src]

... in combination with DELETE will defer delete until udata-specific event enabled. EINPROGRESS will be returned to indicate the deferral

Source Code

Source code
pub const DISPATCH2 = DISPATCH | UDATA_SPECIFIC

ConstantVANISHED[src]

report that source has vanished ... only valid with DISPATCH2

Source Code

Source code
pub const VANISHED = 0x0200

ConstantSYSFLAGS[src]

reserved by system

Source Code

Source code
pub const SYSFLAGS = 0xF000

ConstantFLAG0[src]

filter-specific flag

Source Code

Source code
pub const FLAG0 = 0x1000

ConstantFLAG1[src]

filter-specific flag

Source Code

Source code
pub const FLAG1 = 0x2000

ConstantEOF[src]

EOF detected

Source Code

Source code
pub const EOF = 0x8000

ConstantERROR[src]

error, data contains errno

Source Code

Source code
pub const ERROR = 0x4000

ConstantFLAG0[src]

filter-specific flag

Source Code

Source code
pub const FLAG0 = 0x1000

ConstantFLAG1[src]

filter-specific flag

Source Code

Source code
pub const FLAG1 = 0x2000

ConstantADD[src]

Source Code

Source code
pub const ADD = 1

ConstantDELETE[src]

Source Code

Source code
pub const DELETE = 2

ConstantENABLE[src]

Source Code

Source code
pub const ENABLE = 4

ConstantDISABLE[src]

Source Code

Source code
pub const DISABLE = 8

ConstantONESHOT[src]

Source Code

Source code
pub const ONESHOT = 16

ConstantCLEAR[src]

Source Code

Source code
pub const CLEAR = 32

ConstantRECEIPT[src]

Source Code

Source code
pub const RECEIPT = 64

ConstantDISPATCH[src]

Source Code

Source code
pub const DISPATCH = 128

ConstantNODATA[src]

Source Code

Source code
pub const NODATA = 4096

ConstantFLAG1[src]

Source Code

Source code
pub const FLAG1 = 8192

ConstantERROR[src]

Source Code

Source code
pub const ERROR = 16384

ConstantEOF[src]

Source Code

Source code
pub const EOF = 32768

ConstantSYSFLAGS[src]

Source Code

Source code
pub const SYSFLAGS = 61440

ConstantADD[src]

add event to kq (implies enable)

Source Code

Source code
pub const ADD = 0x0001

ConstantDELETE[src]

delete event from kq

Source Code

Source code
pub const DELETE = 0x0002

ConstantENABLE[src]

enable event

Source Code

Source code
pub const ENABLE = 0x0004

ConstantDISABLE[src]

disable event (not reported)

Source Code

Source code
pub const DISABLE = 0x0008

ConstantONESHOT[src]

only report one occurrence

Source Code

Source code
pub const ONESHOT = 0x0010

ConstantCLEAR[src]

clear event state after reporting

Source Code

Source code
pub const CLEAR = 0x0020

ConstantRECEIPT[src]

force immediate event output ... with or without ERROR ... use KEVENT_FLAG_ERROR_EVENTS on syscalls supporting flags

Source Code

Source code
pub const RECEIPT = 0x0040

ConstantDISPATCH[src]

disable event after reporting

Source Code

Source code
pub const DISPATCH = 0x0080

ConstantADD[src]

add event to kq (implies enable)

Source Code

Source code
pub const ADD = 0x0001

ConstantDELETE[src]

delete event from kq

Source Code

Source code
pub const DELETE = 0x0002

ConstantENABLE[src]

enable event

Source Code

Source code
pub const ENABLE = 0x0004

ConstantDISABLE[src]

disable event (not reported)

Source Code

Source code
pub const DISABLE = 0x0008

ConstantONESHOT[src]

only report one occurrence

Source Code

Source code
pub const ONESHOT = 0x0010

ConstantCLEAR[src]

clear event state after reporting

Source Code

Source code
pub const CLEAR = 0x0020

ConstantERROR[src]

error, event data contains errno

Source Code

Source code
pub const ERROR = 0x4000

ConstantRECEIPT[src]

force immediate event output ... with or without ERROR ... use KEVENT_FLAG_ERROR_EVENTS on syscalls supporting flags

Source Code

Source code
pub const RECEIPT = 0x0040

ConstantDISPATCH[src]

disable event after reporting

Source Code

Source code
pub const DISPATCH = 0x0080

ConstantADD[src]

Source Code

Source code
pub const ADD = 0x0001

ConstantDELETE[src]

Source Code

Source code
pub const DELETE = 0x0002

ConstantENABLE[src]

Source Code

Source code
pub const ENABLE = 0x0004

ConstantDISABLE[src]

Source Code

Source code
pub const DISABLE = 0x0008

ConstantONESHOT[src]

Source Code

Source code
pub const ONESHOT = 0x0010

ConstantCLEAR[src]

Source Code

Source code
pub const CLEAR = 0x0020

ConstantRECEIPT[src]

Source Code

Source code
pub const RECEIPT = 0x0040

ConstantDISPATCH[src]

Source Code

Source code
pub const DISPATCH = 0x0080

ConstantFLAG1[src]

Source Code

Source code
pub const FLAG1 = 0x2000

ConstantERROR[src]

Source Code

Source code
pub const ERROR = 0x4000

ConstantEOF[src]

Source Code

Source code
pub const EOF = 0x8000

ConstantADD[src]

add event to kq (implies enable)

Source Code

Source code
pub const ADD = 0x0001

ConstantDELETE[src]

delete event from kq

Source Code

Source code
pub const DELETE = 0x0002

ConstantENABLE[src]

enable event

Source Code

Source code
pub const ENABLE = 0x0004

ConstantDISABLE[src]

disable event (not reported)

Source Code

Source code
pub const DISABLE = 0x0008

ConstantONESHOT[src]

only report one occurrence

Source Code

Source code
pub const ONESHOT = 0x0010

ConstantCLEAR[src]

clear event state after reporting

Source Code

Source code
pub const CLEAR = 0x0020

ConstantRECEIPT[src]

force immediate event output ... with or without ERROR ... use KEVENT_FLAG_ERROR_EVENTS on syscalls supporting flags

Source Code

Source code
pub const RECEIPT = 0x0040

ConstantDISPATCH[src]

disable event after reporting

Source Code

Source code
pub const DISPATCH = 0x0080

Source Code

Source code
pub const EV = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        /// add event to kq (implies enable)
        pub const ADD = 0x0001;
        /// delete event from kq
        pub const DELETE = 0x0002;
        /// enable event
        pub const ENABLE = 0x0004;
        /// disable event (not reported)
        pub const DISABLE = 0x0008;
        /// only report one occurrence
        pub const ONESHOT = 0x0010;
        /// clear event state after reporting
        pub const CLEAR = 0x0020;
        /// force immediate event output
        /// ... with or without ERROR
        /// ... use KEVENT_FLAG_ERROR_EVENTS
        ///     on syscalls supporting flags
        pub const RECEIPT = 0x0040;
        /// disable event after reporting
        pub const DISPATCH = 0x0080;
        /// unique kevent per udata value
        pub const UDATA_SPECIFIC = 0x0100;
        /// ... in combination with DELETE
        /// will defer delete until udata-specific
        /// event enabled. EINPROGRESS will be
        /// returned to indicate the deferral
        pub const DISPATCH2 = DISPATCH | UDATA_SPECIFIC;
        /// report that source has vanished
        /// ... only valid with DISPATCH2
        pub const VANISHED = 0x0200;
        /// reserved by system
        pub const SYSFLAGS = 0xF000;
        /// filter-specific flag
        pub const FLAG0 = 0x1000;
        /// filter-specific flag
        pub const FLAG1 = 0x2000;
        /// EOF detected
        pub const EOF = 0x8000;
        /// error, data contains errno
        pub const ERROR = 0x4000;
        pub const POLL = FLAG0;
        pub const OOBAND = FLAG1;
    },
    .dragonfly => struct {
        pub const ADD = 1;
        pub const DELETE = 2;
        pub const ENABLE = 4;
        pub const DISABLE = 8;
        pub const ONESHOT = 16;
        pub const CLEAR = 32;
        pub const RECEIPT = 64;
        pub const DISPATCH = 128;
        pub const NODATA = 4096;
        pub const FLAG1 = 8192;
        pub const ERROR = 16384;
        pub const EOF = 32768;
        pub const SYSFLAGS = 61440;
    },
    .netbsd => struct {
        /// add event to kq (implies enable)
        pub const ADD = 0x0001;
        /// delete event from kq
        pub const DELETE = 0x0002;
        /// enable event
        pub const ENABLE = 0x0004;
        /// disable event (not reported)
        pub const DISABLE = 0x0008;
        /// only report one occurrence
        pub const ONESHOT = 0x0010;
        /// clear event state after reporting
        pub const CLEAR = 0x0020;
        /// force immediate event output
        /// ... with or without ERROR
        /// ... use KEVENT_FLAG_ERROR_EVENTS
        ///     on syscalls supporting flags
        pub const RECEIPT = 0x0040;
        /// disable event after reporting
        pub const DISPATCH = 0x0080;
    },
    .freebsd => struct {
        /// add event to kq (implies enable)
        pub const ADD = 0x0001;
        /// delete event from kq
        pub const DELETE = 0x0002;
        /// enable event
        pub const ENABLE = 0x0004;
        /// disable event (not reported)
        pub const DISABLE = 0x0008;
        /// only report one occurrence
        pub const ONESHOT = 0x0010;
        /// clear event state after reporting
        pub const CLEAR = 0x0020;
        /// error, event data contains errno
        pub const ERROR = 0x4000;
        /// force immediate event output
        /// ... with or without ERROR
        /// ... use KEVENT_FLAG_ERROR_EVENTS
        ///     on syscalls supporting flags
        pub const RECEIPT = 0x0040;
        /// disable event after reporting
        pub const DISPATCH = 0x0080;
    },
    .openbsd => struct {
        pub const ADD = 0x0001;
        pub const DELETE = 0x0002;
        pub const ENABLE = 0x0004;
        pub const DISABLE = 0x0008;
        pub const ONESHOT = 0x0010;
        pub const CLEAR = 0x0020;
        pub const RECEIPT = 0x0040;
        pub const DISPATCH = 0x0080;
        pub const FLAG1 = 0x2000;
        pub const ERROR = 0x4000;
        pub const EOF = 0x8000;
    },
    .haiku => struct {
        /// add event to kq (implies enable)
        pub const ADD = 0x0001;
        /// delete event from kq
        pub const DELETE = 0x0002;
        /// enable event
        pub const ENABLE = 0x0004;
        /// disable event (not reported)
        pub const DISABLE = 0x0008;
        /// only report one occurrence
        pub const ONESHOT = 0x0010;
        /// clear event state after reporting
        pub const CLEAR = 0x0020;
        /// force immediate event output
        /// ... with or without ERROR
        /// ... use KEVENT_FLAG_ERROR_EVENTS
        ///     on syscalls supporting flags
        pub const RECEIPT = 0x0040;
        /// disable event after reporting
        pub const DISPATCH = 0x0080;
    },
    else => void,
}

TypeEVFILT[src]

Values

ConstantREAD[src]

Source Code

Source code
pub const READ = -1

ConstantWRITE[src]

Source Code

Source code
pub const WRITE = -2

ConstantAIO[src]

attached to aio requests

Source Code

Source code
pub const AIO = -3

ConstantVNODE[src]

attached to vnodes

Source Code

Source code
pub const VNODE = -4

ConstantPROC[src]

attached to struct proc

Source Code

Source code
pub const PROC = -5

ConstantSIGNAL[src]

attached to struct proc

Source Code

Source code
pub const SIGNAL = -6

ConstantTIMER[src]

timers

Source Code

Source code
pub const TIMER = -7

ConstantMACHPORT[src]

Mach portsets

Source Code

Source code
pub const MACHPORT = -8

ConstantFS[src]

Filesystem events

Source Code

Source code
pub const FS = -9

ConstantUSER[src]

User events

Source Code

Source code
pub const USER = -10

ConstantVM[src]

Virtual memory events

Source Code

Source code
pub const VM = -12

ConstantEXCEPT[src]

Exception events

Source Code

Source code
pub const EXCEPT = -15

ConstantSYSCOUNT[src]

Source Code

Source code
pub const SYSCOUNT = 17

ConstantREAD[src]

Source Code

Source code
pub const READ = -1

ConstantWRITE[src]

Source Code

Source code
pub const WRITE = -2

ConstantAIO[src]

attached to aio requests

Source Code

Source code
pub const AIO = -3

ConstantVNODE[src]

attached to vnodes

Source Code

Source code
pub const VNODE = -4

ConstantPROC[src]

attached to struct proc

Source Code

Source code
pub const PROC = -5

ConstantSIGNAL[src]

attached to struct proc

Source Code

Source code
pub const SIGNAL = -6

ConstantTIMER[src]

timers

Source Code

Source code
pub const TIMER = -7

ConstantPROCDESC[src]

Process descriptors

Source Code

Source code
pub const PROCDESC = -8

ConstantFS[src]

Filesystem events

Source Code

Source code
pub const FS = -9

ConstantLIO[src]

Source Code

Source code
pub const LIO = -10

ConstantUSER[src]

User events

Source Code

Source code
pub const USER = -11

ConstantSENDFILE[src]

Sendfile events

Source Code

Source code
pub const SENDFILE = -12

ConstantEMPTY[src]

Source Code

Source code
pub const EMPTY = -13

ConstantFS[src]

Source Code

Source code
pub const FS = -10

ConstantUSER[src]

Source Code

Source code
pub const USER = -9

ConstantEXCEPT[src]

Source Code

Source code
pub const EXCEPT = -8

ConstantTIMER[src]

Source Code

Source code
pub const TIMER = -7

ConstantSIGNAL[src]

Source Code

Source code
pub const SIGNAL = -6

ConstantPROC[src]

Source Code

Source code
pub const PROC = -5

ConstantVNODE[src]

Source Code

Source code
pub const VNODE = -4

ConstantAIO[src]

Source Code

Source code
pub const AIO = -3

ConstantWRITE[src]

Source Code

Source code
pub const WRITE = -2

ConstantREAD[src]

Source Code

Source code
pub const READ = -1

ConstantSYSCOUNT[src]

Source Code

Source code
pub const SYSCOUNT = 10

ConstantMARKER[src]

Source Code

Source code
pub const MARKER = 15

ConstantREAD[src]

Source Code

Source code
pub const READ = 0

ConstantWRITE[src]

Source Code

Source code
pub const WRITE = 1

ConstantAIO[src]

attached to aio requests

Source Code

Source code
pub const AIO = 2

ConstantVNODE[src]

attached to vnodes

Source Code

Source code
pub const VNODE = 3

ConstantPROC[src]

attached to struct proc

Source Code

Source code
pub const PROC = 4

ConstantSIGNAL[src]

attached to struct proc

Source Code

Source code
pub const SIGNAL = 5

ConstantTIMER[src]

timers

Source Code

Source code
pub const TIMER = 6

ConstantFS[src]

Filesystem events

Source Code

Source code
pub const FS = 7

ConstantUSER[src]

User events

Source Code

Source code
pub const USER = 1

ConstantREAD[src]

Source Code

Source code
pub const READ = -1

ConstantWRITE[src]

Source Code

Source code
pub const WRITE = -2

ConstantAIO[src]

attached to aio requests

Source Code

Source code
pub const AIO = -3

ConstantVNODE[src]

attached to vnodes

Source Code

Source code
pub const VNODE = -4

ConstantPROC[src]

attached to struct proc

Source Code

Source code
pub const PROC = -5

ConstantSIGNAL[src]

attached to struct proc

Source Code

Source code
pub const SIGNAL = -6

ConstantTIMER[src]

timers

Source Code

Source code
pub const TIMER = -7

ConstantPROCDESC[src]

Process descriptors

Source Code

Source code
pub const PROCDESC = -8

ConstantFS[src]

Filesystem events

Source Code

Source code
pub const FS = -9

ConstantLIO[src]

Source Code

Source code
pub const LIO = -10

ConstantUSER[src]

User events

Source Code

Source code
pub const USER = -11

ConstantSENDFILE[src]

Sendfile events

Source Code

Source code
pub const SENDFILE = -12

ConstantEMPTY[src]

Source Code

Source code
pub const EMPTY = -13

ConstantREAD[src]

Source Code

Source code
pub const READ = -1

ConstantWRITE[src]

Source Code

Source code
pub const WRITE = -2

ConstantAIO[src]

Source Code

Source code
pub const AIO = -3

ConstantVNODE[src]

Source Code

Source code
pub const VNODE = -4

ConstantPROC[src]

Source Code

Source code
pub const PROC = -5

ConstantSIGNAL[src]

Source Code

Source code
pub const SIGNAL = -6

ConstantTIMER[src]

Source Code

Source code
pub const TIMER = -7

ConstantEXCEPT[src]

Source Code

Source code
pub const EXCEPT = -9

Source Code

Source code
pub const EVFILT = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const READ = -1;
        pub const WRITE = -2;
        /// attached to aio requests
        pub const AIO = -3;
        /// attached to vnodes
        pub const VNODE = -4;
        /// attached to struct proc
        pub const PROC = -5;
        /// attached to struct proc
        pub const SIGNAL = -6;
        /// timers
        pub const TIMER = -7;
        /// Mach portsets
        pub const MACHPORT = -8;
        /// Filesystem events
        pub const FS = -9;
        /// User events
        pub const USER = -10;
        /// Virtual memory events
        pub const VM = -12;
        /// Exception events
        pub const EXCEPT = -15;
        pub const SYSCOUNT = 17;
    },
    .haiku => struct {
        pub const READ = -1;
        pub const WRITE = -2;
        /// attached to aio requests
        pub const AIO = -3;
        /// attached to vnodes
        pub const VNODE = -4;
        /// attached to struct proc
        pub const PROC = -5;
        /// attached to struct proc
        pub const SIGNAL = -6;
        /// timers
        pub const TIMER = -7;
        /// Process descriptors
        pub const PROCDESC = -8;
        /// Filesystem events
        pub const FS = -9;
        pub const LIO = -10;
        /// User events
        pub const USER = -11;
        /// Sendfile events
        pub const SENDFILE = -12;
        pub const EMPTY = -13;
    },
    .dragonfly => struct {
        pub const FS = -10;
        pub const USER = -9;
        pub const EXCEPT = -8;
        pub const TIMER = -7;
        pub const SIGNAL = -6;
        pub const PROC = -5;
        pub const VNODE = -4;
        pub const AIO = -3;
        pub const WRITE = -2;
        pub const READ = -1;
        pub const SYSCOUNT = 10;
        pub const MARKER = 15;
    },
    .netbsd => struct {
        pub const READ = 0;
        pub const WRITE = 1;
        /// attached to aio requests
        pub const AIO = 2;
        /// attached to vnodes
        pub const VNODE = 3;
        /// attached to struct proc
        pub const PROC = 4;
        /// attached to struct proc
        pub const SIGNAL = 5;
        /// timers
        pub const TIMER = 6;
        /// Filesystem events
        pub const FS = 7;
        /// User events
        pub const USER = 1;
    },
    .freebsd => struct {
        pub const READ = -1;
        pub const WRITE = -2;
        /// attached to aio requests
        pub const AIO = -3;
        /// attached to vnodes
        pub const VNODE = -4;
        /// attached to struct proc
        pub const PROC = -5;
        /// attached to struct proc
        pub const SIGNAL = -6;
        /// timers
        pub const TIMER = -7;
        /// Process descriptors
        pub const PROCDESC = -8;
        /// Filesystem events
        pub const FS = -9;
        pub const LIO = -10;
        /// User events
        pub const USER = -11;
        /// Sendfile events
        pub const SENDFILE = -12;
        pub const EMPTY = -13;
    },
    .openbsd => struct {
        pub const READ = -1;
        pub const WRITE = -2;
        pub const AIO = -3;
        pub const VNODE = -4;
        pub const PROC = -5;
        pub const SIGNAL = -6;
        pub const TIMER = -7;
        pub const EXCEPT = -9;
    },
    else => void,
}

TypeNOTE[src]

Values

ConstantTRIGGER[src]

On input, TRIGGER causes the event to be triggered for output.

Source Code

Source code
pub const TRIGGER = 0x01000000

ConstantFFNOP[src]

ignore input fflags

Source Code

Source code
pub const FFNOP = 0x00000000

ConstantFFAND[src]

and fflags

Source Code

Source code
pub const FFAND = 0x40000000

ConstantFFOR[src]

or fflags

Source Code

Source code
pub const FFOR = 0x80000000

ConstantFFCOPY[src]

copy fflags

Source Code

Source code
pub const FFCOPY = 0xc0000000

ConstantFFCTRLMASK[src]

mask for operations

Source Code

Source code
pub const FFCTRLMASK = 0xc0000000

ConstantFFLAGSMASK[src]

Source Code

Source code
pub const FFLAGSMASK = 0x00ffffff

ConstantLOWAT[src]

low water mark

Source Code

Source code
pub const LOWAT = 0x00000001

ConstantOOB[src]

OOB data

Source Code

Source code
pub const OOB = 0x00000002

ConstantDELETE[src]

vnode was removed

Source Code

Source code
pub const DELETE = 0x00000001

ConstantWRITE[src]

data contents changed

Source Code

Source code
pub const WRITE = 0x00000002

ConstantEXTEND[src]

size increased

Source Code

Source code
pub const EXTEND = 0x00000004

ConstantATTRIB[src]

attributes changed

Source Code

Source code
pub const ATTRIB = 0x00000008

link count changed

Source code
pub const LINK = 0x00000010

ConstantRENAME[src]

vnode was renamed

Source Code

Source code
pub const RENAME = 0x00000020

ConstantREVOKE[src]

vnode access was revoked

Source Code

Source code
pub const REVOKE = 0x00000040

ConstantNONE[src]

No specific vnode event: to test for EVFILT_READ activation

Source Code

Source code
pub const NONE = 0x00000080

ConstantFUNLOCK[src]

vnode was unlocked by flock(2)

Source Code

Source code
pub const FUNLOCK = 0x00000100

ConstantEXIT[src]

process exited

Source Code

Source code
pub const EXIT = 0x80000000

ConstantFORK[src]

process forked

Source Code

Source code
pub const FORK = 0x40000000

ConstantEXEC[src]

process exec'd

Source Code

Source code
pub const EXEC = 0x20000000

ConstantSIGNAL[src]

shared with EVFILT_SIGNAL

Source Code

Source code
pub const SIGNAL = 0x08000000

ConstantEXITSTATUS[src]

exit status to be returned, valid for child process only

Source Code

Source code
pub const EXITSTATUS = 0x04000000

ConstantEXIT_DETAIL[src]

provide details on reasons for exit

Source Code

Source code
pub const EXIT_DETAIL = 0x02000000

ConstantPDATAMASK[src]

mask for signal & exit status

Source Code

Source code
pub const PDATAMASK = 0x000fffff

ConstantPCTRLMASK[src]

Source Code

Source code
pub const PCTRLMASK = 0xf0000000

ConstantEXIT_DETAIL_MASK[src]

Source Code

Source code
pub const EXIT_DETAIL_MASK = 0x00070000

ConstantEXIT_DECRYPTFAIL[src]

Source Code

Source code
pub const EXIT_DECRYPTFAIL = 0x00010000

ConstantEXIT_MEMORY[src]

Source Code

Source code
pub const EXIT_MEMORY = 0x00020000

ConstantEXIT_CSERROR[src]

Source Code

Source code
pub const EXIT_CSERROR = 0x00040000

ConstantVM_PRESSURE[src]

will react on memory pressure

Source Code

Source code
pub const VM_PRESSURE = 0x80000000

ConstantVM_PRESSURE_TERMINATE[src]

will quit on memory pressure, possibly after cleaning up dirty state

Source Code

Source code
pub const VM_PRESSURE_TERMINATE = 0x40000000

ConstantVM_PRESSURE_SUDDEN_TERMINATE[src]

will quit immediately on memory pressure

Source Code

Source code
pub const VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000

ConstantVM_ERROR[src]

there was an error

Source Code

Source code
pub const VM_ERROR = 0x10000000

ConstantSECONDS[src]

data is seconds

Source Code

Source code
pub const SECONDS = 0x00000001

ConstantUSECONDS[src]

data is microseconds

Source Code

Source code
pub const USECONDS = 0x00000002

ConstantNSECONDS[src]

data is nanoseconds

Source Code

Source code
pub const NSECONDS = 0x00000004

ConstantABSOLUTE[src]

absolute timeout

Source Code

Source code
pub const ABSOLUTE = 0x00000008

ConstantLEEWAY[src]

ext[1] holds leeway for power aware timers

Source Code

Source code
pub const LEEWAY = 0x00000010

ConstantCRITICAL[src]

system does minimal timer coalescing

Source Code

Source code
pub const CRITICAL = 0x00000020

ConstantBACKGROUND[src]

system does maximum timer coalescing

Source Code

Source code
pub const BACKGROUND = 0x00000040

ConstantMACH_CONTINUOUS_TIME[src]

Source Code

Source code
pub const MACH_CONTINUOUS_TIME = 0x00000080

ConstantMACHTIME[src]

data is mach absolute time units

Source Code

Source code
pub const MACHTIME = 0x00000100

ConstantFFNOP[src]

Source Code

Source code
pub const FFNOP = 0

ConstantTRACK[src]

Source Code

Source code
pub const TRACK = 1

ConstantDELETE[src]

Source Code

Source code
pub const DELETE = 1

ConstantLOWAT[src]

Source Code

Source code
pub const LOWAT = 1

ConstantTRACKERR[src]

Source Code

Source code
pub const TRACKERR = 2

ConstantOOB[src]

Source Code

Source code
pub const OOB = 2

ConstantWRITE[src]

Source Code

Source code
pub const WRITE = 2

ConstantEXTEND[src]

Source Code

Source code
pub const EXTEND = 4

ConstantCHILD[src]

Source Code

Source code
pub const CHILD = 4

ConstantATTRIB[src]

Source Code

Source code
pub const ATTRIB = 8
Source code
pub const LINK = 16

ConstantRENAME[src]

Source Code

Source code
pub const RENAME = 32

ConstantREVOKE[src]

Source Code

Source code
pub const REVOKE = 64

ConstantPDATAMASK[src]

Source Code

Source code
pub const PDATAMASK = 1048575

ConstantFFLAGSMASK[src]

Source Code

Source code
pub const FFLAGSMASK = 16777215

ConstantTRIGGER[src]

Source Code

Source code
pub const TRIGGER = 16777216

ConstantEXEC[src]

Source Code

Source code
pub const EXEC = 536870912

ConstantFFAND[src]

Source Code

Source code
pub const FFAND = 1073741824

ConstantFORK[src]

Source Code

Source code
pub const FORK = 1073741824

ConstantEXIT[src]

Source Code

Source code
pub const EXIT = 2147483648

ConstantFFOR[src]

Source Code

Source code
pub const FFOR = 2147483648

ConstantFFCTRLMASK[src]

Source Code

Source code
pub const FFCTRLMASK = 3221225472

ConstantFFCOPY[src]

Source Code

Source code
pub const FFCOPY = 3221225472

ConstantPCTRLMASK[src]

Source Code

Source code
pub const PCTRLMASK = 4026531840

ConstantTRIGGER[src]

On input, TRIGGER causes the event to be triggered for output.

Source Code

Source code
pub const TRIGGER = 0x08000000

ConstantLOWAT[src]

low water mark

Source Code

Source code
pub const LOWAT = 0x00000001

ConstantDELETE[src]

vnode was removed

Source Code

Source code
pub const DELETE = 0x00000001

ConstantWRITE[src]

data contents changed

Source Code

Source code
pub const WRITE = 0x00000002

ConstantEXTEND[src]

size increased

Source Code

Source code
pub const EXTEND = 0x00000004

ConstantATTRIB[src]

attributes changed

Source Code

Source code
pub const ATTRIB = 0x00000008

link count changed

Source code
pub const LINK = 0x00000010

ConstantRENAME[src]

vnode was renamed

Source Code

Source code
pub const RENAME = 0x00000020

ConstantREVOKE[src]

vnode access was revoked

Source Code

Source code
pub const REVOKE = 0x00000040

ConstantEXIT[src]

process exited

Source Code

Source code
pub const EXIT = 0x80000000

ConstantFORK[src]

process forked

Source Code

Source code
pub const FORK = 0x40000000

ConstantEXEC[src]

process exec'd

Source Code

Source code
pub const EXEC = 0x20000000

ConstantPDATAMASK[src]

mask for signal & exit status

Source Code

Source code
pub const PDATAMASK = 0x000fffff

ConstantPCTRLMASK[src]

Source Code

Source code
pub const PCTRLMASK = 0xf0000000

ConstantTRIGGER[src]

On input, TRIGGER causes the event to be triggered for output.

Source Code

Source code
pub const TRIGGER = 0x01000000

ConstantFFNOP[src]

ignore input fflags

Source Code

Source code
pub const FFNOP = 0x00000000

ConstantFFAND[src]

and fflags

Source Code

Source code
pub const FFAND = 0x40000000

ConstantFFOR[src]

or fflags

Source Code

Source code
pub const FFOR = 0x80000000

ConstantFFCOPY[src]

copy fflags

Source Code

Source code
pub const FFCOPY = 0xc0000000

ConstantFFCTRLMASK[src]

mask for operations

Source Code

Source code
pub const FFCTRLMASK = 0xc0000000

ConstantFFLAGSMASK[src]

Source Code

Source code
pub const FFLAGSMASK = 0x00ffffff

ConstantLOWAT[src]

low water mark

Source Code

Source code
pub const LOWAT = 0x00000001

ConstantFILE_POLL[src]

behave like poll()

Source Code

Source code
pub const FILE_POLL = 0x00000002

ConstantDELETE[src]

vnode was removed

Source Code

Source code
pub const DELETE = 0x00000001

ConstantWRITE[src]

data contents changed

Source Code

Source code
pub const WRITE = 0x00000002

ConstantEXTEND[src]

size increased

Source Code

Source code
pub const EXTEND = 0x00000004

ConstantATTRIB[src]

attributes changed

Source Code

Source code
pub const ATTRIB = 0x00000008

link count changed

Source code
pub const LINK = 0x00000010

ConstantRENAME[src]

vnode was renamed

Source Code

Source code
pub const RENAME = 0x00000020

ConstantREVOKE[src]

vnode access was revoked

Source Code

Source code
pub const REVOKE = 0x00000040

ConstantOPEN[src]

vnode was opened

Source Code

Source code
pub const OPEN = 0x00000080

ConstantCLOSE[src]

file closed, fd did not allow write

Source Code

Source code
pub const CLOSE = 0x00000100

ConstantCLOSE_WRITE[src]

file closed, fd did allow write

Source Code

Source code
pub const CLOSE_WRITE = 0x00000200

ConstantREAD[src]

file was read

Source Code

Source code
pub const READ = 0x00000400

ConstantEXIT[src]

process exited

Source Code

Source code
pub const EXIT = 0x80000000

ConstantFORK[src]

process forked

Source Code

Source code
pub const FORK = 0x40000000

ConstantEXEC[src]

process exec'd

Source Code

Source code
pub const EXEC = 0x20000000

ConstantPDATAMASK[src]

mask for signal & exit status

Source Code

Source code
pub const PDATAMASK = 0x000fffff

ConstantPCTRLMASK[src]

Source Code

Source code
pub const PCTRLMASK = 0xf0000000

ConstantSECONDS[src]

data is seconds

Source Code

Source code
pub const SECONDS = 0x00000001

ConstantMSECONDS[src]

data is milliseconds

Source Code

Source code
pub const MSECONDS = 0x00000002

ConstantUSECONDS[src]

data is microseconds

Source Code

Source code
pub const USECONDS = 0x00000004

ConstantNSECONDS[src]

data is nanoseconds

Source Code

Source code
pub const NSECONDS = 0x00000008

ConstantABSTIME[src]

timeout is absolute

Source Code

Source code
pub const ABSTIME = 0x00000010

ConstantLOWAT[src]

Source Code

Source code
pub const LOWAT = 0x0001

ConstantEOF[src]

Source Code

Source code
pub const EOF = 0x0002

ConstantOOB[src]

Source Code

Source code
pub const OOB = 0x0004

ConstantDELETE[src]

Source Code

Source code
pub const DELETE = 0x0001

ConstantWRITE[src]

Source Code

Source code
pub const WRITE = 0x0002

ConstantEXTEND[src]

Source Code

Source code
pub const EXTEND = 0x0004

ConstantATTRIB[src]

Source Code

Source code
pub const ATTRIB = 0x0008
Source code
pub const LINK = 0x0010

ConstantRENAME[src]

Source Code

Source code
pub const RENAME = 0x0020

ConstantREVOKE[src]

Source Code

Source code
pub const REVOKE = 0x0040

ConstantTRUNCATE[src]

Source Code

Source code
pub const TRUNCATE = 0x0080

ConstantEXIT[src]

Source Code

Source code
pub const EXIT = 0x80000000

ConstantFORK[src]

Source Code

Source code
pub const FORK = 0x40000000

ConstantEXEC[src]

Source Code

Source code
pub const EXEC = 0x20000000

ConstantPDATAMASK[src]

Source Code

Source code
pub const PDATAMASK = 0x000fffff

ConstantPCTRLMASK[src]

Source Code

Source code
pub const PCTRLMASK = 0xf0000000

ConstantTRACK[src]

Source Code

Source code
pub const TRACK = 0x00000001

ConstantTRACKERR[src]

Source Code

Source code
pub const TRACKERR = 0x00000002

ConstantCHILD[src]

Source Code

Source code
pub const CHILD = 0x00000004

ConstantCHANGE[src]

Source Code

Source code
pub const CHANGE = 0x00000001

Source Code

Source code
pub const NOTE = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        /// On input, TRIGGER causes the event to be triggered for output.
        pub const TRIGGER = 0x01000000;
        /// ignore input fflags
        pub const FFNOP = 0x00000000;
        /// and fflags
        pub const FFAND = 0x40000000;
        /// or fflags
        pub const FFOR = 0x80000000;
        /// copy fflags
        pub const FFCOPY = 0xc0000000;
        /// mask for operations
        pub const FFCTRLMASK = 0xc0000000;
        pub const FFLAGSMASK = 0x00ffffff;
        /// low water mark
        pub const LOWAT = 0x00000001;
        /// OOB data
        pub const OOB = 0x00000002;
        /// vnode was removed
        pub const DELETE = 0x00000001;
        /// data contents changed
        pub const WRITE = 0x00000002;
        /// size increased
        pub const EXTEND = 0x00000004;
        /// attributes changed
        pub const ATTRIB = 0x00000008;
        /// link count changed
        pub const LINK = 0x00000010;
        /// vnode was renamed
        pub const RENAME = 0x00000020;
        /// vnode access was revoked
        pub const REVOKE = 0x00000040;
        /// No specific vnode event: to test for EVFILT_READ      activation
        pub const NONE = 0x00000080;
        /// vnode was unlocked by flock(2)
        pub const FUNLOCK = 0x00000100;
        /// process exited
        pub const EXIT = 0x80000000;
        /// process forked
        pub const FORK = 0x40000000;
        /// process exec'd
        pub const EXEC = 0x20000000;
        /// shared with EVFILT_SIGNAL
        pub const SIGNAL = 0x08000000;
        /// exit status to be returned, valid for child       process only
        pub const EXITSTATUS = 0x04000000;
        /// provide details on reasons for exit
        pub const EXIT_DETAIL = 0x02000000;
        /// mask for signal & exit status
        pub const PDATAMASK = 0x000fffff;
        pub const PCTRLMASK = 0xf0000000;
        pub const EXIT_DETAIL_MASK = 0x00070000;
        pub const EXIT_DECRYPTFAIL = 0x00010000;
        pub const EXIT_MEMORY = 0x00020000;
        pub const EXIT_CSERROR = 0x00040000;
        /// will react on memory          pressure
        pub const VM_PRESSURE = 0x80000000;
        /// will quit on memory       pressure, possibly after cleaning up dirty state
        pub const VM_PRESSURE_TERMINATE = 0x40000000;
        /// will quit immediately on      memory pressure
        pub const VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000;
        /// there was an error
        pub const VM_ERROR = 0x10000000;
        /// data is seconds
        pub const SECONDS = 0x00000001;
        /// data is microseconds
        pub const USECONDS = 0x00000002;
        /// data is nanoseconds
        pub const NSECONDS = 0x00000004;
        /// absolute timeout
        pub const ABSOLUTE = 0x00000008;
        /// ext[1] holds leeway for power aware timers
        pub const LEEWAY = 0x00000010;
        /// system does minimal timer coalescing
        pub const CRITICAL = 0x00000020;
        /// system does maximum timer coalescing
        pub const BACKGROUND = 0x00000040;
        pub const MACH_CONTINUOUS_TIME = 0x00000080;
        /// data is mach absolute time units
        pub const MACHTIME = 0x00000100;
    },
    .dragonfly => struct {
        pub const FFNOP = 0;
        pub const TRACK = 1;
        pub const DELETE = 1;
        pub const LOWAT = 1;
        pub const TRACKERR = 2;
        pub const OOB = 2;
        pub const WRITE = 2;
        pub const EXTEND = 4;
        pub const CHILD = 4;
        pub const ATTRIB = 8;
        pub const LINK = 16;
        pub const RENAME = 32;
        pub const REVOKE = 64;
        pub const PDATAMASK = 1048575;
        pub const FFLAGSMASK = 16777215;
        pub const TRIGGER = 16777216;
        pub const EXEC = 536870912;
        pub const FFAND = 1073741824;
        pub const FORK = 1073741824;
        pub const EXIT = 2147483648;
        pub const FFOR = 2147483648;
        pub const FFCTRLMASK = 3221225472;
        pub const FFCOPY = 3221225472;
        pub const PCTRLMASK = 4026531840;
    },
    .netbsd => struct {
        /// On input, TRIGGER causes the event to be triggered for output.
        pub const TRIGGER = 0x08000000;
        /// low water mark
        pub const LOWAT = 0x00000001;
        /// vnode was removed
        pub const DELETE = 0x00000001;
        /// data contents changed
        pub const WRITE = 0x00000002;
        /// size increased
        pub const EXTEND = 0x00000004;
        /// attributes changed
        pub const ATTRIB = 0x00000008;
        /// link count changed
        pub const LINK = 0x00000010;
        /// vnode was renamed
        pub const RENAME = 0x00000020;
        /// vnode access was revoked
        pub const REVOKE = 0x00000040;
        /// process exited
        pub const EXIT = 0x80000000;
        /// process forked
        pub const FORK = 0x40000000;
        /// process exec'd
        pub const EXEC = 0x20000000;
        /// mask for signal & exit status
        pub const PDATAMASK = 0x000fffff;
        pub const PCTRLMASK = 0xf0000000;
    },
    .freebsd => struct {
        /// On input, TRIGGER causes the event to be triggered for output.
        pub const TRIGGER = 0x01000000;
        /// ignore input fflags
        pub const FFNOP = 0x00000000;
        /// and fflags
        pub const FFAND = 0x40000000;
        /// or fflags
        pub const FFOR = 0x80000000;
        /// copy fflags
        pub const FFCOPY = 0xc0000000;
        /// mask for operations
        pub const FFCTRLMASK = 0xc0000000;
        pub const FFLAGSMASK = 0x00ffffff;
        /// low water mark
        pub const LOWAT = 0x00000001;
        /// behave like poll()
        pub const FILE_POLL = 0x00000002;
        /// vnode was removed
        pub const DELETE = 0x00000001;
        /// data contents changed
        pub const WRITE = 0x00000002;
        /// size increased
        pub const EXTEND = 0x00000004;
        /// attributes changed
        pub const ATTRIB = 0x00000008;
        /// link count changed
        pub const LINK = 0x00000010;
        /// vnode was renamed
        pub const RENAME = 0x00000020;
        /// vnode access was revoked
        pub const REVOKE = 0x00000040;
        /// vnode was opened
        pub const OPEN = 0x00000080;
        /// file closed, fd did not allow write
        pub const CLOSE = 0x00000100;
        /// file closed, fd did allow write
        pub const CLOSE_WRITE = 0x00000200;
        /// file was read
        pub const READ = 0x00000400;
        /// process exited
        pub const EXIT = 0x80000000;
        /// process forked
        pub const FORK = 0x40000000;
        /// process exec'd
        pub const EXEC = 0x20000000;
        /// mask for signal & exit status
        pub const PDATAMASK = 0x000fffff;
        pub const PCTRLMASK = 0xf0000000;
        /// data is seconds
        pub const SECONDS = 0x00000001;
        /// data is milliseconds
        pub const MSECONDS = 0x00000002;
        /// data is microseconds
        pub const USECONDS = 0x00000004;
        /// data is nanoseconds
        pub const NSECONDS = 0x00000008;
        /// timeout is absolute
        pub const ABSTIME = 0x00000010;
    },
    .openbsd => struct {
        // data/hint flags for EVFILT.{READ|WRITE}
        pub const LOWAT = 0x0001;
        pub const EOF = 0x0002;
        // data/hint flags for EVFILT.EXCEPT and EVFILT.{READ|WRITE}
        pub const OOB = 0x0004;
        // data/hint flags for EVFILT.VNODE
        pub const DELETE = 0x0001;
        pub const WRITE = 0x0002;
        pub const EXTEND = 0x0004;
        pub const ATTRIB = 0x0008;
        pub const LINK = 0x0010;
        pub const RENAME = 0x0020;
        pub const REVOKE = 0x0040;
        pub const TRUNCATE = 0x0080;
        // data/hint flags for EVFILT.PROC
        pub const EXIT = 0x80000000;
        pub const FORK = 0x40000000;
        pub const EXEC = 0x20000000;
        pub const PDATAMASK = 0x000fffff;
        pub const PCTRLMASK = 0xf0000000;
        pub const TRACK = 0x00000001;
        pub const TRACKERR = 0x00000002;
        pub const CHILD = 0x00000004;
        // data/hint flags for EVFILT.DEVICE
        pub const CHANGE = 0x00000001;
    },
    else => void,
}

Typesf_hdtr[src]

Source Code

Source code
pub const sf_hdtr = switch (native_os) {
    .freebsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        headers: [*]const iovec_const,
        hdr_cnt: c_int,
        trailers: [*]const iovec_const,
        trl_cnt: c_int,
    },
    else => void,
}

Typepthread_t[src]

Source Code

Source code
pub const pthread_t = *opaque {}

Typemax_align_t[src]

Source Code

Source code
pub const max_align_t = if (native_abi == .msvc or native_abi == .itanium)
    f64
else if (native_os.isDarwin())
    c_longdouble
else
    extern struct {
        a: c_longlong,
        b: c_longdouble,
    }

Typeid_t[src]

Source Code

Source code
pub const id_t = i32

Typeid_t[src]

Source Code

Source code
pub const id_t = i32

Typemajor_t[src]

Source Code

Source code
pub const major_t = u32

Typeminor_t[src]

Source Code

Source code
pub const minor_t = u32

Typeid_t[src]

Source Code

Source code
pub const id_t = i32

Typeid_t[src]

Source Code

Source code
pub const id_t = i32

Typeid_t[src]

Source Code

Source code
pub const id_t = i32

Typeid_t[src]

Source Code

Source code
pub const id_t = i32

Typearea_id[src]

Source Code

Source code
pub const area_id = i32

Typeport_id[src]

Source Code

Source code
pub const port_id = i32

Typesem_id[src]

Source Code

Source code
pub const sem_id = i32

Typestatus_t[src]

Source Code

Source code
pub const status_t = i32

Typeteam_id[src]

Source Code

Source code
pub const team_id = i32

Typethread_id[src]

Source Code

Source code
pub const thread_id = i32

Typefflags_t[src]

Source Code

Source code
pub const fflags_t = u32

Typefsblkcnt_t[src]

Source Code

Source code
pub const fsblkcnt_t = u64

Typefsfilcnt_t[src]

Source Code

Source code
pub const fsfilcnt_t = u64

Typemach_port_t[src]

Source Code

Source code
pub const mach_port_t = c_uint

Typemach_port_t[src]

Source Code

Source code
pub const mach_port_t = c_uint

Typemach_port_t[src]

Source Code

Source code
pub const mach_port_t = c_uint

Typekern_return_t[src]

Source Code

Source code
pub const kern_return_t = c_int

Typemach_vm_size_t[src]

Source Code

Source code
pub const mach_vm_size_t = u64

Typenatural_t[src]

Source Code

Source code
pub const natural_t = c_uint

Typemach_port_array_t[src]

Source Code

Source code
pub const mach_port_array_t = [*]mach_port_t

Typenatural_t[src]

Source Code

Source code
pub const natural_t = c_uint

Typemach_port_t[src]

Source Code

Source code
pub const mach_port_t = c_uint

Typemach_vm_address_t[src]

Source Code

Source code
pub const mach_vm_address_t = usize

Typemach_vm_size_t[src]

Source Code

Source code
pub const mach_vm_size_t = u64

Typenatural_t[src]

Source Code

Source code
pub const natural_t = c_uint

Typeposix_spawn_file_actions_t[src]

Source Code

Source code
pub const posix_spawn_file_actions_t = *opaque {}

Typeposix_spawnattr_t[src]

Source Code

Source code
pub const posix_spawnattr_t = *opaque {}

Typetask_info_t[src]

Source Code

Source code
pub const task_info_t = *integer_t

Typethread_info_t[src]

Source Code

Source code
pub const thread_info_t = *integer_t

Typevm_machine_attribute_val_t[src]

Source Code

Source code
pub const vm_machine_attribute_val_t = isize

Typemach_port_t[src]

Source Code

Source code
pub const mach_port_t = c_uint

Typevm_offset_t[src]

Source Code

Source code
pub const vm_offset_t = usize

Typevm_prot_t[src]

Source Code

Source code
pub const vm_prot_t = c_int

Typevm_region_info_t[src]

Source Code

Source code
pub const vm_region_info_t = *c_int

Typevm_region_recurse_info_t[src]

Source Code

Source code
pub const vm_region_recurse_info_t = *c_int

Typecaddr_t[src]

Source Code

Source code
pub const caddr_t = ?[*]u8

Typeexception_behavior_array_t[src]

Source Code

Source code
pub const exception_behavior_array_t = [*]exception_behavior_t

Typeexception_behavior_t[src]

Source Code

Source code
pub const exception_behavior_t = c_uint

Typeexception_data_t[src]

Source Code

Source code
pub const exception_data_t = ?*mach_exception_data_type_t

Typeinteger_t[src]

Source Code

Source code
pub const integer_t = c_int

Typeexception_flavor_array_t[src]

Source Code

Source code
pub const exception_flavor_array_t = [*]thread_state_flavor_t

Typeexception_handler_array_t[src]

Source Code

Source code
pub const exception_handler_array_t = [*]exception_handler_t

Typemach_port_t[src]

Source Code

Source code
pub const mach_port_t = c_uint

Typeexception_mask_array_t[src]

Source Code

Source code
pub const exception_mask_array_t = [*]exception_mask_t

Typeexception_mask_t[src]

Source Code

Source code
pub const exception_mask_t = c_uint

Typeexception_handler_array_t[src]

Source Code

Source code
pub const exception_handler_array_t = [*]exception_handler_t

Typemach_port_t[src]

Source Code

Source code
pub const mach_port_t = c_uint

Typemach_exception_data_t[src]

Source Code

Source code
pub const mach_exception_data_t = ?*mach_exception_data_type_t

Typemach_exception_data_type_t[src]

Source Code

Source code
pub const mach_exception_data_type_t = i64

Typemach_msg_bits_t[src]

Source Code

Source code
pub const mach_msg_bits_t = c_uint

Typeinteger_t[src]

Source Code

Source code
pub const integer_t = c_int

Typeinteger_t[src]

Source Code

Source code
pub const integer_t = c_int

Typenatural_t[src]

Source Code

Source code
pub const natural_t = c_uint

Typenatural_t[src]

Source Code

Source code
pub const natural_t = c_uint

Typemach_msg_type_name_t[src]

Source Code

Source code
pub const mach_msg_type_name_t = c_uint

Typenatural_t[src]

Source Code

Source code
pub const natural_t = c_uint

Typememory_object_offset_t[src]

Source Code

Source code
pub const memory_object_offset_t = u64

Typepolicy_t[src]

Source Code

Source code
pub const policy_t = c_int

Typenatural_t[src]

Source Code

Source code
pub const natural_t = c_uint

Typetask_policy_t[src]

Source Code

Source code
pub const task_policy_t = *integer_t

Typemach_port_t[src]

Source Code

Source code
pub const mach_port_t = c_uint

Typemach_port_t[src]

Source Code

Source code
pub const mach_port_t = c_uint

Typenatural_t[src]

Source Code

Source code
pub const natural_t = c_uint

Typemach_port_t[src]

Source Code

Source code
pub const mach_port_t = c_uint

Typethread_state_flavor_t[src]

Source Code

Source code
pub const thread_state_flavor_t = c_int

Typethread_state_t[src]

Source Code

Source code
pub const thread_state_t = *natural_t

Typemach_port_t[src]

Source Code

Source code
pub const mach_port_t = c_uint

Typevm32_object_id_t[src]

Source Code

Source code
pub const vm32_object_id_t = u32

Typevm_behavior_t[src]

Source Code

Source code
pub const vm_behavior_t = i32

Typevm_inherit_t[src]

Source Code

Source code
pub const vm_inherit_t = u32

Typemach_port_t[src]

Source Code

Source code
pub const mach_port_t = c_uint

Typevm_object_id_t[src]

Source Code

Source code
pub const vm_object_id_t = u64

Typevm_region_flavor_t[src]

Source Code

Source code
pub const vm_region_flavor_t = c_int

Typelwpid_t[src]

Source Code

Source code
pub const lwpid_t = i32

Global Variables

Global Variable_mh_execute_header[src]

The value of the link editor defined symbol _MH_EXECUTE_SYM is the address of the mach header in a Mach-O executable file type. It does not appear in any file type other than a MH_EXECUTE file type. The type of the symbol is absolute as the header is not part of any section. This symbol is populated when linking the system's libc, which is guaranteed on this operating system. However when building object files or libraries, the system libc won't be linked until the final executable. So we export a weak symbol here, to be overridden by the real one.

Source Code

Source code
pub extern var _mh_execute_header: mach_hdr

Global Variableenviron[src]

Source Code

Source code
pub extern "c" var environ: [*:null]?[*:0]u8

Values

ConstantFD_CLOEXEC[src]

Source Code

Source code
pub const FD_CLOEXEC = switch (native_os) {
    .linux => linux.FD_CLOEXEC,
    .emscripten => emscripten.FD_CLOEXEC,
    else => 1,
}

ConstantF_OK[src]

Test for existence of file.

Source Code

Source code
pub const F_OK = switch (native_os) {
    .linux => linux.F_OK,
    .emscripten => emscripten.F_OK,
    else => 0,
}

ConstantX_OK[src]

Test for execute or search permission.

Source Code

Source code
pub const X_OK = switch (native_os) {
    .linux => linux.X_OK,
    .emscripten => emscripten.X_OK,
    else => 1,
}

ConstantW_OK[src]

Test for write permission.

Source Code

Source code
pub const W_OK = switch (native_os) {
    .linux => linux.W_OK,
    .emscripten => emscripten.W_OK,
    else => 2,
}

ConstantR_OK[src]

Test for read permission.

Source Code

Source code
pub const R_OK = switch (native_os) {
    .linux => linux.R_OK,
    .emscripten => emscripten.R_OK,
    else => 4,
}

ConstantHOST_NAME_MAX[src]

Source Code

Source code
pub const HOST_NAME_MAX = switch (native_os) {
    .linux => linux.HOST_NAME_MAX,
    .macos, .ios, .tvos, .watchos, .visionos => 72,
    .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd => 255,
    else => {},
}

ConstantIOV_MAX[src]

Source Code

Source code
pub const IOV_MAX = switch (native_os) {
    .linux => linux.IOV_MAX,
    .emscripten => emscripten.IOV_MAX,
    .openbsd, .haiku, .solaris, .illumos, .wasi => 1024,
    .macos, .ios, .tvos, .watchos, .visionos => 16,
    .dragonfly, .netbsd, .freebsd => KERN.IOV_MAX,
    else => {},
}

ConstantNAME_MAX[src]

Source Code

Source code
pub const NAME_MAX = switch (native_os) {
    .linux => linux.NAME_MAX,
    .emscripten => emscripten.NAME_MAX,
    // Haiku's headers make this 256, to contain room for the terminating null
    // character, but POSIX definition says that NAME_MAX does not include the
    // terminating null.
    .haiku, .openbsd, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => 255,
    else => {},
}

ConstantPATH_MAX[src]

Source Code

Source code
pub const PATH_MAX = switch (native_os) {
    .linux => linux.PATH_MAX,
    .emscripten => emscripten.PATH_MAX,
    .wasi => 4096,
    .windows => 260,
    .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => 1024,
    else => {},
}

ConstantSTDIN_FILENO[src]

Source Code

Source code
pub const STDIN_FILENO = switch (native_os) {
    .linux => linux.STDIN_FILENO,
    .emscripten => emscripten.STDIN_FILENO,
    else => 0,
}

ConstantSTDOUT_FILENO[src]

Source Code

Source code
pub const STDOUT_FILENO = switch (native_os) {
    .linux => linux.STDOUT_FILENO,
    .emscripten => emscripten.STDOUT_FILENO,
    else => 1,
}

ConstantSTDERR_FILENO[src]

Source Code

Source code
pub const STDERR_FILENO = switch (native_os) {
    .linux => linux.STDERR_FILENO,
    .emscripten => emscripten.STDERR_FILENO,
    else => 2,
}

Constantempty_sigset[src]

Source Code

Source code
pub const empty_sigset: sigset_t = switch (native_os) {
    .linux => linux.empty_sigset,
    .emscripten => emscripten.empty_sigset,
    .dragonfly, .netbsd, .solaris, .illumos, .freebsd => .{ .__bits = [_]u32{0} ** SIG.WORDS },
    else => 0,
}

Constantfilled_sigset[src]

Source Code

Source code
pub const filled_sigset = switch (native_os) {
    .linux => linux.filled_sigset,
    .haiku => ~@as(sigset_t, 0),
    else => 0,
}

Constant_errno[src]

Source Code

Source code
pub const _errno = switch (native_os) {
    .linux => switch (native_abi) {
        .android, .androideabi => private.__errno,
        else => private.__errno_location,
    },
    .emscripten => private.__errno_location,
    .wasi, .dragonfly => private.errnoFromThreadLocal,
    .windows => private._errno,
    .macos, .ios, .tvos, .watchos, .visionos, .freebsd => private.__error,
    .solaris, .illumos => private.___errno,
    .openbsd, .netbsd => private.__errno,
    .haiku => haiku._errnop,
    else => {},
}

ConstantMAXNAMLEN[src]

Source Code

Source code
pub const MAXNAMLEN = switch (native_os) {
    .netbsd, .solaris, .illumos => 511,
    .haiku => NAME_MAX,
    .openbsd => 255,
    else => {},
}

ConstantMAP_FAILED[src]

Used by libc to communicate failure. Not actually part of the underlying syscall.

Source Code

Source code
pub const MAP_FAILED: *anyopaque = @ptrFromInt(maxInt(usize))

ConstantNSIG[src]

maximum signal number + 1

Source Code

Source code
pub const NSIG = switch (native_os) {
    .linux => linux.NSIG,
    .windows => 23,
    .haiku => 65,
    .netbsd, .freebsd => 32,
    .solaris, .illumos => 75,
    .openbsd => 33,
    else => {},
}

ConstantMINSIGSTKSZ[src]

Source Code

Source code
pub const MINSIGSTKSZ = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => 32768,
    .freebsd => switch (builtin.cpu.arch) {
        .x86, .x86_64 => 2048,
        .arm, .aarch64 => 4096,
        else => @compileError("unsupported arch"),
    },
    .solaris, .illumos => 2048,
    .haiku, .netbsd => 8192,
    .openbsd => 1 << openbsd.MAX_PAGE_SHIFT,
    else => {},
}

ConstantSIGSTKSZ[src]

Source Code

Source code
pub const SIGSTKSZ = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => 131072,
    .netbsd, .freebsd => MINSIGSTKSZ + 32768,
    .solaris, .illumos => 8192,
    .haiku => 16384,
    .openbsd => MINSIGSTKSZ + (1 << openbsd.MAX_PAGE_SHIFT) * 4,
    else => {},
}

Constantclose[src]

Source Code

Source code
pub const close = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => darwin.@"close$NOCANCEL",
    else => private.close,
}

Constantclock_getres[src]

Source Code

Source code
pub const clock_getres = switch (native_os) {
    .netbsd => private.__clock_getres50,
    else => private.clock_getres,
}

Constantclock_gettime[src]

Source Code

Source code
pub const clock_gettime = switch (native_os) {
    .netbsd => private.__clock_gettime50,
    else => private.clock_gettime,
}

Constantfstat[src]

Source Code

Source code
pub const fstat = switch (native_os) {
    .macos => switch (native_arch) {
        .x86_64 => private.@"fstat$INODE64",
        else => private.fstat,
    },
    .netbsd => private.__fstat50,
    else => private.fstat,
}

Constantfstatat[src]

Source Code

Source code
pub const fstatat = switch (native_os) {
    .macos => switch (native_arch) {
        .x86_64 => private.@"fstatat$INODE64",
        else => private.fstatat,
    },
    else => private.fstatat,
}

Constantarc4random_buf[src]

Source Code

Source code
pub const arc4random_buf = switch (native_os) {
    .dragonfly, .netbsd, .freebsd, .solaris, .openbsd, .macos, .ios, .tvos, .watchos, .visionos => private.arc4random_buf,
    .linux => if (builtin.abi.isAndroid()) private.arc4random_buf else {},
    else => {},
}

Constantgetentropy[src]

Source Code

Source code
pub const getentropy = switch (native_os) {
    .linux => if (builtin.abi.isAndroid() and versionCheck(.{ .major = 28, .minor = 0, .patch = 0 })) private.getentropy else {},
    .emscripten => private.getentropy,
    else => {},
}

Constantgetrandom[src]

Source Code

Source code
pub const getrandom = switch (native_os) {
    .freebsd => private.getrandom,
    .linux => if (builtin.abi.isMusl() or
        (builtin.abi.isGnu() and versionCheck(.{ .major = 2, .minor = 25, .patch = 0 })) or
        (builtin.abi.isAndroid() and versionCheck(.{ .major = 28, .minor = 0, .patch = 0 })))
        private.getrandom
    else {},
    else => {},
}

Constantsendfile[src]

Source Code

Source code
pub const sendfile = switch (native_os) {
    .freebsd => freebsd.sendfile,
    .macos, .ios, .tvos, .watchos, .visionos => darwin.sendfile,
    .linux => private.sendfile,
    else => {},
}

Constantsigaltstack[src]

Source Code

Source code
pub const sigaltstack = switch (native_os) {
    .netbsd => private.__sigaltstack14,
    else => private.sigaltstack,
}

Constantpipe2[src]

Source Code

Source code
pub const pipe2 = switch (native_os) {
    .dragonfly, .emscripten, .netbsd, .freebsd, .solaris, .illumos, .openbsd, .linux => private.pipe2,
    else => {},
}

Constantcopy_file_range[src]

Source Code

Source code
pub const copy_file_range = switch (native_os) {
    .linux => private.copy_file_range,
    .freebsd => freebsd.copy_file_range,
    else => {},
}

Constantgetdirentries[src]

Source Code

Source code
pub const getdirentries = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => private.__getdirentries64,
    else => private.getdirentries,
}

Constantgetdents[src]

Source Code

Source code
pub const getdents = switch (native_os) {
    .netbsd => private.__getdents30,
    else => private.getdents,
}

Constantgetrusage[src]

Source Code

Source code
pub const getrusage = switch (native_os) {
    .netbsd => private.__getrusage50,
    else => private.getrusage,
}

Constantgettimeofday[src]

Source Code

Source code
pub const gettimeofday = switch (native_os) {
    .netbsd => private.__gettimeofday50,
    else => private.gettimeofday,
}

Constantmsync[src]

Source Code

Source code
pub const msync = switch (native_os) {
    .netbsd => private.__msync13,
    else => private.msync,
}

Constantnanosleep[src]

Source Code

Source code
pub const nanosleep = switch (native_os) {
    .netbsd => private.__nanosleep50,
    else => private.nanosleep,
}

Constantreaddir[src]

Source Code

Source code
pub const readdir = switch (native_os) {
    .macos => switch (native_arch) {
        .x86_64 => private.@"readdir$INODE64",
        else => private.readdir,
    },
    .windows => {},
    else => private.readdir,
}

Constantrealpath[src]

Source Code

Source code
pub const realpath = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => private.@"realpath$DARWIN_EXTSN",
    else => private.realpath,
}

Constantsched_yield[src]

Source Code

Source code
pub const sched_yield = switch (native_os) {
    .netbsd => private.__libc_thr_yield,
    else => private.sched_yield,
}

Constantsigaction[src]

Source Code

Source code
pub const sigaction = switch (native_os) {
    .netbsd => private.__sigaction14,
    else => private.sigaction,
}

Constantsigfillset[src]

Source Code

Source code
pub const sigfillset = switch (native_os) {
    .netbsd => private.__sigfillset14,
    else => private.sigfillset,
}

Constantsigprocmask[src]

Source Code

Source code
pub const sigprocmask = switch (native_os) {
    .netbsd => private.__sigprocmask14,
    else => private.sigprocmask,
}

Constantsocket[src]

Source Code

Source code
pub const socket = switch (native_os) {
    .netbsd => private.__socket30,
    else => private.socket,
}

Constantstat[src]

Source Code

Source code
pub const stat = switch (native_os) {
    .macos => switch (native_arch) {
        .x86_64 => private.@"stat$INODE64",
        else => private.stat,
    },
    else => private.stat,
}

Constant_msize[src]

Source Code

Source code
pub const _msize = switch (native_os) {
    .windows => private._msize,
    else => {},
}

Constantmalloc_size[src]

Source Code

Source code
pub const malloc_size = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => private.malloc_size,
    else => {},
}

Constantmalloc_usable_size[src]

Source Code

Source code
pub const malloc_usable_size = switch (native_os) {
    .freebsd, .linux => private.malloc_usable_size,
    else => {},
}

Constantposix_memalign[src]

Source Code

Source code
pub const posix_memalign = switch (native_os) {
    .dragonfly, .netbsd, .freebsd, .solaris, .openbsd, .linux, .macos, .ios, .tvos, .watchos, .visionos => private.posix_memalign,
    else => {},
}

Constantsysconf[src]

Source Code

Source code
pub const sysconf = switch (native_os) {
    .solaris => solaris.sysconf,
    else => private.sysconf,
}

Constantflock[src]

Source Code

Source code
pub const flock = switch (native_os) {
    .windows, .wasi => {},
    else => private.flock,
}

Constantfork[src]

Source Code

Source code
pub const fork = switch (native_os) {
    .dragonfly,
    .freebsd,
    .ios,
    .linux,
    .macos,
    .netbsd,
    .openbsd,
    .solaris,
    .illumos,
    .tvos,
    .watchos,
    .visionos,
    .haiku,
    => private.fork,
    else => {},
}

Constantpthread_setname_np[src]

Source Code

Source code
pub const pthread_setname_np = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => darwin.pthread_setname_np,
    .solaris, .illumos => solaris.pthread_setname_np,
    .netbsd => netbsd.pthread_setname_np,
    else => private.pthread_setname_np,
}

Constantpthread_threadid_np[src]

Source Code

Source code
pub const pthread_threadid_np = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => private.pthread_threadid_np,
    else => {},
}

ConstantPTHREAD_MUTEX_INITIALIZER[src]

Source Code

Source code
pub const PTHREAD_MUTEX_INITIALIZER = pthread_mutex_t{}

ConstantPTHREAD_COND_INITIALIZER[src]

Source Code

Source code
pub const PTHREAD_COND_INITIALIZER = pthread_cond_t{}

Constantgetcontext[src]

Source Code

Source code
pub const getcontext = if (builtin.target.abi.isAndroid() or builtin.target.os.tag == .openbsd)
{} // android bionic and openbsd libc does not implement getcontext
    else if (native_os == .linux and builtin.target.abi.isMusl())
        linux.getcontext
    else
        private.getcontext

ConstantGETCONTEXT[src]

Source Code

Source code
pub const GETCONTEXT = 0

ConstantGETUSTACK[src]

Source Code

Source code
pub const GETUSTACK = 2

ConstantSETCONTEXT[src]

Source Code

Source code
pub const SETCONTEXT = 1

ConstantGETUSTACK[src]

Source Code

Source code
pub const GETUSTACK = 2

Constant_kern_get_current_team[src]

Source Code

Source code
pub const _kern_get_current_team = haiku._kern_get_current_team

Constant_kern_open_dir[src]

Source Code

Source code
pub const _kern_open_dir = haiku._kern_open_dir

Constant_kern_read_dir[src]

Source Code

Source code
pub const _kern_read_dir = haiku._kern_read_dir

Constant_kern_read_stat[src]

Source Code

Source code
pub const _kern_read_stat = haiku._kern_read_stat

Constant_kern_rewind_dir[src]

Source Code

Source code
pub const _kern_rewind_dir = haiku._kern_rewind_dir

ConstantPTHREAD_STACK_MIN[src]

Source Code

Source code
pub const PTHREAD_STACK_MIN = switch (builtin.cpu.arch) {
    .sparc64 => 1 << 13,
    .mips64 => 1 << 14,
    else => 1 << 12,
}

ConstantCAP_RIGHTS_VERSION[src]

Source Code

Source code
pub const CAP_RIGHTS_VERSION = 0

ConstantKINFO_FILE_SIZE[src]

Source Code

Source code
pub const KINFO_FILE_SIZE = 1392

ConstantUMTX_ABSTIME[src]

Source Code

Source code
pub const UMTX_ABSTIME = 0x01

ConstantMACH_TASK_BASIC_INFO[src]

Source Code

Source code
pub const MACH_TASK_BASIC_INFO = 20

ConstantMACH_TASK_BASIC_INFO_COUNT[src]

Source Code

Source code
pub const MACH_TASK_BASIC_INFO_COUNT: mach_msg_type_number_t = @sizeOf(mach_task_basic_info) / @sizeOf(natural_t)

ConstantOPEN_MAX[src]

Source Code

Source code
pub const OPEN_MAX = 10240

ConstantTASK_NULL[src]

Source Code

Source code
pub const TASK_NULL: task_t = 0

ConstantTASK_VM_INFO[src]

Source Code

Source code
pub const TASK_VM_INFO = 22

ConstantTASK_VM_INFO_COUNT[src]

Source Code

Source code
pub const TASK_VM_INFO_COUNT: mach_msg_type_number_t = @sizeOf(task_vm_info_data_t) / @sizeOf(natural_t)

ConstantTHREAD_BASIC_INFO[src]

Source Code

Source code
pub const THREAD_BASIC_INFO = 3

ConstantTHREAD_BASIC_INFO_COUNT[src]

Source Code

Source code
pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t = @sizeOf(thread_basic_info) / @sizeOf(natural_t)

ConstantTHREAD_IDENTIFIER_INFO_COUNT[src]

Source Code

Source code
pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t = @sizeOf(thread_identifier_info) / @sizeOf(natural_t)

ConstantTHREAD_NULL[src]

Source Code

Source code
pub const THREAD_NULL: thread_t = 0

ConstantTHREAD_STATE_NONE[src]

Source Code

Source code
pub const THREAD_STATE_NONE = switch (native_arch) {
    .aarch64 => 5,
    .x86_64 => 13,
    else => @compileError("unsupported arch"),
}

Constantmach_hdr[src]

Source Code

Source code
pub const mach_hdr = if (@sizeOf(usize) == 8) mach_header_64 else mach_header

Functions

FunctionversionCheck[src]

pub inline fn versionCheck(comptime version: std.SemanticVersion) bool
  • If not linking libc, returns false.
  • If linking musl libc, returns true.
  • If linking GNU libc (glibc), returns true if the target version is greater than or equal to version.
  • If linking Android libc (bionic), returns true if the target API level is greater than or equal to version.major, ignoring other components.
  • If linking a libc other than these, returns false.

Parameters

Source Code

Source code
pub inline fn versionCheck(comptime version: std.SemanticVersion) bool {
    return comptime blk: {
        if (!builtin.link_libc) break :blk false;
        if (native_abi.isMusl()) break :blk true;
        if (builtin.target.isGnuLibC()) {
            const ver = builtin.os.versionRange().gnuLibCVersion().?;
            break :blk switch (ver.order(version)) {
                .gt, .eq => true,
                .lt => false,
            };
        } else if (builtin.abi.isAndroid()) {
            break :blk builtin.os.version_range.linux.android >= version.major;
        } else {
            break :blk false;
        }
    };
}

Functionopendir[src]

pub extern "c" fn opendir(pathname: [*:0]const u8) ?*DIR

Parameters

pathname: [*:0]const u8

Source Code

Source code
pub extern "c" fn opendir(pathname: [*:0]const u8) ?*DIR

Functionfdopendir[src]

pub extern "c" fn fdopendir(fd: c_int) ?*DIR

Parameters

fd: c_int

Source Code

Source code
pub extern "c" fn fdopendir(fd: c_int) ?*DIR

Functionrewinddir[src]

pub extern "c" fn rewinddir(dp: *DIR) void

Parameters

dp: *DIR

Source Code

Source code
pub extern "c" fn rewinddir(dp: *DIR) void

Functionclosedir[src]

pub extern "c" fn closedir(dp: *DIR) c_int

Parameters

dp: *DIR

Source Code

Source code
pub extern "c" fn closedir(dp: *DIR) c_int

Functiontelldir[src]

pub extern "c" fn telldir(dp: *DIR) c_long

Parameters

dp: *DIR

Source Code

Source code
pub extern "c" fn telldir(dp: *DIR) c_long

Functionseekdir[src]

pub extern "c" fn seekdir(dp: *DIR, loc: c_long) void

Parameters

dp: *DIR
loc: c_long

Source Code

Source code
pub extern "c" fn seekdir(dp: *DIR, loc: c_long) void

Functionsigwait[src]

pub extern "c" fn sigwait(set: ?*sigset_t, sig: ?*c_int) c_int

Parameters

set: ?*sigset_t
sig: ?*c_int

Source Code

Source code
pub extern "c" fn sigwait(set: ?*sigset_t, sig: ?*c_int) c_int

Functionalarm[src]

pub extern "c" fn alarm(seconds: c_uint) c_uint

Parameters

seconds: c_uint

Source Code

Source code
pub extern "c" fn alarm(seconds: c_uint) c_uint

Functiongetpwnam[src]

pub extern "c" fn getpwnam(name: [*:0]const u8) ?*passwd

Parameters

name: [*:0]const u8

Source Code

Source code
pub extern "c" fn getpwnam(name: [*:0]const u8) ?*passwd

Functiongetpwuid[src]

pub extern "c" fn getpwuid(uid: uid_t) ?*passwd

Parameters

uid: uid_t

Source Code

Source code
pub extern "c" fn getpwuid(uid: uid_t) ?*passwd

Functiongetrlimit64[src]

pub extern "c" fn getrlimit64(resource: rlimit_resource, rlim: *rlimit) c_int

Parameters

resource: rlimit_resource
rlim: *rlimit

Source Code

Source code
pub extern "c" fn getrlimit64(resource: rlimit_resource, rlim: *rlimit) c_int

Functionlseek64[src]

pub extern "c" fn lseek64(fd: fd_t, offset: i64, whence: c_int) i64

Parameters

fd: fd_t
offset: i64
whence: c_int

Source Code

Source code
pub extern "c" fn lseek64(fd: fd_t, offset: i64, whence: c_int) i64

Functionmmap64[src]

pub extern "c" fn mmap64(addr: ?*align(page_size) anyopaque, len: usize, prot: c_uint, flags: c_uint, fd: fd_t, offset: i64) *anyopaque

Parameters

addr: ?*align(page_size) anyopaque
len: usize
prot: c_uint
flags: c_uint
fd: fd_t
offset: i64

Source Code

Source code
pub extern "c" fn mmap64(addr: ?*align(page_size) anyopaque, len: usize, prot: c_uint, flags: c_uint, fd: fd_t, offset: i64) *anyopaque

Functionopen64[src]

pub extern "c" fn open64(path: [*:0]const u8, oflag: O, ...) c_int

Parameters

path: [*:0]const u8
oflag: O

Source Code

Source code
pub extern "c" fn open64(path: [*:0]const u8, oflag: O, ...) c_int

Functionopenat64[src]

pub extern "c" fn openat64(fd: c_int, path: [*:0]const u8, oflag: O, ...) c_int

Parameters

fd: c_int
path: [*:0]const u8
oflag: O

Source Code

Source code
pub extern "c" fn openat64(fd: c_int, path: [*:0]const u8, oflag: O, ...) c_int

Functionpread64[src]

pub extern "c" fn pread64(fd: fd_t, buf: [*]u8, nbyte: usize, offset: i64) isize

Parameters

fd: fd_t
buf: [*]u8
nbyte: usize
offset: i64

Source Code

Source code
pub extern "c" fn pread64(fd: fd_t, buf: [*]u8, nbyte: usize, offset: i64) isize

Functionpreadv64[src]

pub extern "c" fn preadv64(fd: c_int, iov: [*]const iovec, iovcnt: c_uint, offset: i64) isize

Parameters

fd: c_int
iov: [*]const iovec
iovcnt: c_uint
offset: i64

Source Code

Source code
pub extern "c" fn preadv64(fd: c_int, iov: [*]const iovec, iovcnt: c_uint, offset: i64) isize

Functionpwrite64[src]

pub extern "c" fn pwrite64(fd: fd_t, buf: [*]const u8, nbyte: usize, offset: i64) isize

Parameters

fd: fd_t
buf: [*]const u8
nbyte: usize
offset: i64

Source Code

Source code
pub extern "c" fn pwrite64(fd: fd_t, buf: [*]const u8, nbyte: usize, offset: i64) isize

Functionpwritev64[src]

pub extern "c" fn pwritev64(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint, offset: i64) isize

Parameters

fd: c_int
iov: [*]const iovec_const
iovcnt: c_uint
offset: i64

Source Code

Source code
pub extern "c" fn pwritev64(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint, offset: i64) isize

Functionsendfile64[src]

pub extern "c" fn sendfile64(out_fd: fd_t, in_fd: fd_t, offset: ?*i64, count: usize) isize

Parameters

out_fd: fd_t
in_fd: fd_t
offset: ?*i64
count: usize

Source Code

Source code
pub extern "c" fn sendfile64(out_fd: fd_t, in_fd: fd_t, offset: ?*i64, count: usize) isize

Functionsetrlimit64[src]

pub extern "c" fn setrlimit64(resource: rlimit_resource, rlim: *const rlimit) c_int

Parameters

resource: rlimit_resource
rlim: *const rlimit

Source Code

Source code
pub extern "c" fn setrlimit64(resource: rlimit_resource, rlim: *const rlimit) c_int

Functionsched_getaffinity[src]

pub extern "c" fn sched_getaffinity(pid: c_int, size: usize, set: *cpu_set_t) c_int

Parameters

pid: c_int
size: usize
set: *cpu_set_t

Source Code

Source code
pub extern "c" fn sched_getaffinity(pid: c_int, size: usize, set: *cpu_set_t) c_int

Functioneventfd[src]

pub extern "c" fn eventfd(initval: c_uint, flags: c_uint) c_int

Parameters

initval: c_uint
flags: c_uint

Source Code

Source code
pub extern "c" fn eventfd(initval: c_uint, flags: c_uint) c_int

Functionepoll_ctl[src]

pub extern "c" fn epoll_ctl(epfd: fd_t, op: c_uint, fd: fd_t, event: ?*epoll_event) c_int

Parameters

epfd: fd_t
op: c_uint
fd: fd_t
event: ?*epoll_event

Source Code

Source code
pub extern "c" fn epoll_ctl(epfd: fd_t, op: c_uint, fd: fd_t, event: ?*epoll_event) c_int

Functionepoll_create1[src]

pub extern "c" fn epoll_create1(flags: c_uint) c_int

Parameters

flags: c_uint

Source Code

Source code
pub extern "c" fn epoll_create1(flags: c_uint) c_int

Functionepoll_wait[src]

pub extern "c" fn epoll_wait(epfd: fd_t, events: [*]epoll_event, maxevents: c_uint, timeout: c_int) c_int

Parameters

epfd: fd_t
events: [*]epoll_event
maxevents: c_uint
timeout: c_int

Source Code

Source code
pub extern "c" fn epoll_wait(epfd: fd_t, events: [*]epoll_event, maxevents: c_uint, timeout: c_int) c_int

Functionepoll_pwait[src]

pub extern "c" fn epoll_pwait( epfd: fd_t, events: [*]epoll_event, maxevents: c_int, timeout: c_int, sigmask: *const sigset_t, ) c_int

Parameters

epfd: fd_t
events: [*]epoll_event
maxevents: c_int
timeout: c_int
sigmask: *const sigset_t

Source Code

Source code
pub extern "c" fn epoll_pwait(
    epfd: fd_t,
    events: [*]epoll_event,
    maxevents: c_int,
    timeout: c_int,
    sigmask: *const sigset_t,
) c_int

Functiontimerfd_create[src]

pub extern "c" fn timerfd_create(clockid: timerfd_clockid_t, flags: c_int) c_int

Parameters

flags: c_int

Source Code

Source code
pub extern "c" fn timerfd_create(clockid: timerfd_clockid_t, flags: c_int) c_int

Functiontimerfd_settime[src]

pub extern "c" fn timerfd_settime( fd: c_int, flags: c_int, new_value: *const itimerspec, old_value: ?*itimerspec, ) c_int

Parameters

fd: c_int
flags: c_int
new_value: *const itimerspec
old_value: ?*itimerspec

Source Code

Source code
pub extern "c" fn timerfd_settime(
    fd: c_int,
    flags: c_int,
    new_value: *const itimerspec,
    old_value: ?*itimerspec,
) c_int

Functiontimerfd_gettime[src]

pub extern "c" fn timerfd_gettime(fd: c_int, curr_value: *itimerspec) c_int

Parameters

fd: c_int
curr_value: *itimerspec

Source Code

Source code
pub extern "c" fn timerfd_gettime(fd: c_int, curr_value: *itimerspec) c_int

Functioninotify_init1[src]

pub extern "c" fn inotify_init1(flags: c_uint) c_int

Parameters

flags: c_uint

Source Code

Source code
pub extern "c" fn inotify_init1(flags: c_uint) c_int

Functioninotify_add_watch[src]

pub extern "c" fn inotify_add_watch(fd: fd_t, pathname: [*:0]const u8, mask: u32) c_int

Parameters

fd: fd_t
pathname: [*:0]const u8
mask: u32

Source Code

Source code
pub extern "c" fn inotify_add_watch(fd: fd_t, pathname: [*:0]const u8, mask: u32) c_int

Functioninotify_rm_watch[src]

pub extern "c" fn inotify_rm_watch(fd: fd_t, wd: c_int) c_int

Parameters

fd: fd_t
wd: c_int

Source Code

Source code
pub extern "c" fn inotify_rm_watch(fd: fd_t, wd: c_int) c_int

Functionfstat64[src]

pub extern "c" fn fstat64(fd: fd_t, buf: *Stat) c_int

Parameters

fd: fd_t
buf: *Stat

Source Code

Source code
pub extern "c" fn fstat64(fd: fd_t, buf: *Stat) c_int

Functionfstatat64[src]

pub extern "c" fn fstatat64(dirfd: fd_t, noalias path: [*:0]const u8, noalias stat_buf: *Stat, flags: u32) c_int

Parameters

dirfd: fd_t
path: [*:0]const u8
stat_buf: *Stat
flags: u32

Source Code

Source code
pub extern "c" fn fstatat64(dirfd: fd_t, noalias path: [*:0]const u8, noalias stat_buf: *Stat, flags: u32) c_int

Functionfallocate64[src]

pub extern "c" fn fallocate64(fd: fd_t, mode: c_int, offset: off_t, len: off_t) c_int

Parameters

fd: fd_t
mode: c_int
offset: off_t
len: off_t

Source Code

Source code
pub extern "c" fn fallocate64(fd: fd_t, mode: c_int, offset: off_t, len: off_t) c_int

Functionfopen64[src]

pub extern "c" fn fopen64(noalias filename: [*:0]const u8, noalias modes: [*:0]const u8) ?*FILE

Parameters

filename: [*:0]const u8
modes: [*:0]const u8

Source Code

Source code
pub extern "c" fn fopen64(noalias filename: [*:0]const u8, noalias modes: [*:0]const u8) ?*FILE

Functionftruncate64[src]

pub extern "c" fn ftruncate64(fd: c_int, length: off_t) c_int

Parameters

fd: c_int
length: off_t

Source Code

Source code
pub extern "c" fn ftruncate64(fd: c_int, length: off_t) c_int

Functionfallocate[src]

pub extern "c" fn fallocate(fd: fd_t, mode: c_int, offset: off_t, len: off_t) c_int

Parameters

fd: fd_t
mode: c_int
offset: off_t
len: off_t

Source Code

Source code
pub extern "c" fn fallocate(fd: fd_t, mode: c_int, offset: off_t, len: off_t) c_int

Functiongetauxval[src]

pub extern "c" fn getauxval(__type: c_ulong) c_ulong

See std.elf for constants for this

Parameters

__type: c_ulong

Source Code

Source code
pub extern "c" fn getauxval(__type: c_ulong) c_ulong

Functiondl_iterate_phdr[src]

pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int

Parameters

data: ?*anyopaque

Source Code

Source code
pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int

Functionmemfd_create[src]

pub extern "c" fn memfd_create(name: [*:0]const u8, flags: c_uint) c_int

Parameters

name: [*:0]const u8
flags: c_uint

Source Code

Source code
pub extern "c" fn memfd_create(name: [*:0]const u8, flags: c_uint) c_int

Functionsignalfd[src]

pub extern "c" fn signalfd(fd: fd_t, mask: *const sigset_t, flags: u32) c_int

Parameters

fd: fd_t
mask: *const sigset_t
flags: u32

Source Code

Source code
pub extern "c" fn signalfd(fd: fd_t, mask: *const sigset_t, flags: u32) c_int

Functionprlimit[src]

pub extern "c" fn prlimit(pid: pid_t, resource: rlimit_resource, new_limit: *const rlimit, old_limit: *rlimit) c_int

Parameters

pid: pid_t
resource: rlimit_resource
new_limit: *const rlimit
old_limit: *rlimit

Source Code

Source code
pub extern "c" fn prlimit(pid: pid_t, resource: rlimit_resource, new_limit: *const rlimit, old_limit: *rlimit) c_int

Functionmincore[src]

pub extern "c" fn mincore( addr: *align(page_size) anyopaque, length: usize, vec: [*]u8, ) c_int

Parameters

addr: *align(page_size) anyopaque
length: usize
vec: [*]u8

Source Code

Source code
pub extern "c" fn mincore(
    addr: *align(page_size) anyopaque,
    length: usize,
    vec: [*]u8,
) c_int

Functionmadvise[src]

pub extern "c" fn madvise( addr: *align(page_size) anyopaque, length: usize, advice: u32, ) c_int

Parameters

addr: *align(page_size) anyopaque
length: usize
advice: u32

Source Code

Source code
pub extern "c" fn madvise(
    addr: *align(page_size) anyopaque,
    length: usize,
    advice: u32,
) c_int

Functionfopen[src]

pub extern "c" fn fopen(noalias filename: [*:0]const u8, noalias modes: [*:0]const u8) ?*FILE

Parameters

filename: [*:0]const u8
modes: [*:0]const u8

Source Code

Source code
pub extern "c" fn fopen(noalias filename: [*:0]const u8, noalias modes: [*:0]const u8) ?*FILE

Functionfclose[src]

pub extern "c" fn fclose(stream: *FILE) c_int

Parameters

stream: *FILE

Source Code

Source code
pub extern "c" fn fclose(stream: *FILE) c_int

Functionfwrite[src]

pub extern "c" fn fwrite(noalias ptr: [*]const u8, size_of_type: usize, item_count: usize, noalias stream: *FILE) usize

Parameters

ptr: [*]const u8
size_of_type: usize
item_count: usize
stream: *FILE

Source Code

Source code
pub extern "c" fn fwrite(noalias ptr: [*]const u8, size_of_type: usize, item_count: usize, noalias stream: *FILE) usize

Functionfread[src]

pub extern "c" fn fread(noalias ptr: [*]u8, size_of_type: usize, item_count: usize, noalias stream: *FILE) usize

Parameters

ptr: [*]u8
size_of_type: usize
item_count: usize
stream: *FILE

Source Code

Source code
pub extern "c" fn fread(noalias ptr: [*]u8, size_of_type: usize, item_count: usize, noalias stream: *FILE) usize

Functionprintf[src]

pub extern "c" fn printf(format: [*:0]const u8, ...) c_int

Parameters

format: [*:0]const u8

Source Code

Source code
pub extern "c" fn printf(format: [*:0]const u8, ...) c_int

Functionabort[src]

pub extern "c" fn abort() noreturn

Source Code

Source code
pub extern "c" fn abort() noreturn

Functionexit[src]

pub extern "c" fn exit(code: c_int) noreturn

Parameters

code: c_int

Source Code

Source code
pub extern "c" fn exit(code: c_int) noreturn

Function_exit[src]

pub extern "c" fn _exit(code: c_int) noreturn

Parameters

code: c_int

Source Code

Source code
pub extern "c" fn _exit(code: c_int) noreturn

Functionisatty[src]

pub extern "c" fn isatty(fd: fd_t) c_int

Parameters

fd: fd_t

Source Code

Source code
pub extern "c" fn isatty(fd: fd_t) c_int

Functionlseek[src]

pub extern "c" fn lseek(fd: fd_t, offset: off_t, whence: whence_t) off_t

Parameters

fd: fd_t
offset: off_t
whence: whence_t

Source Code

Source code
pub extern "c" fn lseek(fd: fd_t, offset: off_t, whence: whence_t) off_t

Functionopen[src]

pub extern "c" fn open(path: [*:0]const u8, oflag: O, ...) c_int

Parameters

path: [*:0]const u8
oflag: O

Source Code

Source code
pub extern "c" fn open(path: [*:0]const u8, oflag: O, ...) c_int

Functionopenat[src]

pub extern "c" fn openat(fd: c_int, path: [*:0]const u8, oflag: O, ...) c_int

Parameters

fd: c_int
path: [*:0]const u8
oflag: O

Source Code

Source code
pub extern "c" fn openat(fd: c_int, path: [*:0]const u8, oflag: O, ...) c_int

Functionftruncate[src]

pub extern "c" fn ftruncate(fd: c_int, length: off_t) c_int

Parameters

fd: c_int
length: off_t

Source Code

Source code
pub extern "c" fn ftruncate(fd: c_int, length: off_t) c_int

Functionraise[src]

pub extern "c" fn raise(sig: c_int) c_int

Parameters

sig: c_int

Source Code

Source code
pub extern "c" fn raise(sig: c_int) c_int

Functionread[src]

pub extern "c" fn read(fd: fd_t, buf: [*]u8, nbyte: usize) isize

Parameters

fd: fd_t
buf: [*]u8
nbyte: usize

Source Code

Source code
pub extern "c" fn read(fd: fd_t, buf: [*]u8, nbyte: usize) isize

Functionreadv[src]

pub extern "c" fn readv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint) isize

Parameters

fd: c_int
iov: [*]const iovec
iovcnt: c_uint

Source Code

Source code
pub extern "c" fn readv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint) isize

Functionpread[src]

pub extern "c" fn pread(fd: fd_t, buf: [*]u8, nbyte: usize, offset: off_t) isize

Parameters

fd: fd_t
buf: [*]u8
nbyte: usize
offset: off_t

Source Code

Source code
pub extern "c" fn pread(fd: fd_t, buf: [*]u8, nbyte: usize, offset: off_t) isize

Functionpreadv[src]

pub extern "c" fn preadv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint, offset: off_t) isize

Parameters

fd: c_int
iov: [*]const iovec
iovcnt: c_uint
offset: off_t

Source Code

Source code
pub extern "c" fn preadv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint, offset: off_t) isize

Functionwritev[src]

pub extern "c" fn writev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint) isize

Parameters

fd: c_int
iov: [*]const iovec_const
iovcnt: c_uint

Source Code

Source code
pub extern "c" fn writev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint) isize

Functionpwritev[src]

pub extern "c" fn pwritev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint, offset: off_t) isize

Parameters

fd: c_int
iov: [*]const iovec_const
iovcnt: c_uint
offset: off_t

Source Code

Source code
pub extern "c" fn pwritev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint, offset: off_t) isize

Functionwrite[src]

pub extern "c" fn write(fd: fd_t, buf: [*]const u8, nbyte: usize) isize

Parameters

fd: fd_t
buf: [*]const u8
nbyte: usize

Source Code

Source code
pub extern "c" fn write(fd: fd_t, buf: [*]const u8, nbyte: usize) isize

Functionpwrite[src]

pub extern "c" fn pwrite(fd: fd_t, buf: [*]const u8, nbyte: usize, offset: off_t) isize

Parameters

fd: fd_t
buf: [*]const u8
nbyte: usize
offset: off_t

Source Code

Source code
pub extern "c" fn pwrite(fd: fd_t, buf: [*]const u8, nbyte: usize, offset: off_t) isize

Functionmmap[src]

pub extern "c" fn mmap(addr: ?*align(page_size) anyopaque, len: usize, prot: c_uint, flags: MAP, fd: fd_t, offset: off_t) *anyopaque

Parameters

addr: ?*align(page_size) anyopaque
len: usize
prot: c_uint
flags: MAP
fd: fd_t
offset: off_t

Source Code

Source code
pub extern "c" fn mmap(addr: ?*align(page_size) anyopaque, len: usize, prot: c_uint, flags: MAP, fd: fd_t, offset: off_t) *anyopaque

Functionmunmap[src]

pub extern "c" fn munmap(addr: *align(page_size) const anyopaque, len: usize) c_int

Parameters

addr: *align(page_size) const anyopaque
len: usize

Source Code

Source code
pub extern "c" fn munmap(addr: *align(page_size) const anyopaque, len: usize) c_int

Functionmremap[src]

pub extern "c" fn mremap(addr: ?*align(page_size) const anyopaque, old_len: usize, new_len: usize, flags: MREMAP, ...) *anyopaque

Parameters

addr: ?*align(page_size) const anyopaque
old_len: usize
new_len: usize
flags: MREMAP

Source Code

Source code
pub extern "c" fn mremap(addr: ?*align(page_size) const anyopaque, old_len: usize, new_len: usize, flags: MREMAP, ...) *anyopaque

Functionmprotect[src]

pub extern "c" fn mprotect(addr: *align(page_size) anyopaque, len: usize, prot: c_uint) c_int

Parameters

addr: *align(page_size) anyopaque
len: usize
prot: c_uint

Source Code

Source code
pub extern "c" fn mprotect(addr: *align(page_size) anyopaque, len: usize, prot: c_uint) c_int
pub extern "c" fn link(oldpath: [*:0]const u8, newpath: [*:0]const u8) c_int

Parameters

oldpath: [*:0]const u8
newpath: [*:0]const u8
Source code
pub extern "c" fn link(oldpath: [*:0]const u8, newpath: [*:0]const u8) c_int

Functionlinkat[src]

pub extern "c" fn linkat(oldfd: fd_t, oldpath: [*:0]const u8, newfd: fd_t, newpath: [*:0]const u8, flags: c_int) c_int

Parameters

oldfd: fd_t
oldpath: [*:0]const u8
newfd: fd_t
newpath: [*:0]const u8
flags: c_int

Source Code

Source code
pub extern "c" fn linkat(oldfd: fd_t, oldpath: [*:0]const u8, newfd: fd_t, newpath: [*:0]const u8, flags: c_int) c_int
pub extern "c" fn unlink(path: [*:0]const u8) c_int

Parameters

path: [*:0]const u8
Source code
pub extern "c" fn unlink(path: [*:0]const u8) c_int

Functionunlinkat[src]

pub extern "c" fn unlinkat(dirfd: fd_t, path: [*:0]const u8, flags: c_uint) c_int

Parameters

dirfd: fd_t
path: [*:0]const u8
flags: c_uint

Source Code

Source code
pub extern "c" fn unlinkat(dirfd: fd_t, path: [*:0]const u8, flags: c_uint) c_int

Functiongetcwd[src]

pub extern "c" fn getcwd(buf: [*]u8, size: usize) ?[*]u8

Parameters

buf: [*]u8
size: usize

Source Code

Source code
pub extern "c" fn getcwd(buf: [*]u8, size: usize) ?[*]u8

Functionwaitpid[src]

pub extern "c" fn waitpid(pid: pid_t, status: ?*c_int, options: c_int) pid_t

Parameters

pid: pid_t
status: ?*c_int
options: c_int

Source Code

Source code
pub extern "c" fn waitpid(pid: pid_t, status: ?*c_int, options: c_int) pid_t

Functionwait4[src]

pub extern "c" fn wait4(pid: pid_t, status: ?*c_int, options: c_int, ru: ?*rusage) pid_t

Parameters

pid: pid_t
status: ?*c_int
options: c_int
ru: ?*rusage

Source Code

Source code
pub extern "c" fn wait4(pid: pid_t, status: ?*c_int, options: c_int, ru: ?*rusage) pid_t

Functionaccess[src]

pub extern "c" fn access(path: [*:0]const u8, mode: c_uint) c_int

Parameters

path: [*:0]const u8
mode: c_uint

Source Code

Source code
pub extern "c" fn access(path: [*:0]const u8, mode: c_uint) c_int

Functionfaccessat[src]

pub extern "c" fn faccessat(dirfd: fd_t, path: [*:0]const u8, mode: c_uint, flags: c_uint) c_int

Parameters

dirfd: fd_t
path: [*:0]const u8
mode: c_uint
flags: c_uint

Source Code

Source code
pub extern "c" fn faccessat(dirfd: fd_t, path: [*:0]const u8, mode: c_uint, flags: c_uint) c_int

Functionpipe[src]

pub extern "c" fn pipe(fds: *[2]fd_t) c_int

Parameters

fds: *[2]fd_t

Source Code

Source code
pub extern "c" fn pipe(fds: *[2]fd_t) c_int

Functionmkdir[src]

pub extern "c" fn mkdir(path: [*:0]const u8, mode: mode_t) c_int

Parameters

path: [*:0]const u8
mode: mode_t

Source Code

Source code
pub extern "c" fn mkdir(path: [*:0]const u8, mode: mode_t) c_int

Functionmkdirat[src]

pub extern "c" fn mkdirat(dirfd: fd_t, path: [*:0]const u8, mode: mode_t) c_int

Parameters

dirfd: fd_t
path: [*:0]const u8
mode: mode_t

Source Code

Source code
pub extern "c" fn mkdirat(dirfd: fd_t, path: [*:0]const u8, mode: mode_t) c_int
pub extern "c" fn symlink(existing: [*:0]const u8, new: [*:0]const u8) c_int

Parameters

existing: [*:0]const u8
new: [*:0]const u8
Source code
pub extern "c" fn symlink(existing: [*:0]const u8, new: [*:0]const u8) c_int

Functionsymlinkat[src]

pub extern "c" fn symlinkat(oldpath: [*:0]const u8, newdirfd: fd_t, newpath: [*:0]const u8) c_int

Parameters

oldpath: [*:0]const u8
newdirfd: fd_t
newpath: [*:0]const u8

Source Code

Source code
pub extern "c" fn symlinkat(oldpath: [*:0]const u8, newdirfd: fd_t, newpath: [*:0]const u8) c_int

Functionrename[src]

pub extern "c" fn rename(old: [*:0]const u8, new: [*:0]const u8) c_int

Parameters

old: [*:0]const u8
new: [*:0]const u8

Source Code

Source code
pub extern "c" fn rename(old: [*:0]const u8, new: [*:0]const u8) c_int

Functionrenameat[src]

pub extern "c" fn renameat(olddirfd: fd_t, old: [*:0]const u8, newdirfd: fd_t, new: [*:0]const u8) c_int

Parameters

olddirfd: fd_t
old: [*:0]const u8
newdirfd: fd_t
new: [*:0]const u8

Source Code

Source code
pub extern "c" fn renameat(olddirfd: fd_t, old: [*:0]const u8, newdirfd: fd_t, new: [*:0]const u8) c_int

Functionchdir[src]

pub extern "c" fn chdir(path: [*:0]const u8) c_int

Parameters

path: [*:0]const u8

Source Code

Source code
pub extern "c" fn chdir(path: [*:0]const u8) c_int

Functionfchdir[src]

pub extern "c" fn fchdir(fd: fd_t) c_int

Parameters

fd: fd_t

Source Code

Source code
pub extern "c" fn fchdir(fd: fd_t) c_int

Functionexecve[src]

pub extern "c" fn execve(path: [*:0]const u8, argv: [*:null]const ?[*:0]const u8, envp: [*:null]const ?[*:0]const u8) c_int

Parameters

path: [*:0]const u8
argv: [*:null]const ?[*:0]const u8
envp: [*:null]const ?[*:0]const u8

Source Code

Source code
pub extern "c" fn execve(path: [*:0]const u8, argv: [*:null]const ?[*:0]const u8, envp: [*:null]const ?[*:0]const u8) c_int

Functiondup[src]

pub extern "c" fn dup(fd: fd_t) c_int

Parameters

fd: fd_t

Source Code

Source code
pub extern "c" fn dup(fd: fd_t) c_int

Functiondup2[src]

pub extern "c" fn dup2(old_fd: fd_t, new_fd: fd_t) c_int

Parameters

old_fd: fd_t
new_fd: fd_t

Source Code

Source code
pub extern "c" fn dup2(old_fd: fd_t, new_fd: fd_t) c_int

Functiondup3[src]

pub extern "c" fn dup3(old: c_int, new: c_int, flags: c_uint) c_int

Parameters

old: c_int
new: c_int
flags: c_uint

Source Code

Source code
pub extern "c" fn dup3(old: c_int, new: c_int, flags: c_uint) c_int
pub extern "c" fn readlink(noalias path: [*:0]const u8, noalias buf: [*]u8, bufsize: usize) isize

Parameters

path: [*:0]const u8
buf: [*]u8
bufsize: usize
Source code
pub extern "c" fn readlink(noalias path: [*:0]const u8, noalias buf: [*]u8, bufsize: usize) isize

Functionreadlinkat[src]

pub extern "c" fn readlinkat(dirfd: fd_t, noalias path: [*:0]const u8, noalias buf: [*]u8, bufsize: usize) isize

Parameters

dirfd: fd_t
path: [*:0]const u8
buf: [*]u8
bufsize: usize

Source Code

Source code
pub extern "c" fn readlinkat(dirfd: fd_t, noalias path: [*:0]const u8, noalias buf: [*]u8, bufsize: usize) isize

Functionchmod[src]

pub extern "c" fn chmod(path: [*:0]const u8, mode: mode_t) c_int

Parameters

path: [*:0]const u8
mode: mode_t

Source Code

Source code
pub extern "c" fn chmod(path: [*:0]const u8, mode: mode_t) c_int

Functionfchmod[src]

pub extern "c" fn fchmod(fd: fd_t, mode: mode_t) c_int

Parameters

fd: fd_t
mode: mode_t

Source Code

Source code
pub extern "c" fn fchmod(fd: fd_t, mode: mode_t) c_int

Functionfchmodat[src]

pub extern "c" fn fchmodat(fd: fd_t, path: [*:0]const u8, mode: mode_t, flags: c_uint) c_int

Parameters

fd: fd_t
path: [*:0]const u8
mode: mode_t
flags: c_uint

Source Code

Source code
pub extern "c" fn fchmodat(fd: fd_t, path: [*:0]const u8, mode: mode_t, flags: c_uint) c_int

Functionfchown[src]

pub extern "c" fn fchown(fd: fd_t, owner: uid_t, group: gid_t) c_int

Parameters

fd: fd_t
owner: uid_t
group: gid_t

Source Code

Source code
pub extern "c" fn fchown(fd: fd_t, owner: uid_t, group: gid_t) c_int

Functionumask[src]

pub extern "c" fn umask(mode: mode_t) mode_t

Parameters

mode: mode_t

Source Code

Source code
pub extern "c" fn umask(mode: mode_t) mode_t

Functionrmdir[src]

pub extern "c" fn rmdir(path: [*:0]const u8) c_int

Parameters

path: [*:0]const u8

Source Code

Source code
pub extern "c" fn rmdir(path: [*:0]const u8) c_int

Functiongetenv[src]

pub extern "c" fn getenv(name: [*:0]const u8) ?[*:0]u8

Parameters

name: [*:0]const u8

Source Code

Source code
pub extern "c" fn getenv(name: [*:0]const u8) ?[*:0]u8

Functionsysctl[src]

pub extern "c" fn sysctl(name: [*]const c_int, namelen: c_uint, oldp: ?*anyopaque, oldlenp: ?*usize, newp: ?*anyopaque, newlen: usize) c_int

Parameters

name: [*]const c_int
namelen: c_uint
oldp: ?*anyopaque
oldlenp: ?*usize
newp: ?*anyopaque
newlen: usize

Source Code

Source code
pub extern "c" fn sysctl(name: [*]const c_int, namelen: c_uint, oldp: ?*anyopaque, oldlenp: ?*usize, newp: ?*anyopaque, newlen: usize) c_int

Functionsysctlbyname[src]

pub extern "c" fn sysctlbyname(name: [*:0]const u8, oldp: ?*anyopaque, oldlenp: ?*usize, newp: ?*anyopaque, newlen: usize) c_int

Parameters

name: [*:0]const u8
oldp: ?*anyopaque
oldlenp: ?*usize
newp: ?*anyopaque
newlen: usize

Source Code

Source code
pub extern "c" fn sysctlbyname(name: [*:0]const u8, oldp: ?*anyopaque, oldlenp: ?*usize, newp: ?*anyopaque, newlen: usize) c_int

Functionsysctlnametomib[src]

pub extern "c" fn sysctlnametomib(name: [*:0]const u8, mibp: ?*c_int, sizep: ?*usize) c_int

Parameters

name: [*:0]const u8
mibp: ?*c_int
sizep: ?*usize

Source Code

Source code
pub extern "c" fn sysctlnametomib(name: [*:0]const u8, mibp: ?*c_int, sizep: ?*usize) c_int

Functiontcgetattr[src]

pub extern "c" fn tcgetattr(fd: fd_t, termios_p: *termios) c_int

Parameters

fd: fd_t
termios_p: *termios

Source Code

Source code
pub extern "c" fn tcgetattr(fd: fd_t, termios_p: *termios) c_int

Functiontcsetattr[src]

pub extern "c" fn tcsetattr(fd: fd_t, optional_action: TCSA, termios_p: *const termios) c_int

Parameters

fd: fd_t
optional_action: TCSA
termios_p: *const termios

Source Code

Source code
pub extern "c" fn tcsetattr(fd: fd_t, optional_action: TCSA, termios_p: *const termios) c_int

Functionfcntl[src]

pub extern "c" fn fcntl(fd: fd_t, cmd: c_int, ...) c_int

Parameters

fd: fd_t
cmd: c_int

Source Code

Source code
pub extern "c" fn fcntl(fd: fd_t, cmd: c_int, ...) c_int

Functionioctl[src]

pub extern "c" fn ioctl(fd: fd_t, request: c_int, ...) c_int

Parameters

fd: fd_t
request: c_int

Source Code

Source code
pub extern "c" fn ioctl(fd: fd_t, request: c_int, ...) c_int

Functionuname[src]

pub extern "c" fn uname(buf: *utsname) c_int

Parameters

buf: *utsname

Source Code

Source code
pub extern "c" fn uname(buf: *utsname) c_int

Functiongethostname[src]

pub extern "c" fn gethostname(name: [*]u8, len: usize) c_int

Parameters

name: [*]u8
len: usize

Source Code

Source code
pub extern "c" fn gethostname(name: [*]u8, len: usize) c_int

Functionshutdown[src]

pub extern "c" fn shutdown(socket: fd_t, how: c_int) c_int

Parameters

socket: fd_t
how: c_int

Source Code

Source code
pub extern "c" fn shutdown(socket: fd_t, how: c_int) c_int

Functionbind[src]

pub extern "c" fn bind(socket: fd_t, address: ?*const sockaddr, address_len: socklen_t) c_int

Parameters

socket: fd_t
address: ?*const sockaddr
address_len: socklen_t

Source Code

Source code
pub extern "c" fn bind(socket: fd_t, address: ?*const sockaddr, address_len: socklen_t) c_int

Functionsocketpair[src]

pub extern "c" fn socketpair(domain: c_uint, sock_type: c_uint, protocol: c_uint, sv: *[2]fd_t) c_int

Parameters

domain: c_uint
sock_type: c_uint
protocol: c_uint
sv: *[2]fd_t

Source Code

Source code
pub extern "c" fn socketpair(domain: c_uint, sock_type: c_uint, protocol: c_uint, sv: *[2]fd_t) c_int

Functionlisten[src]

pub extern "c" fn listen(sockfd: fd_t, backlog: c_uint) c_int

Parameters

sockfd: fd_t
backlog: c_uint

Source Code

Source code
pub extern "c" fn listen(sockfd: fd_t, backlog: c_uint) c_int

Functiongetsockname[src]

pub extern "c" fn getsockname(sockfd: fd_t, noalias addr: *sockaddr, noalias addrlen: *socklen_t) c_int

Parameters

sockfd: fd_t
addr: *sockaddr
addrlen: *socklen_t

Source Code

Source code
pub extern "c" fn getsockname(sockfd: fd_t, noalias addr: *sockaddr, noalias addrlen: *socklen_t) c_int

Functiongetpeername[src]

pub extern "c" fn getpeername(sockfd: fd_t, noalias addr: *sockaddr, noalias addrlen: *socklen_t) c_int

Parameters

sockfd: fd_t
addr: *sockaddr
addrlen: *socklen_t

Source Code

Source code
pub extern "c" fn getpeername(sockfd: fd_t, noalias addr: *sockaddr, noalias addrlen: *socklen_t) c_int

Functionconnect[src]

pub extern "c" fn connect(sockfd: fd_t, sock_addr: *const sockaddr, addrlen: socklen_t) c_int

Parameters

sockfd: fd_t
sock_addr: *const sockaddr
addrlen: socklen_t

Source Code

Source code
pub extern "c" fn connect(sockfd: fd_t, sock_addr: *const sockaddr, addrlen: socklen_t) c_int

Functionaccept[src]

pub extern "c" fn accept(sockfd: fd_t, noalias addr: ?*sockaddr, noalias addrlen: ?*socklen_t) c_int

Parameters

sockfd: fd_t
addr: ?*sockaddr
addrlen: ?*socklen_t

Source Code

Source code
pub extern "c" fn accept(sockfd: fd_t, noalias addr: ?*sockaddr, noalias addrlen: ?*socklen_t) c_int

Functionaccept4[src]

pub extern "c" fn accept4(sockfd: fd_t, noalias addr: ?*sockaddr, noalias addrlen: ?*socklen_t, flags: c_uint) c_int

Parameters

sockfd: fd_t
addr: ?*sockaddr
addrlen: ?*socklen_t
flags: c_uint

Source Code

Source code
pub extern "c" fn accept4(sockfd: fd_t, noalias addr: ?*sockaddr, noalias addrlen: ?*socklen_t, flags: c_uint) c_int

Functiongetsockopt[src]

pub extern "c" fn getsockopt(sockfd: fd_t, level: i32, optname: u32, noalias optval: ?*anyopaque, noalias optlen: *socklen_t) c_int

Parameters

sockfd: fd_t
level: i32
optname: u32
optval: ?*anyopaque
optlen: *socklen_t

Source Code

Source code
pub extern "c" fn getsockopt(sockfd: fd_t, level: i32, optname: u32, noalias optval: ?*anyopaque, noalias optlen: *socklen_t) c_int

Functionsetsockopt[src]

pub extern "c" fn setsockopt(sockfd: fd_t, level: i32, optname: u32, optval: ?*const anyopaque, optlen: socklen_t) c_int

Parameters

sockfd: fd_t
level: i32
optname: u32
optval: ?*const anyopaque
optlen: socklen_t

Source Code

Source code
pub extern "c" fn setsockopt(sockfd: fd_t, level: i32, optname: u32, optval: ?*const anyopaque, optlen: socklen_t) c_int

Functionsend[src]

pub extern "c" fn send(sockfd: fd_t, buf: *const anyopaque, len: usize, flags: u32) isize

Parameters

sockfd: fd_t
buf: *const anyopaque
len: usize
flags: u32

Source Code

Source code
pub extern "c" fn send(sockfd: fd_t, buf: *const anyopaque, len: usize, flags: u32) isize

Functionsendto[src]

pub extern "c" fn sendto( sockfd: fd_t, buf: *const anyopaque, len: usize, flags: u32, dest_addr: ?*const sockaddr, addrlen: socklen_t, ) isize

Parameters

sockfd: fd_t
buf: *const anyopaque
len: usize
flags: u32
dest_addr: ?*const sockaddr
addrlen: socklen_t

Source Code

Source code
pub extern "c" fn sendto(
    sockfd: fd_t,
    buf: *const anyopaque,
    len: usize,
    flags: u32,
    dest_addr: ?*const sockaddr,
    addrlen: socklen_t,
) isize

Functionsendmsg[src]

pub extern "c" fn sendmsg(sockfd: fd_t, msg: *const msghdr_const, flags: u32) isize

Parameters

sockfd: fd_t
msg: *const msghdr_const
flags: u32

Source Code

Source code
pub extern "c" fn sendmsg(sockfd: fd_t, msg: *const msghdr_const, flags: u32) isize

Functionrecv[src]

pub extern "c" fn recv( sockfd: fd_t, arg1: ?*anyopaque, arg2: usize, arg3: c_int, ) if (native_os == .windows) c_int else isize

Parameters

sockfd: fd_t
arg1: ?*anyopaque
arg2: usize
arg3: c_int

Source Code

Source code
pub extern "c" fn recv(
    sockfd: fd_t,
    arg1: ?*anyopaque,
    arg2: usize,
    arg3: c_int,
) if (native_os == .windows) c_int else isize

Functionrecvfrom[src]

pub extern "c" fn recvfrom( sockfd: fd_t, noalias buf: *anyopaque, len: usize, flags: u32, noalias src_addr: ?*sockaddr, noalias addrlen: ?*socklen_t, ) if (native_os == .windows) c_int else isize

Parameters

sockfd: fd_t
buf: *anyopaque
len: usize
flags: u32
src_addr: ?*sockaddr
addrlen: ?*socklen_t

Source Code

Source code
pub extern "c" fn recvfrom(
    sockfd: fd_t,
    noalias buf: *anyopaque,
    len: usize,
    flags: u32,
    noalias src_addr: ?*sockaddr,
    noalias addrlen: ?*socklen_t,
) if (native_os == .windows) c_int else isize

Functionrecvmsg[src]

pub extern "c" fn recvmsg(sockfd: fd_t, msg: *msghdr, flags: u32) isize

Parameters

sockfd: fd_t
msg: *msghdr
flags: u32

Source Code

Source code
pub extern "c" fn recvmsg(sockfd: fd_t, msg: *msghdr, flags: u32) isize

Functionkill[src]

pub extern "c" fn kill(pid: pid_t, sig: c_int) c_int

Parameters

pid: pid_t
sig: c_int

Source Code

Source code
pub extern "c" fn kill(pid: pid_t, sig: c_int) c_int

Functionsetuid[src]

pub extern "c" fn setuid(uid: uid_t) c_int

Parameters

uid: uid_t

Source Code

Source code
pub extern "c" fn setuid(uid: uid_t) c_int

Functionsetgid[src]

pub extern "c" fn setgid(gid: gid_t) c_int

Parameters

gid: gid_t

Source Code

Source code
pub extern "c" fn setgid(gid: gid_t) c_int

Functionseteuid[src]

pub extern "c" fn seteuid(euid: uid_t) c_int

Parameters

euid: uid_t

Source Code

Source code
pub extern "c" fn seteuid(euid: uid_t) c_int

Functionsetegid[src]

pub extern "c" fn setegid(egid: gid_t) c_int

Parameters

egid: gid_t

Source Code

Source code
pub extern "c" fn setegid(egid: gid_t) c_int

Functionsetreuid[src]

pub extern "c" fn setreuid(ruid: uid_t, euid: uid_t) c_int

Parameters

ruid: uid_t
euid: uid_t

Source Code

Source code
pub extern "c" fn setreuid(ruid: uid_t, euid: uid_t) c_int

Functionsetregid[src]

pub extern "c" fn setregid(rgid: gid_t, egid: gid_t) c_int

Parameters

rgid: gid_t
egid: gid_t

Source Code

Source code
pub extern "c" fn setregid(rgid: gid_t, egid: gid_t) c_int

Functionsetresuid[src]

pub extern "c" fn setresuid(ruid: uid_t, euid: uid_t, suid: uid_t) c_int

Parameters

ruid: uid_t
euid: uid_t
suid: uid_t

Source Code

Source code
pub extern "c" fn setresuid(ruid: uid_t, euid: uid_t, suid: uid_t) c_int

Functionsetresgid[src]

pub extern "c" fn setresgid(rgid: gid_t, egid: gid_t, sgid: gid_t) c_int

Parameters

rgid: gid_t
egid: gid_t
sgid: gid_t

Source Code

Source code
pub extern "c" fn setresgid(rgid: gid_t, egid: gid_t, sgid: gid_t) c_int

Functionsetpgid[src]

pub extern "c" fn setpgid(pid: pid_t, pgid: pid_t) c_int

Parameters

pid: pid_t
pgid: pid_t

Source Code

Source code
pub extern "c" fn setpgid(pid: pid_t, pgid: pid_t) c_int

Functionmalloc[src]

pub extern "c" fn malloc(usize) ?*anyopaque

Parameters

malloc: usize

Source Code

Source code
pub extern "c" fn malloc(usize) ?*anyopaque

Functioncalloc[src]

pub extern "c" fn calloc(usize, usize) ?*anyopaque

Parameters

calloc: usize
usize: usize

Source Code

Source code
pub extern "c" fn calloc(usize, usize) ?*anyopaque

Functionrealloc[src]

pub extern "c" fn realloc(?*anyopaque, usize) ?*anyopaque

Parameters

realloc: ?*anyopaque
anyopaque: usize

Source Code

Source code
pub extern "c" fn realloc(?*anyopaque, usize) ?*anyopaque

Functionfree[src]

pub extern "c" fn free(?*anyopaque) void

Parameters

free: ?*anyopaque

Source Code

Source code
pub extern "c" fn free(?*anyopaque) void

Functionfutimes[src]

pub extern "c" fn futimes(fd: fd_t, times: ?*[2]timeval) c_int

Parameters

fd: fd_t
times: ?*[2]timeval

Source Code

Source code
pub extern "c" fn futimes(fd: fd_t, times: ?*[2]timeval) c_int

Functionutimes[src]

pub extern "c" fn utimes(path: [*:0]const u8, times: ?*[2]timeval) c_int

Parameters

path: [*:0]const u8
times: ?*[2]timeval

Source Code

Source code
pub extern "c" fn utimes(path: [*:0]const u8, times: ?*[2]timeval) c_int

Functionutimensat[src]

pub extern "c" fn utimensat(dirfd: fd_t, pathname: [*:0]const u8, times: ?*[2]timespec, flags: u32) c_int

Parameters

dirfd: fd_t
pathname: [*:0]const u8
times: ?*[2]timespec
flags: u32

Source Code

Source code
pub extern "c" fn utimensat(dirfd: fd_t, pathname: [*:0]const u8, times: ?*[2]timespec, flags: u32) c_int

Functionfutimens[src]

pub extern "c" fn futimens(fd: fd_t, times: ?*const [2]timespec) c_int

Parameters

fd: fd_t
times: ?*const [2]timespec

Source Code

Source code
pub extern "c" fn futimens(fd: fd_t, times: ?*const [2]timespec) c_int

Functionpthread_create[src]

pub extern "c" fn pthread_create( noalias newthread: *pthread_t, noalias attr: ?*const pthread_attr_t, start_routine: *const fn (?*anyopaque) callconv(.c) ?*anyopaque, noalias arg: ?*anyopaque, ) E

Parameters

newthread: *pthread_t
attr: ?*const pthread_attr_t
start_routine: *const fn (?*anyopaque) callconv(.c) ?*anyopaque
arg: ?*anyopaque

Source Code

Source code
pub extern "c" fn pthread_create(
    noalias newthread: *pthread_t,
    noalias attr: ?*const pthread_attr_t,
    start_routine: *const fn (?*anyopaque) callconv(.c) ?*anyopaque,
    noalias arg: ?*anyopaque,
) E

Functionpthread_attr_init[src]

pub extern "c" fn pthread_attr_init(attr: *pthread_attr_t) E

Parameters

Source Code

Source code
pub extern "c" fn pthread_attr_init(attr: *pthread_attr_t) E

Functionpthread_attr_setstack[src]

pub extern "c" fn pthread_attr_setstack(attr: *pthread_attr_t, stackaddr: *anyopaque, stacksize: usize) E

Parameters

stackaddr: *anyopaque
stacksize: usize

Source Code

Source code
pub extern "c" fn pthread_attr_setstack(attr: *pthread_attr_t, stackaddr: *anyopaque, stacksize: usize) E

Functionpthread_attr_setstacksize[src]

pub extern "c" fn pthread_attr_setstacksize(attr: *pthread_attr_t, stacksize: usize) E

Parameters

stacksize: usize

Source Code

Source code
pub extern "c" fn pthread_attr_setstacksize(attr: *pthread_attr_t, stacksize: usize) E

Functionpthread_attr_setguardsize[src]

pub extern "c" fn pthread_attr_setguardsize(attr: *pthread_attr_t, guardsize: usize) E

Parameters

guardsize: usize

Source Code

Source code
pub extern "c" fn pthread_attr_setguardsize(attr: *pthread_attr_t, guardsize: usize) E

Functionpthread_attr_destroy[src]

pub extern "c" fn pthread_attr_destroy(attr: *pthread_attr_t) E

Parameters

Source Code

Source code
pub extern "c" fn pthread_attr_destroy(attr: *pthread_attr_t) E

Functionpthread_self[src]

pub extern "c" fn pthread_self() pthread_t

Source Code

Source code
pub extern "c" fn pthread_self() pthread_t

Functionpthread_join[src]

pub extern "c" fn pthread_join(thread: pthread_t, arg_return: ?*?*anyopaque) E

Parameters

thread: pthread_t
arg_return: ?*?*anyopaque

Source Code

Source code
pub extern "c" fn pthread_join(thread: pthread_t, arg_return: ?*?*anyopaque) E

Functionpthread_detach[src]

pub extern "c" fn pthread_detach(thread: pthread_t) E

Parameters

thread: pthread_t

Source Code

Source code
pub extern "c" fn pthread_detach(thread: pthread_t) E

Functionpthread_atfork[src]

pub extern "c" fn pthread_atfork( prepare: ?*const fn () callconv(.c) void, parent: ?*const fn () callconv(.c) void, child: ?*const fn () callconv(.c) void, ) c_int

Parameters

prepare: ?*const fn () callconv(.c) void
parent: ?*const fn () callconv(.c) void
child: ?*const fn () callconv(.c) void

Source Code

Source code
pub extern "c" fn pthread_atfork(
    prepare: ?*const fn () callconv(.c) void,
    parent: ?*const fn () callconv(.c) void,
    child: ?*const fn () callconv(.c) void,
) c_int

Functionpthread_key_create[src]

pub extern "c" fn pthread_key_create( key: *pthread_key_t, destructor: ?*const fn (value: *anyopaque) callconv(.c) void, ) E

Parameters

destructor: ?*const fn (value: *anyopaque) callconv(.c) void

Source Code

Source code
pub extern "c" fn pthread_key_create(
    key: *pthread_key_t,
    destructor: ?*const fn (value: *anyopaque) callconv(.c) void,
) E

Functionpthread_key_delete[src]

pub extern "c" fn pthread_key_delete(key: pthread_key_t) E

Parameters

Source Code

Source code
pub extern "c" fn pthread_key_delete(key: pthread_key_t) E

Functionpthread_getspecific[src]

pub extern "c" fn pthread_getspecific(key: pthread_key_t) ?*anyopaque

Parameters

Source Code

Source code
pub extern "c" fn pthread_getspecific(key: pthread_key_t) ?*anyopaque

Functionpthread_setspecific[src]

pub extern "c" fn pthread_setspecific(key: pthread_key_t, value: ?*anyopaque) c_int

Parameters

value: ?*anyopaque

Source Code

Source code
pub extern "c" fn pthread_setspecific(key: pthread_key_t, value: ?*anyopaque) c_int

Functionpthread_sigmask[src]

pub extern "c" fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *sigset_t) c_int

Parameters

how: c_int
set: *const sigset_t
oldset: *sigset_t

Source Code

Source code
pub extern "c" fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *sigset_t) c_int

Functionpthread_getname_np[src]

pub extern "c" fn pthread_getname_np(thread: pthread_t, name: [*:0]u8, len: usize) c_int

Parameters

thread: pthread_t
name: [*:0]u8
len: usize

Source Code

Source code
pub extern "c" fn pthread_getname_np(thread: pthread_t, name: [*:0]u8, len: usize) c_int

Functionsem_init[src]

pub extern "c" fn sem_init(sem: *sem_t, pshared: c_int, value: c_uint) c_int

Parameters

sem: *sem_t
pshared: c_int
value: c_uint

Source Code

Source code
pub extern "c" fn sem_init(sem: *sem_t, pshared: c_int, value: c_uint) c_int

Functionsem_destroy[src]

pub extern "c" fn sem_destroy(sem: *sem_t) c_int

Parameters

sem: *sem_t

Source Code

Source code
pub extern "c" fn sem_destroy(sem: *sem_t) c_int

Functionsem_open[src]

pub extern "c" fn sem_open(name: [*:0]const u8, flag: c_int, mode: mode_t, value: c_uint) *sem_t

Parameters

name: [*:0]const u8
flag: c_int
mode: mode_t
value: c_uint

Source Code

Source code
pub extern "c" fn sem_open(name: [*:0]const u8, flag: c_int, mode: mode_t, value: c_uint) *sem_t

Functionsem_close[src]

pub extern "c" fn sem_close(sem: *sem_t) c_int

Parameters

sem: *sem_t

Source Code

Source code
pub extern "c" fn sem_close(sem: *sem_t) c_int

Functionsem_post[src]

pub extern "c" fn sem_post(sem: *sem_t) c_int

Parameters

sem: *sem_t

Source Code

Source code
pub extern "c" fn sem_post(sem: *sem_t) c_int

Functionsem_wait[src]

pub extern "c" fn sem_wait(sem: *sem_t) c_int

Parameters

sem: *sem_t

Source Code

Source code
pub extern "c" fn sem_wait(sem: *sem_t) c_int

Functionsem_trywait[src]

pub extern "c" fn sem_trywait(sem: *sem_t) c_int

Parameters

sem: *sem_t

Source Code

Source code
pub extern "c" fn sem_trywait(sem: *sem_t) c_int

Functionsem_timedwait[src]

pub extern "c" fn sem_timedwait(sem: *sem_t, abs_timeout: *const timespec) c_int

Parameters

sem: *sem_t
abs_timeout: *const timespec

Source Code

Source code
pub extern "c" fn sem_timedwait(sem: *sem_t, abs_timeout: *const timespec) c_int

Functionsem_getvalue[src]

pub extern "c" fn sem_getvalue(sem: *sem_t, sval: *c_int) c_int

Parameters

sem: *sem_t
sval: *c_int

Source Code

Source code
pub extern "c" fn sem_getvalue(sem: *sem_t, sval: *c_int) c_int

Functionshm_open[src]

pub extern "c" fn shm_open(name: [*:0]const u8, flag: c_int, mode: mode_t) c_int

Parameters

name: [*:0]const u8
flag: c_int
mode: mode_t

Source Code

Source code
pub extern "c" fn shm_open(name: [*:0]const u8, flag: c_int, mode: mode_t) c_int
pub extern "c" fn shm_unlink(name: [*:0]const u8) c_int

Parameters

name: [*:0]const u8
Source code
pub extern "c" fn shm_unlink(name: [*:0]const u8) c_int

Functionkqueue[src]

pub extern "c" fn kqueue() c_int

Source Code

Source code
pub extern "c" fn kqueue() c_int

Functionkevent[src]

pub extern "c" fn kevent( kq: c_int, changelist: [*]const Kevent, nchanges: c_int, eventlist: [*]Kevent, nevents: c_int, timeout: ?*const timespec, ) c_int

Parameters

kq: c_int
changelist: [*]const Kevent
nchanges: c_int
eventlist: [*]Kevent
nevents: c_int
timeout: ?*const timespec

Source Code

Source code
pub extern "c" fn kevent(
    kq: c_int,
    changelist: [*]const Kevent,
    nchanges: c_int,
    eventlist: [*]Kevent,
    nevents: c_int,
    timeout: ?*const timespec,
) c_int

Functionport_create[src]

pub extern "c" fn port_create() port_t

Source Code

Source code
pub extern "c" fn port_create() port_t

Functionport_associate[src]

pub extern "c" fn port_associate( port: port_t, source: u32, object: usize, events: u32, user_var: ?*anyopaque, ) c_int

Parameters

port: port_t
source: u32
object: usize
events: u32
user_var: ?*anyopaque

Source Code

Source code
pub extern "c" fn port_associate(
    port: port_t,
    source: u32,
    object: usize,
    events: u32,
    user_var: ?*anyopaque,
) c_int

Functionport_dissociate[src]

pub extern "c" fn port_dissociate(port: port_t, source: u32, object: usize) c_int

Parameters

port: port_t
source: u32
object: usize

Source Code

Source code
pub extern "c" fn port_dissociate(port: port_t, source: u32, object: usize) c_int

Functionport_send[src]

pub extern "c" fn port_send(port: port_t, events: u32, user_var: ?*anyopaque) c_int

Parameters

port: port_t
events: u32
user_var: ?*anyopaque

Source Code

Source code
pub extern "c" fn port_send(port: port_t, events: u32, user_var: ?*anyopaque) c_int

Functionport_sendn[src]

pub extern "c" fn port_sendn( ports: [*]port_t, errors: []u32, num_ports: u32, events: u32, user_var: ?*anyopaque, ) c_int

Parameters

ports: [*]port_t
errors: []u32
num_ports: u32
events: u32
user_var: ?*anyopaque

Source Code

Source code
pub extern "c" fn port_sendn(
    ports: [*]port_t,
    errors: []u32,
    num_ports: u32,
    events: u32,
    user_var: ?*anyopaque,
) c_int

Functionport_get[src]

pub extern "c" fn port_get(port: port_t, event: *port_event, timeout: ?*timespec) c_int

Parameters

port: port_t
event: *port_event
timeout: ?*timespec

Source Code

Source code
pub extern "c" fn port_get(port: port_t, event: *port_event, timeout: ?*timespec) c_int

Functionport_getn[src]

pub extern "c" fn port_getn( port: port_t, event_list: []port_event, max_events: u32, events_retrieved: *u32, timeout: ?*timespec, ) c_int

Parameters

port: port_t
event_list: []port_event
max_events: u32
events_retrieved: *u32
timeout: ?*timespec

Source Code

Source code
pub extern "c" fn port_getn(
    port: port_t,
    event_list: []port_event,
    max_events: u32,
    events_retrieved: *u32,
    timeout: ?*timespec,
) c_int

Functionport_alert[src]

pub extern "c" fn port_alert(port: port_t, flags: u32, events: u32, user_var: ?*anyopaque) c_int

Parameters

port: port_t
flags: u32
events: u32
user_var: ?*anyopaque

Source Code

Source code
pub extern "c" fn port_alert(port: port_t, flags: u32, events: u32, user_var: ?*anyopaque) c_int

Functiongetaddrinfo[src]

pub extern "c" fn getaddrinfo( noalias node: ?[*:0]const u8, noalias service: ?[*:0]const u8, noalias hints: ?*const addrinfo, noalias res: *?*addrinfo, ) EAI

Parameters

node: ?[*:0]const u8
service: ?[*:0]const u8
hints: ?*const addrinfo
res: *?*addrinfo

On Linux, res will not be modified on error and freeaddrinfo will potentially crash if you pass it an undefined pointer

Source Code

Source code
pub extern "c" fn getaddrinfo(
    noalias node: ?[*:0]const u8,
    noalias service: ?[*:0]const u8,
    noalias hints: ?*const addrinfo,
    /// On Linux, `res` will not be modified on error and `freeaddrinfo` will
    /// potentially crash if you pass it an undefined pointer
    noalias res: *?*addrinfo,
) EAI

Functionfreeaddrinfo[src]

pub extern "c" fn freeaddrinfo(res: *addrinfo) void

Parameters

res: *addrinfo

Source Code

Source code
pub extern "c" fn freeaddrinfo(res: *addrinfo) void

Functiongetnameinfo[src]

pub extern "c" fn getnameinfo( noalias addr: *const sockaddr, addrlen: socklen_t, noalias host: ?[*]u8, hostlen: socklen_t, noalias serv: ?[*]u8, servlen: socklen_t, flags: NI, ) EAI

Parameters

addr: *const sockaddr
addrlen: socklen_t
host: ?[*]u8
hostlen: socklen_t
serv: ?[*]u8
servlen: socklen_t
flags: NI

Source Code

Source code
pub extern "c" fn getnameinfo(
    noalias addr: *const sockaddr,
    addrlen: socklen_t,
    noalias host: ?[*]u8,
    hostlen: socklen_t,
    noalias serv: ?[*]u8,
    servlen: socklen_t,
    flags: NI,
) EAI

Functiongai_strerror[src]

pub extern "c" fn gai_strerror(errcode: EAI) [*:0]const u8

Parameters

errcode: EAI

Source Code

Source code
pub extern "c" fn gai_strerror(errcode: EAI) [*:0]const u8

Functionpoll[src]

pub extern "c" fn poll(fds: [*]pollfd, nfds: nfds_t, timeout: c_int) c_int

Parameters

fds: [*]pollfd
nfds: nfds_t
timeout: c_int

Source Code

Source code
pub extern "c" fn poll(fds: [*]pollfd, nfds: nfds_t, timeout: c_int) c_int

Functionppoll[src]

pub extern "c" fn ppoll(fds: [*]pollfd, nfds: nfds_t, timeout: ?*const timespec, sigmask: ?*const sigset_t) c_int

Parameters

fds: [*]pollfd
nfds: nfds_t
timeout: ?*const timespec
sigmask: ?*const sigset_t

Source Code

Source code
pub extern "c" fn ppoll(fds: [*]pollfd, nfds: nfds_t, timeout: ?*const timespec, sigmask: ?*const sigset_t) c_int

Functiondn_expand[src]

pub extern "c" fn dn_expand( msg: [*:0]const u8, eomorig: [*:0]const u8, comp_dn: [*:0]const u8, exp_dn: [*:0]u8, length: c_int, ) c_int

Parameters

msg: [*:0]const u8
eomorig: [*:0]const u8
comp_dn: [*:0]const u8
exp_dn: [*:0]u8
length: c_int

Source Code

Source code
pub extern "c" fn dn_expand(
    msg: [*:0]const u8,
    eomorig: [*:0]const u8,
    comp_dn: [*:0]const u8,
    exp_dn: [*:0]u8,
    length: c_int,
) c_int

Functionpthread_mutex_lock[src]

pub extern "c" fn pthread_mutex_lock(mutex: *pthread_mutex_t) E

Parameters

Source Code

Source code
pub extern "c" fn pthread_mutex_lock(mutex: *pthread_mutex_t) E

Functionpthread_mutex_unlock[src]

pub extern "c" fn pthread_mutex_unlock(mutex: *pthread_mutex_t) E

Parameters

Source Code

Source code
pub extern "c" fn pthread_mutex_unlock(mutex: *pthread_mutex_t) E

Functionpthread_mutex_trylock[src]

pub extern "c" fn pthread_mutex_trylock(mutex: *pthread_mutex_t) E

Parameters

Source Code

Source code
pub extern "c" fn pthread_mutex_trylock(mutex: *pthread_mutex_t) E

Functionpthread_mutex_destroy[src]

pub extern "c" fn pthread_mutex_destroy(mutex: *pthread_mutex_t) E

Parameters

Source Code

Source code
pub extern "c" fn pthread_mutex_destroy(mutex: *pthread_mutex_t) E

Functionpthread_cond_wait[src]

pub extern "c" fn pthread_cond_wait(noalias cond: *pthread_cond_t, noalias mutex: *pthread_mutex_t) E

Parameters

Source Code

Source code
pub extern "c" fn pthread_cond_wait(noalias cond: *pthread_cond_t, noalias mutex: *pthread_mutex_t) E

Functionpthread_cond_timedwait[src]

pub extern "c" fn pthread_cond_timedwait(noalias cond: *pthread_cond_t, noalias mutex: *pthread_mutex_t, noalias abstime: *const timespec) E

Parameters

abstime: *const timespec

Source Code

Source code
pub extern "c" fn pthread_cond_timedwait(noalias cond: *pthread_cond_t, noalias mutex: *pthread_mutex_t, noalias abstime: *const timespec) E

Functionpthread_cond_signal[src]

pub extern "c" fn pthread_cond_signal(cond: *pthread_cond_t) E

Parameters

Source Code

Source code
pub extern "c" fn pthread_cond_signal(cond: *pthread_cond_t) E

Functionpthread_cond_broadcast[src]

pub extern "c" fn pthread_cond_broadcast(cond: *pthread_cond_t) E

Parameters

Source Code

Source code
pub extern "c" fn pthread_cond_broadcast(cond: *pthread_cond_t) E

Functionpthread_cond_destroy[src]

pub extern "c" fn pthread_cond_destroy(cond: *pthread_cond_t) E

Parameters

Source Code

Source code
pub extern "c" fn pthread_cond_destroy(cond: *pthread_cond_t) E

Functionpthread_rwlock_destroy[src]

pub extern "c" fn pthread_rwlock_destroy(rwl: *pthread_rwlock_t) callconv(.c) E

Parameters

Source Code

Source code
pub extern "c" fn pthread_rwlock_destroy(rwl: *pthread_rwlock_t) callconv(.c) E

Functionpthread_rwlock_rdlock[src]

pub extern "c" fn pthread_rwlock_rdlock(rwl: *pthread_rwlock_t) callconv(.c) E

Parameters

Source Code

Source code
pub extern "c" fn pthread_rwlock_rdlock(rwl: *pthread_rwlock_t) callconv(.c) E

Functionpthread_rwlock_wrlock[src]

pub extern "c" fn pthread_rwlock_wrlock(rwl: *pthread_rwlock_t) callconv(.c) E

Parameters

Source Code

Source code
pub extern "c" fn pthread_rwlock_wrlock(rwl: *pthread_rwlock_t) callconv(.c) E

Functionpthread_rwlock_tryrdlock[src]

pub extern "c" fn pthread_rwlock_tryrdlock(rwl: *pthread_rwlock_t) callconv(.c) E

Parameters

Source Code

Source code
pub extern "c" fn pthread_rwlock_tryrdlock(rwl: *pthread_rwlock_t) callconv(.c) E

Functionpthread_rwlock_trywrlock[src]

pub extern "c" fn pthread_rwlock_trywrlock(rwl: *pthread_rwlock_t) callconv(.c) E

Parameters

Source Code

Source code
pub extern "c" fn pthread_rwlock_trywrlock(rwl: *pthread_rwlock_t) callconv(.c) E

Functionpthread_rwlock_unlock[src]

pub extern "c" fn pthread_rwlock_unlock(rwl: *pthread_rwlock_t) callconv(.c) E

Parameters

Source Code

Source code
pub extern "c" fn pthread_rwlock_unlock(rwl: *pthread_rwlock_t) callconv(.c) E

Functiondlopen[src]

pub extern "c" fn dlopen(path: ?[*:0]const u8, mode: RTLD) ?*anyopaque

Parameters

path: ?[*:0]const u8
mode: RTLD

Source Code

Source code
pub extern "c" fn dlopen(path: ?[*:0]const u8, mode: RTLD) ?*anyopaque

Functiondlclose[src]

pub extern "c" fn dlclose(handle: *anyopaque) c_int

Parameters

handle: *anyopaque

Source Code

Source code
pub extern "c" fn dlclose(handle: *anyopaque) c_int

Functiondlsym[src]

pub extern "c" fn dlsym(handle: ?*anyopaque, symbol: [*:0]const u8) ?*anyopaque

Parameters

handle: ?*anyopaque
symbol: [*:0]const u8

Source Code

Source code
pub extern "c" fn dlsym(handle: ?*anyopaque, symbol: [*:0]const u8) ?*anyopaque

Functiondlerror[src]

pub extern "c" fn dlerror() ?[*:0]u8

Source Code

Source code
pub extern "c" fn dlerror() ?[*:0]u8

Functionsync[src]

pub extern "c" fn sync() void

Source Code

Source code
pub extern "c" fn sync() void

Functionsyncfs[src]

pub extern "c" fn syncfs(fd: c_int) c_int

Parameters

fd: c_int

Source Code

Source code
pub extern "c" fn syncfs(fd: c_int) c_int

Functionfsync[src]

pub extern "c" fn fsync(fd: c_int) c_int

Parameters

fd: c_int

Source Code

Source code
pub extern "c" fn fsync(fd: c_int) c_int

Functionfdatasync[src]

pub extern "c" fn fdatasync(fd: c_int) c_int

Parameters

fd: c_int

Source Code

Source code
pub extern "c" fn fdatasync(fd: c_int) c_int

Functionprctl[src]

pub extern "c" fn prctl(option: c_int, ...) c_int

Parameters

option: c_int

Source Code

Source code
pub extern "c" fn prctl(option: c_int, ...) c_int

Functiongetrlimit[src]

pub extern "c" fn getrlimit(resource: rlimit_resource, rlim: *rlimit) c_int

Parameters

resource: rlimit_resource
rlim: *rlimit

Source Code

Source code
pub extern "c" fn getrlimit(resource: rlimit_resource, rlim: *rlimit) c_int

Functionsetrlimit[src]

pub extern "c" fn setrlimit(resource: rlimit_resource, rlim: *const rlimit) c_int

Parameters

resource: rlimit_resource
rlim: *const rlimit

Source Code

Source code
pub extern "c" fn setrlimit(resource: rlimit_resource, rlim: *const rlimit) c_int

Functionfmemopen[src]

pub extern "c" fn fmemopen(noalias buf: ?*anyopaque, size: usize, noalias mode: [*:0]const u8) ?*FILE

Parameters

buf: ?*anyopaque
size: usize
mode: [*:0]const u8

Source Code

Source code
pub extern "c" fn fmemopen(noalias buf: ?*anyopaque, size: usize, noalias mode: [*:0]const u8) ?*FILE

Functionsyslog[src]

pub extern "c" fn syslog(priority: c_int, message: [*:0]const u8, ...) void

Parameters

priority: c_int
message: [*:0]const u8

Source Code

Source code
pub extern "c" fn syslog(priority: c_int, message: [*:0]const u8, ...) void

Functionopenlog[src]

pub extern "c" fn openlog(ident: [*:0]const u8, logopt: c_int, facility: c_int) void

Parameters

ident: [*:0]const u8
logopt: c_int
facility: c_int

Source Code

Source code
pub extern "c" fn openlog(ident: [*:0]const u8, logopt: c_int, facility: c_int) void

Functioncloselog[src]

pub extern "c" fn closelog() void

Source Code

Source code
pub extern "c" fn closelog() void

Functionsetlogmask[src]

pub extern "c" fn setlogmask(maskpri: c_int) c_int

Parameters

maskpri: c_int

Source Code

Source code
pub extern "c" fn setlogmask(maskpri: c_int) c_int

Functionif_nametoindex[src]

pub extern "c" fn if_nametoindex([*:0]const u8) c_int

Parameters

if_nametoindex: [*:0]const u8

Source Code

Source code
pub extern "c" fn if_nametoindex([*:0]const u8) c_int

Functiongetpid[src]

pub extern "c" fn getpid() pid_t

Source Code

Source code
pub extern "c" fn getpid() pid_t

Functiongetppid[src]

pub extern "c" fn getppid() pid_t

Source Code

Source code
pub extern "c" fn getppid() pid_t

Functionsetlocale[src]

pub extern "c" fn setlocale(category: LC, locale: ?[*:0]const u8) ?[*:0]const u8

Parameters

category: LC
locale: ?[*:0]const u8

Source Code

Source code
pub extern "c" fn setlocale(category: LC, locale: ?[*:0]const u8) ?[*:0]const u8

Functionpthread_getthreadid_np[src]

pub extern "c" fn pthread_getthreadid_np() c_int

Source Code

Source code
pub extern "c" fn pthread_getthreadid_np() c_int

Functionpthread_set_name_np[src]

pub extern "c" fn pthread_set_name_np(thread: pthread_t, name: [*:0]const u8) void

Parameters

thread: pthread_t
name: [*:0]const u8

Source Code

Source code
pub extern "c" fn pthread_set_name_np(thread: pthread_t, name: [*:0]const u8) void

Functionpthread_get_name_np[src]

pub extern "c" fn pthread_get_name_np(thread: pthread_t, name: [*:0]u8, len: usize) void

Parameters

thread: pthread_t
name: [*:0]u8
len: usize

Source Code

Source code
pub extern "c" fn pthread_get_name_np(thread: pthread_t, name: [*:0]u8, len: usize) void

Function_get_next_area_info[src]

pub extern "root" fn _get_next_area_info(team: i32, cookie: *i64, area_info: *area_info, size: usize) i32

Parameters

team: i32
cookie: *i64
area_info: *area_info
size: usize

Source Code

Source code
pub extern "root" fn _get_next_area_info(team: i32, cookie: *i64, area_info: *area_info, size: usize) i32

Function_get_next_image_info[src]

pub extern "root" fn _get_next_image_info(team: i32, cookie: *i32, image_info: *image_info, size: usize) i32

Parameters

team: i32
cookie: *i32
image_info: *image_info
size: usize

Source Code

Source code
pub extern "root" fn _get_next_image_info(team: i32, cookie: *i32, image_info: *image_info, size: usize) i32

Function_get_team_info[src]

pub extern "root" fn _get_team_info(team: i32, team_info: *team_info, size: usize) i32

Parameters

team: i32
team_info: *team_info
size: usize

Source Code

Source code
pub extern "root" fn _get_team_info(team: i32, team_info: *team_info, size: usize) i32

Functionfind_directory[src]

pub extern "root" fn find_directory(which: directory_which, volume: i32, createIt: bool, path_ptr: [*]u8, length: i32) u64

Parameters

volume: i32
createIt: bool
path_ptr: [*]u8
length: i32

Source Code

Source code
pub extern "root" fn find_directory(which: directory_which, volume: i32, createIt: bool, path_ptr: [*]u8, length: i32) u64

Functionfind_thread[src]

pub extern "root" fn find_thread(thread_name: ?*anyopaque) i32

Parameters

thread_name: ?*anyopaque

Source Code

Source code
pub extern "root" fn find_thread(thread_name: ?*anyopaque) i32

Functionget_system_info[src]

pub extern "root" fn get_system_info(system_info: *system_info) usize

Parameters

system_info: *system_info

Source Code

Source code
pub extern "root" fn get_system_info(system_info: *system_info) usize

Functionauth_approval[src]

pub extern "c" fn auth_approval(as: ?*auth_session_t, ?*login_cap_t, name: ?[*:0]const u8, type: ?[*:0]const u8) c_int

Parameters

auth_session_t: ?*login_cap_t
name: ?[*:0]const u8
type: ?[*:0]const u8

Source Code

Source code
pub extern "c" fn auth_approval(as: ?*auth_session_t, ?*login_cap_t, name: ?[*:0]const u8, type: ?[*:0]const u8) c_int

Functionauth_call[src]

pub extern "c" fn auth_call(as: *auth_session_t, path: [*:0]const u8, ...) c_int

Parameters

path: [*:0]const u8

Source Code

Source code
pub extern "c" fn auth_call(as: *auth_session_t, path: [*:0]const u8, ...) c_int

Functionauth_cat[src]

pub extern "c" fn auth_cat(file: [*:0]const u8) c_int

Parameters

file: [*:0]const u8

Source Code

Source code
pub extern "c" fn auth_cat(file: [*:0]const u8) c_int

Functionauth_challenge[src]

pub extern "c" fn auth_challenge(as: *auth_session_t) [*:0]const u8

Parameters

Source Code

Source code
pub extern "c" fn auth_challenge(as: *auth_session_t) [*:0]const u8

Functionauth_check_change[src]

pub extern "c" fn auth_check_change(as: *auth_session_t) i64

Parameters

Source Code

Source code
pub extern "c" fn auth_check_change(as: *auth_session_t) i64

Functionauth_check_expire[src]

pub extern "c" fn auth_check_expire(as: *auth_session_t) i64

Parameters

Source Code

Source code
pub extern "c" fn auth_check_expire(as: *auth_session_t) i64

Functionauth_checknologin[src]

pub extern "c" fn auth_checknologin(lc: *login_cap_t) void

Parameters

Source Code

Source code
pub extern "c" fn auth_checknologin(lc: *login_cap_t) void

Functionauth_clean[src]

pub extern "c" fn auth_clean(as: *auth_session_t) void

Parameters

Source Code

Source code
pub extern "c" fn auth_clean(as: *auth_session_t) void

Functionauth_close[src]

pub extern "c" fn auth_close(as: *auth_session_t) c_int

Parameters

Source Code

Source code
pub extern "c" fn auth_close(as: *auth_session_t) c_int

Functionauth_clrenv[src]

pub extern "c" fn auth_clrenv(as: *auth_session_t) void

Parameters

Source Code

Source code
pub extern "c" fn auth_clrenv(as: *auth_session_t) void

Functionauth_clroption[src]

pub extern "c" fn auth_clroption(as: *auth_session_t, option: [*:0]const u8) void

Parameters

option: [*:0]const u8

Source Code

Source code
pub extern "c" fn auth_clroption(as: *auth_session_t, option: [*:0]const u8) void

Functionauth_clroptions[src]

pub extern "c" fn auth_clroptions(as: *auth_session_t) void

Parameters

Source Code

Source code
pub extern "c" fn auth_clroptions(as: *auth_session_t) void

Functionauth_getitem[src]

pub extern "c" fn auth_getitem(as: *auth_session_t, item: auth_item_t) ?[*:0]const u8

Parameters

Source Code

Source code
pub extern "c" fn auth_getitem(as: *auth_session_t, item: auth_item_t) ?[*:0]const u8

Functionauth_getpwd[src]

pub extern "c" fn auth_getpwd(as: *auth_session_t) ?*passwd

Parameters

Source Code

Source code
pub extern "c" fn auth_getpwd(as: *auth_session_t) ?*passwd

Functionauth_getstate[src]

pub extern "c" fn auth_getstate(as: *auth_session_t) c_int

Parameters

Source Code

Source code
pub extern "c" fn auth_getstate(as: *auth_session_t) c_int

Functionauth_getvalue[src]

pub extern "c" fn auth_getvalue(as: *auth_session_t, what: [*:0]const u8) ?[*:0]const u8

Parameters

what: [*:0]const u8

Source Code

Source code
pub extern "c" fn auth_getvalue(as: *auth_session_t, what: [*:0]const u8) ?[*:0]const u8

Functionauth_mkvalue[src]

pub extern "c" fn auth_mkvalue(value: [*:0]const u8) ?[*:0]const u8

Parameters

value: [*:0]const u8

Source Code

Source code
pub extern "c" fn auth_mkvalue(value: [*:0]const u8) ?[*:0]const u8

Functionauth_open[src]

pub extern "c" fn auth_open() ?*auth_session_t

Source Code

Source code
pub extern "c" fn auth_open() ?*auth_session_t

Functionauth_setdata[src]

pub extern "c" fn auth_setdata(as: *auth_session_t, ptr: *anyopaque, len: usize) c_int

Parameters

ptr: *anyopaque
len: usize

Source Code

Source code
pub extern "c" fn auth_setdata(as: *auth_session_t, ptr: *anyopaque, len: usize) c_int

Functionauth_setenv[src]

pub extern "c" fn auth_setenv(as: *auth_session_t) void

Parameters

Source Code

Source code
pub extern "c" fn auth_setenv(as: *auth_session_t) void

Functionauth_setitem[src]

pub extern "c" fn auth_setitem(as: *auth_session_t, item: auth_item_t, value: [*:0]const u8) c_int

Parameters

value: [*:0]const u8

Source Code

Source code
pub extern "c" fn auth_setitem(as: *auth_session_t, item: auth_item_t, value: [*:0]const u8) c_int

Functionauth_setoption[src]

pub extern "c" fn auth_setoption(as: *auth_session_t, n: [*:0]const u8, v: [*:0]const u8) c_int

Parameters

n: [*:0]const u8
v: [*:0]const u8

Source Code

Source code
pub extern "c" fn auth_setoption(as: *auth_session_t, n: [*:0]const u8, v: [*:0]const u8) c_int

Functionauth_setpwd[src]

pub extern "c" fn auth_setpwd(as: *auth_session_t, pwd: *passwd) c_int

Parameters

Source Code

Source code
pub extern "c" fn auth_setpwd(as: *auth_session_t, pwd: *passwd) c_int

Functionauth_setstate[src]

pub extern "c" fn auth_setstate(as: *auth_session_t, s: c_int) void

Parameters

s: c_int

Source Code

Source code
pub extern "c" fn auth_setstate(as: *auth_session_t, s: c_int) void

Functionauth_userchallenge[src]

pub extern "c" fn auth_userchallenge(name: [*:0]const u8, style: ?[*:0]const u8, arg_type: ?[*:0]const u8, chappengep: *?[*:0]const u8) ?*auth_session_t

Parameters

name: [*:0]const u8
style: ?[*:0]const u8
arg_type: ?[*:0]const u8
chappengep: *?[*:0]const u8

Source Code

Source code
pub extern "c" fn auth_userchallenge(name: [*:0]const u8, style: ?[*:0]const u8, arg_type: ?[*:0]const u8, chappengep: *?[*:0]const u8) ?*auth_session_t

Functionauth_usercheck[src]

pub extern "c" fn auth_usercheck(name: [*:0]const u8, style: ?[*:0]const u8, arg_type: ?[*:0]const u8, password: ?[*:0]const u8) ?*auth_session_t

Parameters

name: [*:0]const u8
style: ?[*:0]const u8
arg_type: ?[*:0]const u8
password: ?[*:0]const u8

Source Code

Source code
pub extern "c" fn auth_usercheck(name: [*:0]const u8, style: ?[*:0]const u8, arg_type: ?[*:0]const u8, password: ?[*:0]const u8) ?*auth_session_t

Functionauth_userokay[src]

pub extern "c" fn auth_userokay(name: [*:0]const u8, style: ?[*:0]const u8, arg_type: ?[*:0]const u8, password: ?[*:0]const u8) c_int

Parameters

name: [*:0]const u8
style: ?[*:0]const u8
arg_type: ?[*:0]const u8
password: ?[*:0]const u8

Source Code

Source code
pub extern "c" fn auth_userokay(name: [*:0]const u8, style: ?[*:0]const u8, arg_type: ?[*:0]const u8, password: ?[*:0]const u8) c_int

Functionauth_userresponse[src]

pub extern "c" fn auth_userresponse(as: *auth_session_t, response: [*:0]const u8, more: c_int) c_int

Parameters

response: [*:0]const u8
more: c_int

Source Code

Source code
pub extern "c" fn auth_userresponse(as: *auth_session_t, response: [*:0]const u8, more: c_int) c_int

Functionauth_verify[src]

pub extern "c" fn auth_verify(as: ?*auth_session_t, style: ?[*:0]const u8, name: ?[*:0]const u8, ...) ?*auth_session_t

Parameters

style: ?[*:0]const u8
name: ?[*:0]const u8

Source Code

Source code
pub extern "c" fn auth_verify(as: ?*auth_session_t, style: ?[*:0]const u8, name: ?[*:0]const u8, ...) ?*auth_session_t

Functionbcrypt[src]

pub extern "c" fn bcrypt(pass: [*:0]const u8, salt: [*:0]const u8) ?[*:0]const u8

Parameters

pass: [*:0]const u8
salt: [*:0]const u8

Source Code

Source code
pub extern "c" fn bcrypt(pass: [*:0]const u8, salt: [*:0]const u8) ?[*:0]const u8

Functionbcrypt_checkpass[src]

pub extern "c" fn bcrypt_checkpass(pass: [*:0]const u8, goodhash: [*:0]const u8) c_int

Parameters

pass: [*:0]const u8
goodhash: [*:0]const u8

Source Code

Source code
pub extern "c" fn bcrypt_checkpass(pass: [*:0]const u8, goodhash: [*:0]const u8) c_int

Functionbcrypt_gensalt[src]

pub extern "c" fn bcrypt_gensalt(log_rounds: u8) [*:0]const u8

Parameters

log_rounds: u8

Source Code

Source code
pub extern "c" fn bcrypt_gensalt(log_rounds: u8) [*:0]const u8

Functionbcrypt_newhash[src]

pub extern "c" fn bcrypt_newhash(pass: [*:0]const u8, log_rounds: c_int, hash: [*]u8, hashlen: usize) c_int

Parameters

pass: [*:0]const u8
log_rounds: c_int
hash: [*]u8
hashlen: usize

Source Code

Source code
pub extern "c" fn bcrypt_newhash(pass: [*:0]const u8, log_rounds: c_int, hash: [*]u8, hashlen: usize) c_int

Functionendpwent[src]

pub extern "c" fn endpwent() void

Source Code

Source code
pub extern "c" fn endpwent() void

Functionfutex[src]

pub extern "c" fn futex(uaddr: ?*const volatile u32, op: c_int, val: c_int, timeout: ?*const timespec, uaddr2: ?*const volatile u32) c_int

Parameters

uaddr: ?*const volatile u32
op: c_int
val: c_int
timeout: ?*const timespec
uaddr2: ?*const volatile u32

Source Code

Source code
pub extern "c" fn futex(uaddr: ?*const volatile u32, op: c_int, val: c_int, timeout: ?*const timespec, uaddr2: ?*const volatile u32) c_int

Functiongetpwent[src]

pub extern "c" fn getpwent() ?*passwd

Source Code

Source code
pub extern "c" fn getpwent() ?*passwd

Functiongetpwnam_r[src]

pub extern "c" fn getpwnam_r(name: [*:0]const u8, pw: *passwd, buf: [*]u8, buflen: usize, pwretp: *?*passwd) c_int

Parameters

name: [*:0]const u8
pw: *passwd
buf: [*]u8
buflen: usize
pwretp: *?*passwd

Source Code

Source code
pub extern "c" fn getpwnam_r(name: [*:0]const u8, pw: *passwd, buf: [*]u8, buflen: usize, pwretp: *?*passwd) c_int

Functiongetpwnam_shadow[src]

pub extern "c" fn getpwnam_shadow(name: [*:0]const u8) ?*passwd

Parameters

name: [*:0]const u8

Source Code

Source code
pub extern "c" fn getpwnam_shadow(name: [*:0]const u8) ?*passwd

Functiongetpwuid_r[src]

pub extern "c" fn getpwuid_r(uid: uid_t, pw: *passwd, buf: [*]u8, buflen: usize, pwretp: *?*passwd) c_int

Parameters

uid: uid_t
pw: *passwd
buf: [*]u8
buflen: usize
pwretp: *?*passwd

Source Code

Source code
pub extern "c" fn getpwuid_r(uid: uid_t, pw: *passwd, buf: [*]u8, buflen: usize, pwretp: *?*passwd) c_int

Functiongetpwuid_shadow[src]

pub extern "c" fn getpwuid_shadow(uid: uid_t) ?*passwd

Parameters

uid: uid_t

Source Code

Source code
pub extern "c" fn getpwuid_shadow(uid: uid_t) ?*passwd

Functiongetthrid[src]

pub extern "c" fn getthrid() pid_t

Source Code

Source code
pub extern "c" fn getthrid() pid_t

Functionlogin_close[src]

pub extern "c" fn login_close(lc: *login_cap_t) void

Parameters

Source Code

Source code
pub extern "c" fn login_close(lc: *login_cap_t) void

Functionlogin_getcapbool[src]

pub extern "c" fn login_getcapbool(lc: *login_cap_t, cap: [*:0]const u8, def: c_int) c_int

Parameters

cap: [*:0]const u8
def: c_int

Source Code

Source code
pub extern "c" fn login_getcapbool(lc: *login_cap_t, cap: [*:0]const u8, def: c_int) c_int

Functionlogin_getcapnum[src]

pub extern "c" fn login_getcapnum(lc: *login_cap_t, cap: [*:0]const u8, def: i64, err: i64) i64

Parameters

cap: [*:0]const u8
def: i64
err: i64

Source Code

Source code
pub extern "c" fn login_getcapnum(lc: *login_cap_t, cap: [*:0]const u8, def: i64, err: i64) i64

Functionlogin_getcapsize[src]

pub extern "c" fn login_getcapsize(lc: *login_cap_t, cap: [*:0]const u8, def: i64, err: i64) i64

Parameters

cap: [*:0]const u8
def: i64
err: i64

Source Code

Source code
pub extern "c" fn login_getcapsize(lc: *login_cap_t, cap: [*:0]const u8, def: i64, err: i64) i64

Functionlogin_getcapstr[src]

pub extern "c" fn login_getcapstr(lc: *login_cap_t, cap: [*:0]const u8, def: [*:0]const u8, err: [*:0]const u8) [*:0]const u8

Parameters

cap: [*:0]const u8
def: [*:0]const u8
err: [*:0]const u8

Source Code

Source code
pub extern "c" fn login_getcapstr(lc: *login_cap_t, cap: [*:0]const u8, def: [*:0]const u8, err: [*:0]const u8) [*:0]const u8

Functionlogin_getcaptime[src]

pub extern "c" fn login_getcaptime(lc: *login_cap_t, cap: [*:0]const u8, def: i64, err: i64) i64

Parameters

cap: [*:0]const u8
def: i64
err: i64

Source Code

Source code
pub extern "c" fn login_getcaptime(lc: *login_cap_t, cap: [*:0]const u8, def: i64, err: i64) i64

Functionlogin_getclass[src]

pub extern "c" fn login_getclass(class: ?[*:0]const u8) ?*login_cap_t

Parameters

class: ?[*:0]const u8

Source Code

Source code
pub extern "c" fn login_getclass(class: ?[*:0]const u8) ?*login_cap_t

Functionlogin_getstyle[src]

pub extern "c" fn login_getstyle(lc: *login_cap_t, style: ?[*:0]const u8, atype: ?[*:0]const u8) ?[*:0]const u8

Parameters

style: ?[*:0]const u8
atype: ?[*:0]const u8

Source Code

Source code
pub extern "c" fn login_getstyle(lc: *login_cap_t, style: ?[*:0]const u8, atype: ?[*:0]const u8) ?[*:0]const u8

Functionpledge[src]

pub extern "c" fn pledge(promises: ?[*:0]const u8, execpromises: ?[*:0]const u8) c_int

Parameters

promises: ?[*:0]const u8
execpromises: ?[*:0]const u8

Source Code

Source code
pub extern "c" fn pledge(promises: ?[*:0]const u8, execpromises: ?[*:0]const u8) c_int

Functionpw_dup[src]

pub extern "c" fn pw_dup(pw: *const passwd) ?*passwd

Parameters

pw: *const passwd

Source Code

Source code
pub extern "c" fn pw_dup(pw: *const passwd) ?*passwd

Functionsetclasscontext[src]

pub extern "c" fn setclasscontext(class: [*:0]const u8, flags: c_uint) c_int

Parameters

class: [*:0]const u8
flags: c_uint

Source Code

Source code
pub extern "c" fn setclasscontext(class: [*:0]const u8, flags: c_uint) c_int

Functionsetpassent[src]

pub extern "c" fn setpassent(stayopen: c_int) c_int

Parameters

stayopen: c_int

Source Code

Source code
pub extern "c" fn setpassent(stayopen: c_int) c_int

Functionsetpwent[src]

pub extern "c" fn setpwent() void

Source Code

Source code
pub extern "c" fn setpwent() void

Functionsetusercontext[src]

pub extern "c" fn setusercontext(lc: *login_cap_t, pwd: *passwd, uid: uid_t, flags: c_uint) c_int

Parameters

pwd: *passwd
uid: uid_t
flags: c_uint

Source Code

Source code
pub extern "c" fn setusercontext(lc: *login_cap_t, pwd: *passwd, uid: uid_t, flags: c_uint) c_int

Functionuid_from_user[src]

pub extern "c" fn uid_from_user(name: [*:0]const u8, uid: *uid_t) c_int

Parameters

name: [*:0]const u8
uid: *uid_t

Source Code

Source code
pub extern "c" fn uid_from_user(name: [*:0]const u8, uid: *uid_t) c_int

Functionunveil[src]

pub extern "c" fn unveil(path: ?[*:0]const u8, permissions: ?[*:0]const u8) c_int

Parameters

path: ?[*:0]const u8
permissions: ?[*:0]const u8

Source Code

Source code
pub extern "c" fn unveil(path: ?[*:0]const u8, permissions: ?[*:0]const u8) c_int

Functionuser_from_uid[src]

pub extern "c" fn user_from_uid(uid: uid_t, noname: c_int) ?[*:0]const u8

Parameters

uid: uid_t
noname: c_int

Source Code

Source code
pub extern "c" fn user_from_uid(uid: uid_t, noname: c_int) ?[*:0]const u8

Function_umtx_op[src]

pub extern "c" fn _umtx_op(obj: usize, op: c_int, val: c_ulong, uaddr: usize, uaddr2: usize) c_int

Parameters

obj: usize
op: c_int
val: c_ulong
uaddr: usize
uaddr2: usize

Source Code

Source code
pub extern "c" fn _umtx_op(obj: usize, op: c_int, val: c_ulong, uaddr: usize, uaddr2: usize) c_int

Functionkinfo_getfile[src]

pub extern "c" fn kinfo_getfile(pid: pid_t, cntp: *c_int) ?[*]kinfo_file

Parameters

pid: pid_t
cntp: *c_int

Source Code

Source code
pub extern "c" fn kinfo_getfile(pid: pid_t, cntp: *c_int) ?[*]kinfo_file

FunctionNSVersionOfRunTimeLibrary[src]

pub extern "c" fn NSVersionOfRunTimeLibrary(library_name: [*:0]const u8) u32

Parameters

library_name: [*:0]const u8

Source Code

Source code
pub extern "c" fn NSVersionOfRunTimeLibrary(library_name: [*:0]const u8) u32

Function_NSGetExecutablePath[src]

pub extern "c" fn _NSGetExecutablePath(buf: [*:0]u8, bufsize: *u32) c_int

Parameters

buf: [*:0]u8
bufsize: *u32

Source Code

Source code
pub extern "c" fn _NSGetExecutablePath(buf: [*:0]u8, bufsize: *u32) c_int

Function__getdirentries64[src]

pub extern "c" fn __getdirentries64(fd: c_int, buf_ptr: [*]u8, buf_len: usize, basep: *i64) isize

Parameters

fd: c_int
buf_ptr: [*]u8
buf_len: usize
basep: *i64

Source Code

Source code
pub extern "c" fn __getdirentries64(fd: c_int, buf_ptr: [*]u8, buf_len: usize, basep: *i64) isize

Function__ulock_wait[src]

pub extern "c" fn __ulock_wait(op: UL, addr: ?*const anyopaque, val: u64, timeout_us: u32) c_int

Parameters

op: UL
addr: ?*const anyopaque
val: u64
timeout_us: u32

Source Code

Source code
pub extern "c" fn __ulock_wait(op: UL, addr: ?*const anyopaque, val: u64, timeout_us: u32) c_int

Function__ulock_wait2[src]

pub extern "c" fn __ulock_wait2(op: UL, addr: ?*const anyopaque, val: u64, timeout_ns: u64, val2: u64) c_int

Parameters

op: UL
addr: ?*const anyopaque
val: u64
timeout_ns: u64
val2: u64

Source Code

Source code
pub extern "c" fn __ulock_wait2(op: UL, addr: ?*const anyopaque, val: u64, timeout_ns: u64, val2: u64) c_int

Function__ulock_wake[src]

pub extern "c" fn __ulock_wake(op: UL, addr: ?*const anyopaque, val: u64) c_int

Parameters

op: UL
addr: ?*const anyopaque
val: u64

Source Code

Source code
pub extern "c" fn __ulock_wake(op: UL, addr: ?*const anyopaque, val: u64) c_int

Function_dyld_get_image_header[src]

pub extern "c" fn _dyld_get_image_header(image_index: u32) ?*mach_header

Parameters

image_index: u32

Source Code

Source code
pub extern "c" fn _dyld_get_image_header(image_index: u32) ?*mach_header

Function_dyld_get_image_name[src]

pub extern "c" fn _dyld_get_image_name(image_index: u32) [*:0]const u8

Parameters

image_index: u32

Source Code

Source code
pub extern "c" fn _dyld_get_image_name(image_index: u32) [*:0]const u8

Function_dyld_get_image_vmaddr_slide[src]

pub extern "c" fn _dyld_get_image_vmaddr_slide(image_index: u32) usize

Parameters

image_index: u32

Source Code

Source code
pub extern "c" fn _dyld_get_image_vmaddr_slide(image_index: u32) usize

Function_dyld_image_count[src]

pub extern "c" fn _dyld_image_count() u32

Source Code

Source code
pub extern "c" fn _dyld_image_count() u32

Function_host_page_size[src]

pub extern "c" fn _host_page_size(task: mach_port_t, size: *vm_size_t) kern_return_t

Parameters

Source Code

Source code
pub extern "c" fn _host_page_size(task: mach_port_t, size: *vm_size_t) kern_return_t

Functionclock_get_time[src]

pub extern "c" fn clock_get_time(clock_serv: clock_serv_t, cur_time: *mach_timespec_t) kern_return_t

Parameters

clock_serv: clock_serv_t
cur_time: *mach_timespec_t

Source Code

Source code
pub extern "c" fn clock_get_time(clock_serv: clock_serv_t, cur_time: *mach_timespec_t) kern_return_t

Function@"close$NOCANCEL"[src]

pub extern "c" fn @"close$NOCANCEL"(fd: fd_t) c_int

Parameters

fd: fd_t

Source Code

Source code
pub extern "c" fn @"close$NOCANCEL"(fd: fd_t) c_int

Functiondispatch_release[src]

pub extern "c" fn dispatch_release(object: *anyopaque) void

Parameters

object: *anyopaque

Source Code

Source code
pub extern "c" fn dispatch_release(object: *anyopaque) void

Functiondispatch_semaphore_create[src]

pub extern "c" fn dispatch_semaphore_create(value: isize) ?dispatch_semaphore_t

Parameters

value: isize

Source Code

Source code
pub extern "c" fn dispatch_semaphore_create(value: isize) ?dispatch_semaphore_t

Functiondispatch_semaphore_signal[src]

pub extern "c" fn dispatch_semaphore_signal(dsema: dispatch_semaphore_t) isize

Parameters

Source Code

Source code
pub extern "c" fn dispatch_semaphore_signal(dsema: dispatch_semaphore_t) isize

Functiondispatch_semaphore_wait[src]

pub extern "c" fn dispatch_semaphore_wait(dsema: dispatch_semaphore_t, timeout: dispatch_time_t) isize

Parameters

Source Code

Source code
pub extern "c" fn dispatch_semaphore_wait(dsema: dispatch_semaphore_t, timeout: dispatch_time_t) isize

Functiondispatch_time[src]

pub extern "c" fn dispatch_time(when: dispatch_time_t, delta: i64) dispatch_time_t

Parameters

delta: i64

Source Code

Source code
pub extern "c" fn dispatch_time(when: dispatch_time_t, delta: i64) dispatch_time_t

Functionfcopyfile[src]

pub extern "c" fn fcopyfile(from: fd_t, to: fd_t, state: ?copyfile_state_t, flags: COPYFILE) c_int

Parameters

from: fd_t
to: fd_t
flags: COPYFILE

Source Code

Source code
pub extern "c" fn fcopyfile(from: fd_t, to: fd_t, state: ?copyfile_state_t, flags: COPYFILE) c_int

Functionkevent64[src]

pub extern "c" fn kevent64( kq: c_int, changelist: [*]const kevent64_s, nchanges: c_int, eventlist: [*]kevent64_s, nevents: c_int, flags: c_uint, timeout: ?*const timespec, ) c_int

Parameters

kq: c_int
changelist: [*]const kevent64_s
nchanges: c_int
eventlist: [*]kevent64_s
nevents: c_int
flags: c_uint
timeout: ?*const timespec

Source Code

Source code
pub extern "c" fn kevent64(
    kq: c_int,
    changelist: [*]const kevent64_s,
    nchanges: c_int,
    eventlist: [*]kevent64_s,
    nevents: c_int,
    flags: c_uint,
    timeout: ?*const timespec,
) c_int

Functionmach_absolute_time[src]

pub extern "c" fn mach_absolute_time() u64

Source Code

Source code
pub extern "c" fn mach_absolute_time() u64

Functionmach_continuous_time[src]

pub extern "c" fn mach_continuous_time() u64

Source Code

Source code
pub extern "c" fn mach_continuous_time() u64

Functionmach_host_self[src]

pub extern "c" fn mach_host_self() mach_port_t

Source Code

Source code
pub extern "c" fn mach_host_self() mach_port_t

Functionmach_msg[src]

pub extern "c" fn mach_msg( msg: ?*mach_msg_header_t, option: mach_msg_option_t, send_size: mach_msg_size_t, rcv_size: mach_msg_size_t, rcv_name: mach_port_name_t, timeout: mach_msg_timeout_t, notify: mach_port_name_t, ) kern_return_t

Source Code

Source code
pub extern "c" fn mach_msg(
    msg: ?*mach_msg_header_t,
    option: mach_msg_option_t,
    send_size: mach_msg_size_t,
    rcv_size: mach_msg_size_t,
    rcv_name: mach_port_name_t,
    timeout: mach_msg_timeout_t,
    notify: mach_port_name_t,
) kern_return_t

Functionmach_port_allocate[src]

pub extern "c" fn mach_port_allocate( task: ipc_space_t, right: mach_port_right_t, name: *mach_port_name_t, ) kern_return_t

Parameters

Source Code

Source code
pub extern "c" fn mach_port_allocate(
    task: ipc_space_t,
    right: mach_port_right_t,
    name: *mach_port_name_t,
) kern_return_t

Functionmach_port_deallocate[src]

pub extern "c" fn mach_port_deallocate(task: ipc_space_t, name: mach_port_name_t) kern_return_t

Parameters

Source Code

Source code
pub extern "c" fn mach_port_deallocate(task: ipc_space_t, name: mach_port_name_t) kern_return_t

Functionmach_port_insert_right[src]

pub extern "c" fn mach_port_insert_right( task: ipc_space_t, name: mach_port_name_t, poly: mach_port_t, poly_poly: mach_msg_type_name_t, ) kern_return_t

Parameters

Source Code

Source code
pub extern "c" fn mach_port_insert_right(
    task: ipc_space_t,
    name: mach_port_name_t,
    poly: mach_port_t,
    poly_poly: mach_msg_type_name_t,
) kern_return_t

Functionmach_task_self[src]

pub fn mach_task_self() callconv(.c) mach_port_t

Source Code

Source code
pub fn mach_task_self() callconv(.c) mach_port_t {
    return mach_task_self_;
}

Functionmach_timebase_info[src]

pub extern "c" fn mach_timebase_info(tinfo: ?*mach_timebase_info_data) kern_return_t

Parameters

Source Code

Source code
pub extern "c" fn mach_timebase_info(tinfo: ?*mach_timebase_info_data) kern_return_t

Functionmach_vm_protect[src]

pub extern "c" fn mach_vm_protect( target_task: vm_map_t, address: mach_vm_address_t, size: mach_vm_size_t, set_maximum: boolean_t, new_protection: vm_prot_t, ) kern_return_t

Parameters

target_task: vm_map_t
set_maximum: boolean_t
new_protection: vm_prot_t

Source Code

Source code
pub extern "c" fn mach_vm_protect(
    target_task: vm_map_t,
    address: mach_vm_address_t,
    size: mach_vm_size_t,
    set_maximum: boolean_t,
    new_protection: vm_prot_t,
) kern_return_t

Functionmach_vm_read[src]

pub extern "c" fn mach_vm_read( target_task: vm_map_read_t, address: mach_vm_address_t, size: mach_vm_size_t, data: *vm_offset_t, data_cnt: *mach_msg_type_number_t, ) kern_return_t

Parameters

Source Code

Source code
pub extern "c" fn mach_vm_read(
    target_task: vm_map_read_t,
    address: mach_vm_address_t,
    size: mach_vm_size_t,
    data: *vm_offset_t,
    data_cnt: *mach_msg_type_number_t,
) kern_return_t

Functionmach_vm_region[src]

pub extern "c" fn mach_vm_region( target_task: vm_map_t, address: *mach_vm_address_t, size: *mach_vm_size_t, flavor: vm_region_flavor_t, info: vm_region_info_t, info_cnt: *mach_msg_type_number_t, object_name: *mach_port_t, ) kern_return_t

Parameters

Source Code

Source code
pub extern "c" fn mach_vm_region(
    target_task: vm_map_t,
    address: *mach_vm_address_t,
    size: *mach_vm_size_t,
    flavor: vm_region_flavor_t,
    info: vm_region_info_t,
    info_cnt: *mach_msg_type_number_t,
    object_name: *mach_port_t,
) kern_return_t

Functionmach_vm_region_recurse[src]

pub extern "c" fn mach_vm_region_recurse( target_task: vm_map_t, address: *mach_vm_address_t, size: *mach_vm_size_t, nesting_depth: *natural_t, info: vm_region_recurse_info_t, info_cnt: *mach_msg_type_number_t, ) kern_return_t

Parameters

target_task: vm_map_t
nesting_depth: *natural_t

Source Code

Source code
pub extern "c" fn mach_vm_region_recurse(
    target_task: vm_map_t,
    address: *mach_vm_address_t,
    size: *mach_vm_size_t,
    nesting_depth: *natural_t,
    info: vm_region_recurse_info_t,
    info_cnt: *mach_msg_type_number_t,
) kern_return_t

Functionmach_vm_write[src]

pub extern "c" fn mach_vm_write( target_task: vm_map_t, address: mach_vm_address_t, data: vm_offset_t, data_cnt: mach_msg_type_number_t, ) kern_return_t

Parameters

Source Code

Source code
pub extern "c" fn mach_vm_write(
    target_task: vm_map_t,
    address: mach_vm_address_t,
    data: vm_offset_t,
    data_cnt: mach_msg_type_number_t,
) kern_return_t

Functionos_log_create[src]

pub extern "c" fn os_log_create(subsystem: [*]const u8, category: [*]const u8) os_log_t

Parameters

subsystem: [*]const u8
category: [*]const u8

Source Code

Source code
pub extern "c" fn os_log_create(subsystem: [*]const u8, category: [*]const u8) os_log_t

Functionos_log_type_enabled[src]

pub extern "c" fn os_log_type_enabled(log: os_log_t, tpe: os_log_type_t) bool

Parameters

Source Code

Source code
pub extern "c" fn os_log_type_enabled(log: os_log_t, tpe: os_log_type_t) bool

Functionos_signpost_enabled[src]

pub extern "c" fn os_signpost_enabled(log: os_log_t) bool

Parameters

Source Code

Source code
pub extern "c" fn os_signpost_enabled(log: os_log_t) bool

Functionos_signpost_id_generate[src]

pub extern "c" fn os_signpost_id_generate(log: os_log_t) os_signpost_id_t

Parameters

Source Code

Source code
pub extern "c" fn os_signpost_id_generate(log: os_log_t) os_signpost_id_t

Functionos_signpost_id_make_with_pointer[src]

pub extern "c" fn os_signpost_id_make_with_pointer(log: os_log_t, ptr: ?*anyopaque) os_signpost_id_t

Parameters

ptr: ?*anyopaque

Source Code

Source code
pub extern "c" fn os_signpost_id_make_with_pointer(log: os_log_t, ptr: ?*anyopaque) os_signpost_id_t

Functionos_signpost_interval_begin[src]

pub extern "c" fn os_signpost_interval_begin(log: os_log_t, signpos: os_signpost_id_t, func: [*]const u8, ...) void

Parameters

func: [*]const u8

Source Code

Source code
pub extern "c" fn os_signpost_interval_begin(log: os_log_t, signpos: os_signpost_id_t, func: [*]const u8, ...) void

Functionos_signpost_interval_end[src]

pub extern "c" fn os_signpost_interval_end(log: os_log_t, signpos: os_signpost_id_t, func: [*]const u8, ...) void

Parameters

func: [*]const u8

Source Code

Source code
pub extern "c" fn os_signpost_interval_end(log: os_log_t, signpos: os_signpost_id_t, func: [*]const u8, ...) void

Functionos_unfair_lock_assert_not_owner[src]

pub extern "c" fn os_unfair_lock_assert_not_owner(o: os_unfair_lock_t) void

Parameters

Source Code

Source code
pub extern "c" fn os_unfair_lock_assert_not_owner(o: os_unfair_lock_t) void

Functionos_unfair_lock_assert_owner[src]

pub extern "c" fn os_unfair_lock_assert_owner(o: os_unfair_lock_t) void

Parameters

Source Code

Source code
pub extern "c" fn os_unfair_lock_assert_owner(o: os_unfair_lock_t) void

Functionos_unfair_lock_lock[src]

pub extern "c" fn os_unfair_lock_lock(o: os_unfair_lock_t) void

Parameters

Source Code

Source code
pub extern "c" fn os_unfair_lock_lock(o: os_unfair_lock_t) void

Functionos_unfair_lock_trylock[src]

pub extern "c" fn os_unfair_lock_trylock(o: os_unfair_lock_t) bool

Parameters

Source Code

Source code
pub extern "c" fn os_unfair_lock_trylock(o: os_unfair_lock_t) bool

Functionos_unfair_lock_unlock[src]

pub extern "c" fn os_unfair_lock_unlock(o: os_unfair_lock_t) void

Parameters

Source Code

Source code
pub extern "c" fn os_unfair_lock_unlock(o: os_unfair_lock_t) void

Functionpid_for_task[src]

pub extern "c" fn pid_for_task(target_tport: mach_port_name_t, pid: *pid_t) kern_return_t

Parameters

target_tport: mach_port_name_t
pid: *pid_t

Source Code

Source code
pub extern "c" fn pid_for_task(target_tport: mach_port_name_t, pid: *pid_t) kern_return_t

Functionposix_spawn[src]

pub extern "c" fn posix_spawn( pid: *pid_t, path: [*:0]const u8, actions: ?*const posix_spawn_file_actions_t, attr: ?*const posix_spawnattr_t, argv: [*:null]const ?[*:0]const u8, env: [*:null]const ?[*:0]const u8, ) c_int

Parameters

pid: *pid_t
path: [*:0]const u8
attr: ?*const posix_spawnattr_t
argv: [*:null]const ?[*:0]const u8
env: [*:null]const ?[*:0]const u8

Source Code

Source code
pub extern "c" fn posix_spawn(
    pid: *pid_t,
    path: [*:0]const u8,
    actions: ?*const posix_spawn_file_actions_t,
    attr: ?*const posix_spawnattr_t,
    argv: [*:null]const ?[*:0]const u8,
    env: [*:null]const ?[*:0]const u8,
) c_int

Functionposix_spawn_file_actions_addchdir_np[src]

pub extern "c" fn posix_spawn_file_actions_addchdir_np(actions: *posix_spawn_file_actions_t, path: [*:0]const u8) c_int

Parameters

path: [*:0]const u8

Source Code

Source code
pub extern "c" fn posix_spawn_file_actions_addchdir_np(actions: *posix_spawn_file_actions_t, path: [*:0]const u8) c_int

Functionposix_spawn_file_actions_addclose[src]

pub extern "c" fn posix_spawn_file_actions_addclose(actions: *posix_spawn_file_actions_t, filedes: fd_t) c_int

Parameters

Source Code

Source code
pub extern "c" fn posix_spawn_file_actions_addclose(actions: *posix_spawn_file_actions_t, filedes: fd_t) c_int

Functionposix_spawn_file_actions_adddup2[src]

pub extern "c" fn posix_spawn_file_actions_adddup2( actions: *posix_spawn_file_actions_t, filedes: fd_t, newfiledes: fd_t, ) c_int

Parameters

filedes: fd_t
newfiledes: fd_t

Source Code

Source code
pub extern "c" fn posix_spawn_file_actions_adddup2(
    actions: *posix_spawn_file_actions_t,
    filedes: fd_t,
    newfiledes: fd_t,
) c_int

Functionposix_spawn_file_actions_addfchdir_np[src]

pub extern "c" fn posix_spawn_file_actions_addfchdir_np(actions: *posix_spawn_file_actions_t, filedes: fd_t) c_int

Parameters

Source Code

Source code
pub extern "c" fn posix_spawn_file_actions_addfchdir_np(actions: *posix_spawn_file_actions_t, filedes: fd_t) c_int

Functionposix_spawn_file_actions_addinherit_np[src]

pub extern "c" fn posix_spawn_file_actions_addinherit_np(actions: *posix_spawn_file_actions_t, filedes: fd_t) c_int

Parameters

Source Code

Source code
pub extern "c" fn posix_spawn_file_actions_addinherit_np(actions: *posix_spawn_file_actions_t, filedes: fd_t) c_int

Functionposix_spawn_file_actions_addopen[src]

pub extern "c" fn posix_spawn_file_actions_addopen( actions: *posix_spawn_file_actions_t, filedes: fd_t, path: [*:0]const u8, oflag: c_int, mode: mode_t, ) c_int

Parameters

filedes: fd_t
path: [*:0]const u8
oflag: c_int
mode: mode_t

Source Code

Source code
pub extern "c" fn posix_spawn_file_actions_addopen(
    actions: *posix_spawn_file_actions_t,
    filedes: fd_t,
    path: [*:0]const u8,
    oflag: c_int,
    mode: mode_t,
) c_int

Functionposix_spawn_file_actions_destroy[src]

pub extern "c" fn posix_spawn_file_actions_destroy(actions: *posix_spawn_file_actions_t) c_int

Parameters

Source Code

Source code
pub extern "c" fn posix_spawn_file_actions_destroy(actions: *posix_spawn_file_actions_t) c_int

Functionposix_spawn_file_actions_init[src]

pub extern "c" fn posix_spawn_file_actions_init(actions: *posix_spawn_file_actions_t) c_int

Parameters

Source Code

Source code
pub extern "c" fn posix_spawn_file_actions_init(actions: *posix_spawn_file_actions_t) c_int

Functionposix_spawnattr_destroy[src]

pub extern "c" fn posix_spawnattr_destroy(attr: *posix_spawnattr_t) c_int

Parameters

Source Code

Source code
pub extern "c" fn posix_spawnattr_destroy(attr: *posix_spawnattr_t) c_int

Functionposix_spawnattr_getflags[src]

pub extern "c" fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *c_short) c_int

Parameters

attr: *const posix_spawnattr_t
flags: *c_short

Source Code

Source code
pub extern "c" fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *c_short) c_int

Functionposix_spawnattr_init[src]

pub extern "c" fn posix_spawnattr_init(attr: *posix_spawnattr_t) c_int

Parameters

Source Code

Source code
pub extern "c" fn posix_spawnattr_init(attr: *posix_spawnattr_t) c_int

Functionposix_spawnattr_setflags[src]

pub extern "c" fn posix_spawnattr_setflags(attr: *posix_spawnattr_t, flags: c_short) c_int

Parameters

flags: c_short

Source Code

Source code
pub extern "c" fn posix_spawnattr_setflags(attr: *posix_spawnattr_t, flags: c_short) c_int

Functionposix_spawnp[src]

pub extern "c" fn posix_spawnp( pid: *pid_t, path: [*:0]const u8, actions: ?*const posix_spawn_file_actions_t, attr: ?*const posix_spawnattr_t, argv: [*:null]const ?[*:0]const u8, env: [*:null]const ?[*:0]const u8, ) c_int

Parameters

pid: *pid_t
path: [*:0]const u8
attr: ?*const posix_spawnattr_t
argv: [*:null]const ?[*:0]const u8
env: [*:null]const ?[*:0]const u8

Source Code

Source code
pub extern "c" fn posix_spawnp(
    pid: *pid_t,
    path: [*:0]const u8,
    actions: ?*const posix_spawn_file_actions_t,
    attr: ?*const posix_spawnattr_t,
    argv: [*:null]const ?[*:0]const u8,
    env: [*:null]const ?[*:0]const u8,
) c_int

Functionpthread_attr_get_qos_class_np[src]

pub extern "c" fn pthread_attr_get_qos_class_np(attr: *pthread_attr_t, qos_class: *qos_class_t, relative_priority: *c_int) c_int

Parameters

qos_class: *qos_class_t
relative_priority: *c_int

Source Code

Source code
pub extern "c" fn pthread_attr_get_qos_class_np(attr: *pthread_attr_t, qos_class: *qos_class_t, relative_priority: *c_int) c_int

Functionpthread_attr_set_qos_class_np[src]

pub extern "c" fn pthread_attr_set_qos_class_np(attr: *pthread_attr_t, qos_class: qos_class_t, relative_priority: c_int) c_int

Parameters

qos_class: qos_class_t
relative_priority: c_int

Source Code

Source code
pub extern "c" fn pthread_attr_set_qos_class_np(attr: *pthread_attr_t, qos_class: qos_class_t, relative_priority: c_int) c_int

Functionpthread_get_qos_class_np[src]

pub extern "c" fn pthread_get_qos_class_np(pthread: std.c.pthread_t, qos_class: *qos_class_t, relative_priority: *c_int) c_int

Parameters

pthread: std.c.pthread_t
qos_class: *qos_class_t
relative_priority: *c_int

Source Code

Source code
pub extern "c" fn pthread_get_qos_class_np(pthread: std.c.pthread_t, qos_class: *qos_class_t, relative_priority: *c_int) c_int

Functionpthread_set_qos_class_self_np[src]

pub extern "c" fn pthread_set_qos_class_self_np(qos_class: qos_class_t, relative_priority: c_int) c_int

Parameters

qos_class: qos_class_t
relative_priority: c_int

Source Code

Source code
pub extern "c" fn pthread_set_qos_class_self_np(qos_class: qos_class_t, relative_priority: c_int) c_int

Functionptrace[src]

pub extern "c" fn ptrace(request: c_int, pid: pid_t, addr: caddr_t, data: c_int) c_int

Parameters

request: c_int
pid: pid_t
addr: caddr_t
data: c_int

Source Code

Source code
pub extern "c" fn ptrace(request: c_int, pid: pid_t, addr: caddr_t, data: c_int) c_int

Functionsigaddset[src]

pub fn sigaddset(set: *sigset_t, signo: u5) void

Parameters

set: *sigset_t
signo: u5

Source Code

Source code
pub fn sigaddset(set: *sigset_t, signo: u5) void {
    set.* |= @as(u32, 1) << (signo - 1);
}

Functiontask_for_pid[src]

pub extern "c" fn task_for_pid(target_tport: mach_port_name_t, pid: pid_t, t: *mach_port_name_t) kern_return_t

Parameters

Source Code

Source code
pub extern "c" fn task_for_pid(target_tport: mach_port_name_t, pid: pid_t, t: *mach_port_name_t) kern_return_t

Functiontask_get_exception_ports[src]

pub extern "c" fn task_get_exception_ports( task: task_t, exception_mask: exception_mask_t, masks: exception_mask_array_t, masks_cnt: *mach_msg_type_number_t, old_handlers: exception_handler_array_t, old_behaviors: exception_behavior_array_t, old_flavors: exception_flavor_array_t, ) kern_return_t

Source Code

Source code
pub extern "c" fn task_get_exception_ports(
    task: task_t,
    exception_mask: exception_mask_t,
    masks: exception_mask_array_t,
    masks_cnt: *mach_msg_type_number_t,
    old_handlers: exception_handler_array_t,
    old_behaviors: exception_behavior_array_t,
    old_flavors: exception_flavor_array_t,
) kern_return_t

Functiontask_info[src]

pub extern "c" fn task_info( target_task: task_name_t, flavor: task_flavor_t, task_info_out: task_info_t, task_info_outCnt: *mach_msg_type_number_t, ) kern_return_t

Parameters

target_task: task_name_t
task_info_out: task_info_t
task_info_outCnt: *mach_msg_type_number_t

Source Code

Source code
pub extern "c" fn task_info(
    target_task: task_name_t,
    flavor: task_flavor_t,
    task_info_out: task_info_t,
    task_info_outCnt: *mach_msg_type_number_t,
) kern_return_t

Functiontask_resume[src]

pub extern "c" fn task_resume(target_task: task_read_t) kern_return_t

Parameters

target_task: task_read_t

Source Code

Source code
pub extern "c" fn task_resume(target_task: task_read_t) kern_return_t

Functiontask_set_exception_ports[src]

pub extern "c" fn task_set_exception_ports( task: task_t, exception_mask: exception_mask_t, new_port: mach_port_t, behavior: exception_behavior_t, new_flavor: thread_state_flavor_t, ) kern_return_t

Parameters

task: task_t
exception_mask: exception_mask_t
new_port: mach_port_t

Source Code

Source code
pub extern "c" fn task_set_exception_ports(
    task: task_t,
    exception_mask: exception_mask_t,
    new_port: mach_port_t,
    behavior: exception_behavior_t,
    new_flavor: thread_state_flavor_t,
) kern_return_t

Functiontask_suspend[src]

pub extern "c" fn task_suspend(target_task: task_read_t) kern_return_t

Parameters

target_task: task_read_t

Source Code

Source code
pub extern "c" fn task_suspend(target_task: task_read_t) kern_return_t

Functiontask_threads[src]

pub extern "c" fn task_threads( target_task: mach_port_t, init_port_set: *mach_port_array_t, init_port_count: *mach_msg_type_number_t, ) kern_return_t

Parameters

target_task: mach_port_t
init_port_set: *mach_port_array_t
init_port_count: *mach_msg_type_number_t

Source Code

Source code
pub extern "c" fn task_threads(
    target_task: mach_port_t,
    init_port_set: *mach_port_array_t,
    init_port_count: *mach_msg_type_number_t,
) kern_return_t

Functionthread_get_state[src]

pub extern "c" fn thread_get_state( thread: thread_act_t, flavor: thread_flavor_t, state: thread_state_t, count: *mach_msg_type_number_t, ) kern_return_t

Source Code

Source code
pub extern "c" fn thread_get_state(
    thread: thread_act_t,
    flavor: thread_flavor_t,
    state: thread_state_t,
    count: *mach_msg_type_number_t,
) kern_return_t

Functionthread_info[src]

pub extern "c" fn thread_info( thread: thread_act_t, flavor: thread_flavor_t, info: thread_info_t, count: *mach_msg_type_number_t, ) kern_return_t

Source Code

Source code
pub extern "c" fn thread_info(
    thread: thread_act_t,
    flavor: thread_flavor_t,
    info: thread_info_t,
    count: *mach_msg_type_number_t,
) kern_return_t

Functionthread_resume[src]

pub extern "c" fn thread_resume(thread: thread_act_t) kern_return_t

Parameters

thread: thread_act_t

Source Code

Source code
pub extern "c" fn thread_resume(thread: thread_act_t) kern_return_t

Functionthread_set_state[src]

pub extern "c" fn thread_set_state( thread: thread_act_t, flavor: thread_flavor_t, new_state: thread_state_t, count: mach_msg_type_number_t, ) kern_return_t

Parameters

Source Code

Source code
pub extern "c" fn thread_set_state(
    thread: thread_act_t,
    flavor: thread_flavor_t,
    new_state: thread_state_t,
    count: mach_msg_type_number_t,
) kern_return_t

Functionvm_deallocate[src]

pub extern "c" fn vm_deallocate(target_task: vm_map_t, address: vm_address_t, size: vm_size_t) kern_return_t

Parameters

target_task: vm_map_t
address: vm_address_t
size: vm_size_t

Source Code

Source code
pub extern "c" fn vm_deallocate(target_task: vm_map_t, address: vm_address_t, size: vm_size_t) kern_return_t

Functionvm_machine_attribute[src]

pub extern "c" fn vm_machine_attribute( target_task: vm_map_t, address: vm_address_t, size: vm_size_t, attribute: vm_machine_attribute_t, value: *vm_machine_attribute_val_t, ) kern_return_t

Parameters

Source Code

Source code
pub extern "c" fn vm_machine_attribute(
    target_task: vm_map_t,
    address: vm_address_t,
    size: vm_size_t,
    attribute: vm_machine_attribute_t,
    value: *vm_machine_attribute_val_t,
) kern_return_t

Function_lwp_self[src]

pub extern "c" fn _lwp_self() lwpid_t

Source Code

Source code
pub extern "c" fn _lwp_self() lwpid_t

Functionlwp_gettid[src]

pub extern "c" fn lwp_gettid() c_int

Source Code

Source code
pub extern "c" fn lwp_gettid() c_int

Functionumtx_sleep[src]

pub extern "c" fn umtx_sleep(ptr: *const volatile c_int, value: c_int, timeout: c_int) c_int

Parameters

ptr: *const volatile c_int
value: c_int
timeout: c_int

Source Code

Source code
pub extern "c" fn umtx_sleep(ptr: *const volatile c_int, value: c_int, timeout: c_int) c_int

Functionumtx_wakeup[src]

pub extern "c" fn umtx_wakeup(ptr: *const volatile c_int, count: c_int) c_int

Parameters

ptr: *const volatile c_int
count: c_int

Source Code

Source code
pub extern "c" fn umtx_wakeup(ptr: *const volatile c_int, count: c_int) c_int

Source Code

Source code
const std = @import("std");
const builtin = @import("builtin");
const c = @This();
const maxInt = std.math.maxInt;
const assert = std.debug.assert;
const page_size = std.heap.page_size_min;
const native_abi = builtin.abi;
const native_arch = builtin.cpu.arch;
const native_os = builtin.os.tag;
const linux = std.os.linux;
const emscripten = std.os.emscripten;
const wasi = std.os.wasi;
const windows = std.os.windows;
const ws2_32 = std.os.windows.ws2_32;
const darwin = @import("c/darwin.zig");
const freebsd = @import("c/freebsd.zig");
const solaris = @import("c/solaris.zig");
const netbsd = @import("c/netbsd.zig");
const dragonfly = @import("c/dragonfly.zig");
const haiku = @import("c/haiku.zig");
const openbsd = @import("c/openbsd.zig");

// These constants are shared among all operating systems even when not linking
// libc.

pub const iovec = std.posix.iovec;
pub const iovec_const = std.posix.iovec_const;
pub const LOCK = std.posix.LOCK;
pub const winsize = std.posix.winsize;

/// The value of the link editor defined symbol _MH_EXECUTE_SYM is the address
/// of the mach header in a Mach-O executable file type.  It does not appear in
/// any file type other than a MH_EXECUTE file type.  The type of the symbol is
/// absolute as the header is not part of any section.
/// This symbol is populated when linking the system's libc, which is guaranteed
/// on this operating system. However when building object files or libraries,
/// the system libc won't be linked until the final executable. So we
/// export a weak symbol here, to be overridden by the real one.
pub extern var _mh_execute_header: mach_hdr;
var dummy_execute_header: mach_hdr = undefined;
comptime {
    if (native_os.isDarwin()) {
        @export(&dummy_execute_header, .{ .name = "_mh_execute_header", .linkage = .weak });
    }
}

/// * If not linking libc, returns `false`.
/// * If linking musl libc, returns `true`.
/// * If linking GNU libc (glibc), returns `true` if the target version is greater than or equal to
///   `version`.
/// * If linking Android libc (bionic), returns `true` if the target API level is greater than or
///   equal to `version.major`, ignoring other components.
/// * If linking a libc other than these, returns `false`.
pub inline fn versionCheck(comptime version: std.SemanticVersion) bool {
    return comptime blk: {
        if (!builtin.link_libc) break :blk false;
        if (native_abi.isMusl()) break :blk true;
        if (builtin.target.isGnuLibC()) {
            const ver = builtin.os.versionRange().gnuLibCVersion().?;
            break :blk switch (ver.order(version)) {
                .gt, .eq => true,
                .lt => false,
            };
        } else if (builtin.abi.isAndroid()) {
            break :blk builtin.os.version_range.linux.android >= version.major;
        } else {
            break :blk false;
        }
    };
}

pub const ino_t = switch (native_os) {
    .linux => linux.ino_t,
    .emscripten => emscripten.ino_t,
    .wasi => wasi.inode_t,
    .windows => windows.LARGE_INTEGER,
    .haiku => i64,
    else => u64,
};

pub const off_t = switch (native_os) {
    .linux => linux.off_t,
    .emscripten => emscripten.off_t,
    else => i64,
};

pub const timespec = switch (native_os) {
    .linux => linux.timespec,
    .emscripten => emscripten.timespec,
    .wasi => extern struct {
        sec: time_t,
        nsec: isize,

        pub fn fromTimestamp(tm: wasi.timestamp_t) timespec {
            const sec: wasi.timestamp_t = tm / 1_000_000_000;
            const nsec = tm - sec * 1_000_000_000;
            return .{
                .sec = @as(time_t, @intCast(sec)),
                .nsec = @as(isize, @intCast(nsec)),
            };
        }

        pub fn toTimestamp(ts: timespec) wasi.timestamp_t {
            return @as(wasi.timestamp_t, @intCast(ts.sec * 1_000_000_000)) +
                @as(wasi.timestamp_t, @intCast(ts.nsec));
        }
    },
    .windows => extern struct {
        sec: time_t,
        nsec: c_long,
    },
    .dragonfly, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        sec: isize,
        nsec: isize,
    },
    .netbsd, .solaris, .illumos => extern struct {
        sec: i64,
        nsec: isize,
    },
    .openbsd, .haiku => extern struct {
        sec: time_t,
        nsec: isize,
    },
    else => void,
};

pub const dev_t = switch (native_os) {
    .linux => linux.dev_t,
    .emscripten => emscripten.dev_t,
    .wasi => wasi.device_t,
    .openbsd, .haiku, .solaris, .illumos, .macos, .ios, .tvos, .watchos, .visionos => i32,
    .netbsd, .freebsd => u64,
    else => void,
};

pub const mode_t = switch (native_os) {
    .linux => linux.mode_t,
    .emscripten => emscripten.mode_t,
    .openbsd, .haiku, .netbsd, .solaris, .illumos, .wasi, .windows => u32,
    .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .dragonfly => u16,
    else => u0,
};

pub const nlink_t = switch (native_os) {
    .linux => linux.nlink_t,
    .emscripten => emscripten.nlink_t,
    .wasi => c_ulonglong,
    .freebsd => u64,
    .openbsd, .netbsd, .solaris, .illumos => u32,
    .haiku => i32,
    else => void,
};

pub const uid_t = switch (native_os) {
    .linux => linux.uid_t,
    .emscripten => emscripten.uid_t,
    else => u32,
};

pub const gid_t = switch (native_os) {
    .linux => linux.gid_t,
    .emscripten => emscripten.gid_t,
    else => u32,
};

pub const blksize_t = switch (native_os) {
    .linux => linux.blksize_t,
    .emscripten => emscripten.blksize_t,
    .wasi => c_long,
    else => i32,
};

pub const passwd = switch (native_os) {
    .linux => extern struct {
        name: ?[*:0]const u8, // username
        passwd: ?[*:0]const u8, // user password
        uid: uid_t, // user ID
        gid: gid_t, // group ID
        gecos: ?[*:0]const u8, // user information
        dir: ?[*:0]const u8, // home directory
        shell: ?[*:0]const u8, // shell program
    },
    .netbsd, .openbsd, .macos => extern struct {
        name: ?[*:0]const u8, // user name
        passwd: ?[*:0]const u8, // encrypted password
        uid: uid_t, // user uid
        gid: gid_t, // user gid
        change: time_t, // password change time
        class: ?[*:0]const u8, // user access class
        gecos: ?[*:0]const u8, // Honeywell login info
        dir: ?[*:0]const u8, // home directory
        shell: ?[*:0]const u8, // default shell
        expire: time_t, // account expiration
    },
    else => void,
};

pub const blkcnt_t = switch (native_os) {
    .linux => linux.blkcnt_t,
    .emscripten => emscripten.blkcnt_t,
    .wasi => c_longlong,
    else => i64,
};

pub const fd_t = switch (native_os) {
    .linux => linux.fd_t,
    .wasi => wasi.fd_t,
    .windows => windows.HANDLE,
    else => i32,
};

pub const ARCH = switch (native_os) {
    .linux => linux.ARCH,
    else => void,
};

// For use with posix.timerfd_create()
// Actually, the parameter for the timerfd_create() function is an integer,
// which means that the developer has to figure out which value is appropriate.
// To make this easier and, above all, safer, because an incorrect value leads
// to a panic, an enum is introduced which only allows the values
// that actually work.
pub const TIMERFD_CLOCK = timerfd_clockid_t;
pub const timerfd_clockid_t = switch (native_os) {
    .freebsd => enum(u32) {
        REALTIME = 0,
        MONOTONIC = 4,
        _,
    },
    .linux => linux.timerfd_clockid_t,
    else => clockid_t,
};

pub const CLOCK = clockid_t;
pub const clockid_t = switch (native_os) {
    .linux, .emscripten => linux.clockid_t,
    .wasi => wasi.clockid_t,
    .macos, .ios, .tvos, .watchos, .visionos => enum(u32) {
        REALTIME = 0,
        MONOTONIC = 6,
        MONOTONIC_RAW = 4,
        MONOTONIC_RAW_APPROX = 5,
        UPTIME_RAW = 8,
        UPTIME_RAW_APPROX = 9,
        PROCESS_CPUTIME_ID = 12,
        THREAD_CPUTIME_ID = 16,
        _,
    },
    .haiku => enum(i32) {
        /// system-wide monotonic clock (aka system time)
        MONOTONIC = 0,
        /// system-wide real time clock
        REALTIME = -1,
        /// clock measuring the used CPU time of the current process
        PROCESS_CPUTIME_ID = -2,
        /// clock measuring the used CPU time of the current thread
        THREAD_CPUTIME_ID = -3,
    },
    .freebsd => enum(u32) {
        REALTIME = 0,
        VIRTUAL = 1,
        PROF = 2,
        MONOTONIC = 4,
        UPTIME = 5,
        UPTIME_PRECISE = 7,
        UPTIME_FAST = 8,
        REALTIME_PRECISE = 9,
        REALTIME_FAST = 10,
        MONOTONIC_PRECISE = 11,
        MONOTONIC_FAST = 12,
        SECOND = 13,
        THREAD_CPUTIME_ID = 14,
        PROCESS_CPUTIME_ID = 15,
    },
    .solaris, .illumos => enum(u32) {
        VIRTUAL = 1,
        THREAD_CPUTIME_ID = 2,
        REALTIME = 3,
        MONOTONIC = 4,
        PROCESS_CPUTIME_ID = 5,
    },
    .netbsd => enum(u32) {
        REALTIME = 0,
        VIRTUAL = 1,
        PROF = 2,
        MONOTONIC = 3,
        THREAD_CPUTIME_ID = 0x20000000,
        PROCESS_CPUTIME_ID = 0x40000000,
    },
    .dragonfly => enum(u32) {
        REALTIME = 0,
        VIRTUAL = 1,
        PROF = 2,
        MONOTONIC = 4,
        UPTIME = 5,
        UPTIME_PRECISE = 7,
        UPTIME_FAST = 8,
        REALTIME_PRECISE = 9,
        REALTIME_FAST = 10,
        MONOTONIC_PRECISE = 11,
        MONOTONIC_FAST = 12,
        SECOND = 13,
        THREAD_CPUTIME_ID = 14,
        PROCESS_CPUTIME_ID = 15,
    },
    .openbsd => enum(u32) {
        REALTIME = 0,
        PROCESS_CPUTIME_ID = 2,
        MONOTONIC = 3,
        THREAD_CPUTIME_ID = 4,
    },
    else => void,
};
pub const CPU_COUNT = switch (native_os) {
    .linux => linux.CPU_COUNT,
    .emscripten => emscripten.CPU_COUNT,
    else => void,
};
pub const E = switch (native_os) {
    .linux => linux.E,
    .emscripten => emscripten.E,
    .wasi => wasi.errno_t,
    .windows => enum(u16) {
        /// No error occurred.
        SUCCESS = 0,
        PERM = 1,
        NOENT = 2,
        SRCH = 3,
        INTR = 4,
        IO = 5,
        NXIO = 6,
        @"2BIG" = 7,
        NOEXEC = 8,
        BADF = 9,
        CHILD = 10,
        AGAIN = 11,
        NOMEM = 12,
        ACCES = 13,
        FAULT = 14,
        BUSY = 16,
        EXIST = 17,
        XDEV = 18,
        NODEV = 19,
        NOTDIR = 20,
        ISDIR = 21,
        NFILE = 23,
        MFILE = 24,
        NOTTY = 25,
        FBIG = 27,
        NOSPC = 28,
        SPIPE = 29,
        ROFS = 30,
        MLINK = 31,
        PIPE = 32,
        DOM = 33,
        /// Also means `DEADLOCK`.
        DEADLK = 36,
        NAMETOOLONG = 38,
        NOLCK = 39,
        NOSYS = 40,
        NOTEMPTY = 41,

        INVAL = 22,
        RANGE = 34,
        ILSEQ = 42,

        // POSIX Supplement
        ADDRINUSE = 100,
        ADDRNOTAVAIL = 101,
        AFNOSUPPORT = 102,
        ALREADY = 103,
        BADMSG = 104,
        CANCELED = 105,
        CONNABORTED = 106,
        CONNREFUSED = 107,
        CONNRESET = 108,
        DESTADDRREQ = 109,
        HOSTUNREACH = 110,
        IDRM = 111,
        INPROGRESS = 112,
        ISCONN = 113,
        LOOP = 114,
        MSGSIZE = 115,
        NETDOWN = 116,
        NETRESET = 117,
        NETUNREACH = 118,
        NOBUFS = 119,
        NODATA = 120,
        NOLINK = 121,
        NOMSG = 122,
        NOPROTOOPT = 123,
        NOSR = 124,
        NOSTR = 125,
        NOTCONN = 126,
        NOTRECOVERABLE = 127,
        NOTSOCK = 128,
        NOTSUP = 129,
        OPNOTSUPP = 130,
        OTHER = 131,
        OVERFLOW = 132,
        OWNERDEAD = 133,
        PROTO = 134,
        PROTONOSUPPORT = 135,
        PROTOTYPE = 136,
        TIME = 137,
        TIMEDOUT = 138,
        TXTBSY = 139,
        WOULDBLOCK = 140,
        DQUOT = 10069,
        _,
    },
    .macos, .ios, .tvos, .watchos, .visionos => darwin.E,
    .freebsd => freebsd.E,
    .solaris, .illumos => enum(u16) {
        /// No error occurred.
        SUCCESS = 0,
        /// Not super-user
        PERM = 1,
        /// No such file or directory
        NOENT = 2,
        /// No such process
        SRCH = 3,
        /// interrupted system call
        INTR = 4,
        /// I/O error
        IO = 5,
        /// No such device or address
        NXIO = 6,
        /// Arg list too long
        @"2BIG" = 7,
        /// Exec format error
        NOEXEC = 8,
        /// Bad file number
        BADF = 9,
        /// No children
        CHILD = 10,
        /// Resource temporarily unavailable.
        /// also: WOULDBLOCK: Operation would block.
        AGAIN = 11,
        /// Not enough core
        NOMEM = 12,
        /// Permission denied
        ACCES = 13,
        /// Bad address
        FAULT = 14,
        /// Block device required
        NOTBLK = 15,
        /// Mount device busy
        BUSY = 16,
        /// File exists
        EXIST = 17,
        /// Cross-device link
        XDEV = 18,
        /// No such device
        NODEV = 19,
        /// Not a directory
        NOTDIR = 20,
        /// Is a directory
        ISDIR = 21,
        /// Invalid argument
        INVAL = 22,
        /// File table overflow
        NFILE = 23,
        /// Too many open files
        MFILE = 24,
        /// Inappropriate ioctl for device
        NOTTY = 25,
        /// Text file busy
        TXTBSY = 26,
        /// File too large
        FBIG = 27,
        /// No space left on device
        NOSPC = 28,
        /// Illegal seek
        SPIPE = 29,
        /// Read only file system
        ROFS = 30,
        /// Too many links
        MLINK = 31,
        /// Broken pipe
        PIPE = 32,
        /// Math arg out of domain of func
        DOM = 33,
        /// Math result not representable
        RANGE = 34,
        /// No message of desired type
        NOMSG = 35,
        /// Identifier removed
        IDRM = 36,
        /// Channel number out of range
        CHRNG = 37,
        /// Level 2 not synchronized
        L2NSYNC = 38,
        /// Level 3 halted
        L3HLT = 39,
        /// Level 3 reset
        L3RST = 40,
        /// Link number out of range
        LNRNG = 41,
        /// Protocol driver not attached
        UNATCH = 42,
        /// No CSI structure available
        NOCSI = 43,
        /// Level 2 halted
        L2HLT = 44,
        /// Deadlock condition.
        DEADLK = 45,
        /// No record locks available.
        NOLCK = 46,
        /// Operation canceled
        CANCELED = 47,
        /// Operation not supported
        NOTSUP = 48,

        // Filesystem Quotas
        /// Disc quota exceeded
        DQUOT = 49,

        // Convergent Error Returns
        /// invalid exchange
        BADE = 50,
        /// invalid request descriptor
        BADR = 51,
        /// exchange full
        XFULL = 52,
        /// no anode
        NOANO = 53,
        /// invalid request code
        BADRQC = 54,
        /// invalid slot
        BADSLT = 55,
        /// file locking deadlock error
        DEADLOCK = 56,
        /// bad font file fmt
        BFONT = 57,

        // Interprocess Robust Locks
        /// process died with the lock
        OWNERDEAD = 58,
        /// lock is not recoverable
        NOTRECOVERABLE = 59,
        /// locked lock was unmapped
        LOCKUNMAPPED = 72,
        /// Facility is not active
        NOTACTIVE = 73,
        /// multihop attempted
        MULTIHOP = 74,
        /// trying to read unreadable message
        BADMSG = 77,
        /// path name is too long
        NAMETOOLONG = 78,
        /// value too large to be stored in data type
        OVERFLOW = 79,
        /// given log. name not unique
        NOTUNIQ = 80,
        /// f.d. invalid for this operation
        BADFD = 81,
        /// Remote address changed
        REMCHG = 82,

        // Stream Problems
        /// Device not a stream
        NOSTR = 60,
        /// no data (for no delay io)
        NODATA = 61,
        /// timer expired
        TIME = 62,
        /// out of streams resources
        NOSR = 63,
        /// Machine is not on the network
        NONET = 64,
        /// Package not installed
        NOPKG = 65,
        /// The object is remote
        REMOTE = 66,
        /// the link has been severed
        NOLINK = 67,
        /// advertise error
        ADV = 68,
        /// srmount error
        SRMNT = 69,
        /// Communication error on send
        COMM = 70,
        /// Protocol error
        PROTO = 71,

        // Shared Library Problems
        /// Can't access a needed shared lib.
        LIBACC = 83,
        /// Accessing a corrupted shared lib.
        LIBBAD = 84,
        /// .lib section in a.out corrupted.
        LIBSCN = 85,
        /// Attempting to link in too many libs.
        LIBMAX = 86,
        /// Attempting to exec a shared library.
        LIBEXEC = 87,
        /// Illegal byte sequence.
        ILSEQ = 88,
        /// Unsupported file system operation
        NOSYS = 89,
        /// Symbolic link loop
        LOOP = 90,
        /// Restartable system call
        RESTART = 91,
        /// if pipe/FIFO, don't sleep in stream head
        STRPIPE = 92,
        /// directory not empty
        NOTEMPTY = 93,
        /// Too many users (for UFS)
        USERS = 94,

        // BSD Networking Software
        // Argument Errors
        /// Socket operation on non-socket
        NOTSOCK = 95,
        /// Destination address required
        DESTADDRREQ = 96,
        /// Message too long
        MSGSIZE = 97,
        /// Protocol wrong type for socket
        PROTOTYPE = 98,
        /// Protocol not available
        NOPROTOOPT = 99,
        /// Protocol not supported
        PROTONOSUPPORT = 120,
        /// Socket type not supported
        SOCKTNOSUPPORT = 121,
        /// Operation not supported on socket
        OPNOTSUPP = 122,
        /// Protocol family not supported
        PFNOSUPPORT = 123,
        /// Address family not supported by
        AFNOSUPPORT = 124,
        /// Address already in use
        ADDRINUSE = 125,
        /// Can't assign requested address
        ADDRNOTAVAIL = 126,

        // Operational Errors
        /// Network is down
        NETDOWN = 127,
        /// Network is unreachable
        NETUNREACH = 128,
        /// Network dropped connection because
        NETRESET = 129,
        /// Software caused connection abort
        CONNABORTED = 130,
        /// Connection reset by peer
        CONNRESET = 131,
        /// No buffer space available
        NOBUFS = 132,
        /// Socket is already connected
        ISCONN = 133,
        /// Socket is not connected
        NOTCONN = 134,
        /// Can't send after socket shutdown
        SHUTDOWN = 143,
        /// Too many references: can't splice
        TOOMANYREFS = 144,
        /// Connection timed out
        TIMEDOUT = 145,
        /// Connection refused
        CONNREFUSED = 146,
        /// Host is down
        HOSTDOWN = 147,
        /// No route to host
        HOSTUNREACH = 148,
        /// operation already in progress
        ALREADY = 149,
        /// operation now in progress
        INPROGRESS = 150,

        // SUN Network File System
        /// Stale NFS file handle
        STALE = 151,

        _,
    },
    .netbsd => netbsd.E,
    .dragonfly => dragonfly.E,
    .haiku => haiku.E,
    .openbsd => openbsd.E,
    else => void,
};
pub const Elf_Symndx = switch (native_os) {
    .linux => linux.Elf_Symndx,
    else => void,
};
/// Command flags for fcntl(2).
pub const F = switch (native_os) {
    .linux => linux.F,
    .emscripten => emscripten.F,
    .wasi => struct {
        // Match `F_*` constants from lib/libc/include/wasm-wasi-musl/__header_fcntl.h
        pub const GETFD = 1;
        pub const SETFD = 2;
        pub const GETFL = 3;
        pub const SETFL = 4;
    },
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        /// duplicate file descriptor
        pub const DUPFD = 0;
        /// get file descriptor flags
        pub const GETFD = 1;
        /// set file descriptor flags
        pub const SETFD = 2;
        /// get file status flags
        pub const GETFL = 3;
        /// set file status flags
        pub const SETFL = 4;
        /// get SIGIO/SIGURG proc/pgrp
        pub const GETOWN = 5;
        /// set SIGIO/SIGURG proc/pgrp
        pub const SETOWN = 6;
        /// get record locking information
        pub const GETLK = 7;
        /// set record locking information
        pub const SETLK = 8;
        /// F.SETLK; wait if blocked
        pub const SETLKW = 9;
        /// F.SETLK; wait if blocked, return on timeout
        pub const SETLKWTIMEOUT = 10;
        pub const FLUSH_DATA = 40;
        /// Used for regression test
        pub const CHKCLEAN = 41;
        /// Preallocate storage
        pub const PREALLOCATE = 42;
        /// Truncate a file without zeroing space
        pub const SETSIZE = 43;
        /// Issue an advisory read async with no copy to user
        pub const RDADVISE = 44;
        /// turn read ahead off/on for this fd
        pub const RDAHEAD = 45;
        /// turn data caching off/on for this fd
        pub const NOCACHE = 48;
        /// file offset to device offset
        pub const LOG2PHYS = 49;
        /// return the full path of the fd
        pub const GETPATH = 50;
        /// fsync + ask the drive to flush to the media
        pub const FULLFSYNC = 51;
        /// find which component (if any) is a package
        pub const PATHPKG_CHECK = 52;
        /// "freeze" all fs operations
        pub const FREEZE_FS = 53;
        /// "thaw" all fs operations
        pub const THAW_FS = 54;
        /// turn data caching off/on (globally) for this file
        pub const GLOBAL_NOCACHE = 55;
        /// add detached signatures
        pub const ADDSIGS = 59;
        /// add signature from same file (used by dyld for shared libs)
        pub const ADDFILESIGS = 61;
        /// used in conjunction with F.NOCACHE to indicate that DIRECT, synchronous writes
        /// should not be used (i.e. its ok to temporarily create cached pages)
        pub const NODIRECT = 62;
        /// Get the protection class of a file from the EA, returns int
        pub const GETPROTECTIONCLASS = 63;
        /// Set the protection class of a file for the EA, requires int
        pub const SETPROTECTIONCLASS = 64;
        /// file offset to device offset, extended
        pub const LOG2PHYS_EXT = 65;
        /// get record locking information, per-process
        pub const GETLKPID = 66;
        /// Mark the file as being the backing store for another filesystem
        pub const SETBACKINGSTORE = 70;
        /// return the full path of the FD, but error in specific mtmd circumstances
        pub const GETPATH_MTMINFO = 71;
        /// Returns the code directory, with associated hashes, to the caller
        pub const GETCODEDIR = 72;
        /// No SIGPIPE generated on EPIPE
        pub const SETNOSIGPIPE = 73;
        /// Status of SIGPIPE for this fd
        pub const GETNOSIGPIPE = 74;
        /// For some cases, we need to rewrap the key for AKS/MKB
        pub const TRANSCODEKEY = 75;
        /// file being written to a by single writer... if throttling enabled, writes
        /// may be broken into smaller chunks with throttling in between
        pub const SINGLE_WRITER = 76;
        /// Get the protection version number for this filesystem
        pub const GETPROTECTIONLEVEL = 77;
        /// Add detached code signatures (used by dyld for shared libs)
        pub const FINDSIGS = 78;
        /// Add signature from same file, only if it is signed by Apple (used by dyld for simulator)
        pub const ADDFILESIGS_FOR_DYLD_SIM = 83;
        /// fsync + issue barrier to drive
        pub const BARRIERFSYNC = 85;
        /// Add signature from same file, return end offset in structure on success
        pub const ADDFILESIGS_RETURN = 97;
        /// Check if Library Validation allows this Mach-O file to be mapped into the calling process
        pub const CHECK_LV = 98;
        /// Deallocate a range of the file
        pub const PUNCHHOLE = 99;
        /// Trim an active file
        pub const TRIM_ACTIVE_FILE = 100;
        /// mark the dup with FD_CLOEXEC
        pub const DUPFD_CLOEXEC = 67;
        /// shared or read lock
        pub const RDLCK = 1;
        /// unlock
        pub const UNLCK = 2;
        /// exclusive or write lock
        pub const WRLCK = 3;
    },
    .freebsd => struct {
        /// Duplicate file descriptor.
        pub const DUPFD = 0;
        /// Get file descriptor flags.
        pub const GETFD = 1;
        /// Set file descriptor flags.
        pub const SETFD = 2;
        /// Get file status flags.
        pub const GETFL = 3;
        /// Set file status flags.
        pub const SETFL = 4;

        /// Get SIGIO/SIGURG proc/pgrrp.
        pub const GETOWN = 5;
        /// Set SIGIO/SIGURG proc/pgrrp.
        pub const SETOWN = 6;

        /// Get record locking information.
        pub const GETLK = 11;
        /// Set record locking information.
        pub const SETLK = 12;
        /// Set record locking information and wait if blocked.
        pub const SETLKW = 13;

        /// Debugging support for remote locks.
        pub const SETLK_REMOTE = 14;
        /// Read ahead.
        pub const READAHEAD = 15;

        /// DUPFD with FD_CLOEXEC set.
        pub const DUPFD_CLOEXEC = 17;
        /// DUP2FD with FD_CLOEXEC set.
        pub const DUP2FD_CLOEXEC = 18;

        pub const ADD_SEALS = 19;
        pub const GET_SEALS = 20;
        /// Return `kinfo_file` for a file descriptor.
        pub const KINFO = 22;

        // Seals (ADD_SEALS, GET_SEALS)
        /// Prevent adding sealings.
        pub const SEAL_SEAL = 0x0001;
        /// May not shrink
        pub const SEAL_SHRINK = 0x0002;
        /// May not grow.
        pub const SEAL_GROW = 0x0004;
        /// May not write.
        pub const SEAL_WRITE = 0x0008;

        // Record locking flags (GETLK, SETLK, SETLKW).
        /// Shared or read lock.
        pub const RDLCK = 1;
        /// Unlock.
        pub const UNLCK = 2;
        /// Exclusive or write lock.
        pub const WRLCK = 3;
        /// Purge locks for a given system ID.
        pub const UNLCKSYS = 4;
        /// Cancel an async lock request.
        pub const CANCEL = 5;

        pub const SETOWN_EX = 15;
        pub const GETOWN_EX = 16;

        pub const GETOWNER_UIDS = 17;
    },
    .solaris, .illumos => struct {
        /// Unlock a previously locked region
        pub const ULOCK = 0;
        /// Lock a region for exclusive use
        pub const LOCK = 1;
        /// Test and lock a region for exclusive use
        pub const TLOCK = 2;
        /// Test a region for other processes locks
        pub const TEST = 3;

        /// Duplicate fildes
        pub const DUPFD = 0;
        /// Get fildes flags
        pub const GETFD = 1;
        /// Set fildes flags
        pub const SETFD = 2;
        /// Get file flags
        pub const GETFL = 3;
        /// Get file flags including open-only flags
        pub const GETXFL = 45;
        /// Set file flags
        pub const SETFL = 4;

        /// Unused
        pub const CHKFL = 8;
        /// Duplicate fildes at third arg
        pub const DUP2FD = 9;
        /// Like DUP2FD with O_CLOEXEC set EINVAL is fildes matches arg1
        pub const DUP2FD_CLOEXEC = 36;
        /// Like DUPFD with O_CLOEXEC set
        pub const DUPFD_CLOEXEC = 37;

        /// Is the file desc. a stream ?
        pub const ISSTREAM = 13;
        /// Turn on private access to file
        pub const PRIV = 15;
        /// Turn off private access to file
        pub const NPRIV = 16;
        /// UFS quota call
        pub const QUOTACTL = 17;
        /// Get number of BLKSIZE blocks allocated
        pub const BLOCKS = 18;
        /// Get optimal I/O block size
        pub const BLKSIZE = 19;
        /// Get owner (socket emulation)
        pub const GETOWN = 23;
        /// Set owner (socket emulation)
        pub const SETOWN = 24;
        /// Object reuse revoke access to file desc.
        pub const REVOKE = 25;
        /// Does vp have NFS locks private to lock manager
        pub const HASREMOTELOCKS = 26;

        /// Set file lock
        pub const SETLK = 6;
        /// Set file lock and wait
        pub const SETLKW = 7;
        /// Allocate file space
        pub const ALLOCSP = 10;
        /// Free file space
        pub const FREESP = 11;
        /// Get file lock
        pub const GETLK = 14;
        /// Get file lock owned by file
        pub const OFD_GETLK = 47;
        /// Set file lock owned by file
        pub const OFD_SETLK = 48;
        /// Set file lock owned by file and wait
        pub const OFD_SETLKW = 49;
        /// Set a file share reservation
        pub const SHARE = 40;
        /// Remove a file share reservation
        pub const UNSHARE = 41;
        /// Create Poison FD
        pub const BADFD = 46;

        /// Read lock
        pub const RDLCK = 1;
        /// Write lock
        pub const WRLCK = 2;
        /// Remove lock(s)
        pub const UNLCK = 3;
        /// remove remote locks for a given system
        pub const UNLKSYS = 4;

        // f_access values
        /// Read-only share access
        pub const RDACC = 0x1;
        /// Write-only share access
        pub const WRACC = 0x2;
        /// Read-Write share access
        pub const RWACC = 0x3;

        // f_deny values
        /// Don't deny others access
        pub const NODNY = 0x0;
        /// Deny others read share access
        pub const RDDNY = 0x1;
        /// Deny others write share access
        pub const WRDNY = 0x2;
        /// Deny others read or write share access
        pub const RWDNY = 0x3;
        /// private flag: Deny delete share access
        pub const RMDNY = 0x4;
    },
    .netbsd => struct {
        pub const DUPFD = 0;
        pub const GETFD = 1;
        pub const SETFD = 2;
        pub const GETFL = 3;
        pub const SETFL = 4;
        pub const GETOWN = 5;
        pub const SETOWN = 6;
        pub const GETLK = 7;
        pub const SETLK = 8;
        pub const SETLKW = 9;
        pub const CLOSEM = 10;
        pub const MAXFD = 11;
        pub const DUPFD_CLOEXEC = 12;
        pub const GETNOSIGPIPE = 13;
        pub const SETNOSIGPIPE = 14;
        pub const GETPATH = 15;

        pub const RDLCK = 1;
        pub const WRLCK = 3;
        pub const UNLCK = 2;
    },
    .dragonfly => struct {
        pub const ULOCK = 0;
        pub const LOCK = 1;
        pub const TLOCK = 2;
        pub const TEST = 3;

        pub const DUPFD = 0;
        pub const GETFD = 1;
        pub const RDLCK = 1;
        pub const SETFD = 2;
        pub const UNLCK = 2;
        pub const WRLCK = 3;
        pub const GETFL = 3;
        pub const SETFL = 4;
        pub const GETOWN = 5;
        pub const SETOWN = 6;
        pub const GETLK = 7;
        pub const SETLK = 8;
        pub const SETLKW = 9;
        pub const DUP2FD = 10;
        pub const DUPFD_CLOEXEC = 17;
        pub const DUP2FD_CLOEXEC = 18;
        pub const GETPATH = 19;
    },
    .haiku => struct {
        pub const DUPFD = 0x0001;
        pub const GETFD = 0x0002;
        pub const SETFD = 0x0004;
        pub const GETFL = 0x0008;
        pub const SETFL = 0x0010;

        pub const GETLK = 0x0020;
        pub const SETLK = 0x0080;
        pub const SETLKW = 0x0100;
        pub const DUPFD_CLOEXEC = 0x0200;

        pub const RDLCK = 0x0040;
        pub const UNLCK = 0x0200;
        pub const WRLCK = 0x0400;
    },
    .openbsd => struct {
        pub const DUPFD = 0;
        pub const GETFD = 1;
        pub const SETFD = 2;
        pub const GETFL = 3;
        pub const SETFL = 4;

        pub const GETOWN = 5;
        pub const SETOWN = 6;

        pub const GETLK = 7;
        pub const SETLK = 8;
        pub const SETLKW = 9;

        pub const RDLCK = 1;
        pub const UNLCK = 2;
        pub const WRLCK = 3;
    },
    else => void,
};
pub const FD_CLOEXEC = switch (native_os) {
    .linux => linux.FD_CLOEXEC,
    .emscripten => emscripten.FD_CLOEXEC,
    else => 1,
};

/// Test for existence of file.
pub const F_OK = switch (native_os) {
    .linux => linux.F_OK,
    .emscripten => emscripten.F_OK,
    else => 0,
};
/// Test for execute or search permission.
pub const X_OK = switch (native_os) {
    .linux => linux.X_OK,
    .emscripten => emscripten.X_OK,
    else => 1,
};
/// Test for write permission.
pub const W_OK = switch (native_os) {
    .linux => linux.W_OK,
    .emscripten => emscripten.W_OK,
    else => 2,
};
/// Test for read permission.
pub const R_OK = switch (native_os) {
    .linux => linux.R_OK,
    .emscripten => emscripten.R_OK,
    else => 4,
};

pub const Flock = switch (native_os) {
    .linux => linux.Flock,
    .emscripten => emscripten.Flock,
    .openbsd, .dragonfly, .netbsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        start: off_t,
        len: off_t,
        pid: pid_t,
        type: i16,
        whence: i16,
    },
    .freebsd => extern struct {
        /// Starting offset.
        start: off_t,
        /// Number of consecutive bytes to be locked.
        /// A value of 0 means to the end of the file.
        len: off_t,
        /// Lock owner.
        pid: pid_t,
        /// Lock type.
        type: i16,
        /// Type of the start member.
        whence: i16,
        /// Remote system id or zero for local.
        sysid: i32,
    },
    .solaris, .illumos => extern struct {
        type: c_short,
        whence: c_short,
        start: off_t,
        // len == 0 means until end of file.
        len: off_t,
        sysid: c_int,
        pid: pid_t,
        __pad: [4]c_long,
    },
    .haiku => extern struct {
        type: i16,
        whence: i16,
        start: off_t,
        len: off_t,
        pid: pid_t,
    },
    else => void,
};
pub const HOST_NAME_MAX = switch (native_os) {
    .linux => linux.HOST_NAME_MAX,
    .macos, .ios, .tvos, .watchos, .visionos => 72,
    .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd => 255,
    else => {},
};
pub const IOV_MAX = switch (native_os) {
    .linux => linux.IOV_MAX,
    .emscripten => emscripten.IOV_MAX,
    .openbsd, .haiku, .solaris, .illumos, .wasi => 1024,
    .macos, .ios, .tvos, .watchos, .visionos => 16,
    .dragonfly, .netbsd, .freebsd => KERN.IOV_MAX,
    else => {},
};
pub const CTL = switch (native_os) {
    .freebsd => struct {
        pub const KERN = 1;
        pub const DEBUG = 5;
    },
    .netbsd => struct {
        pub const KERN = 1;
        pub const DEBUG = 5;
    },
    .dragonfly => struct {
        pub const UNSPEC = 0;
        pub const KERN = 1;
        pub const VM = 2;
        pub const VFS = 3;
        pub const NET = 4;
        pub const DEBUG = 5;
        pub const HW = 6;
        pub const MACHDEP = 7;
        pub const USER = 8;
        pub const LWKT = 10;
        pub const MAXID = 11;
        pub const MAXNAME = 12;
    },
    .openbsd => struct {
        pub const UNSPEC = 0;
        pub const KERN = 1;
        pub const VM = 2;
        pub const FS = 3;
        pub const NET = 4;
        pub const DEBUG = 5;
        pub const HW = 6;
        pub const MACHDEP = 7;

        pub const DDB = 9;
        pub const VFS = 10;
    },
    else => void,
};
pub const KERN = switch (native_os) {
    .freebsd => struct {
        /// struct: process entries
        pub const PROC = 14;
        /// path to executable
        pub const PROC_PATHNAME = 12;
        /// file descriptors for process
        pub const PROC_FILEDESC = 33;
        pub const IOV_MAX = 35;
    },
    .netbsd => struct {
        /// struct: process argv/env
        pub const PROC_ARGS = 48;
        /// path to executable
        pub const PROC_PATHNAME = 5;
        pub const IOV_MAX = 38;
    },
    .dragonfly => struct {
        pub const PROC_ALL = 0;
        pub const OSTYPE = 1;
        pub const PROC_PID = 1;
        pub const OSRELEASE = 2;
        pub const PROC_PGRP = 2;
        pub const OSREV = 3;
        pub const PROC_SESSION = 3;
        pub const VERSION = 4;
        pub const PROC_TTY = 4;
        pub const MAXVNODES = 5;
        pub const PROC_UID = 5;
        pub const MAXPROC = 6;
        pub const PROC_RUID = 6;
        pub const MAXFILES = 7;
        pub const PROC_ARGS = 7;
        pub const ARGMAX = 8;
        pub const PROC_CWD = 8;
        pub const PROC_PATHNAME = 9;
        pub const SECURELVL = 9;
        pub const PROC_SIGTRAMP = 10;
        pub const HOSTNAME = 10;
        pub const HOSTID = 11;
        pub const CLOCKRATE = 12;
        pub const VNODE = 13;
        pub const PROC = 14;
        pub const FILE = 15;
        pub const PROC_FLAGMASK = 16;
        pub const PROF = 16;
        pub const PROC_FLAG_LWP = 16;
        pub const POSIX1 = 17;
        pub const NGROUPS = 18;
        pub const JOB_CONTROL = 19;
        pub const SAVED_IDS = 20;
        pub const BOOTTIME = 21;
        pub const NISDOMAINNAME = 22;
        pub const UPDATEINTERVAL = 23;
        pub const OSRELDATE = 24;
        pub const NTP_PLL = 25;
        pub const BOOTFILE = 26;
        pub const MAXFILESPERPROC = 27;
        pub const MAXPROCPERUID = 28;
        pub const DUMPDEV = 29;
        pub const IPC = 30;
        pub const DUMMY = 31;
        pub const PS_STRINGS = 32;
        pub const USRSTACK = 33;
        pub const LOGSIGEXIT = 34;
        pub const IOV_MAX = 35;
        pub const MAXPOSIXLOCKSPERUID = 36;
        pub const MAXID = 37;
    },
    .openbsd => struct {
        pub const OSTYPE = 1;
        pub const OSRELEASE = 2;
        pub const OSREV = 3;
        pub const VERSION = 4;
        pub const MAXVNODES = 5;
        pub const MAXPROC = 6;
        pub const MAXFILES = 7;
        pub const ARGMAX = 8;
        pub const SECURELVL = 9;
        pub const HOSTNAME = 10;
        pub const HOSTID = 11;
        pub const CLOCKRATE = 12;

        pub const PROF = 16;
        pub const POSIX1 = 17;
        pub const NGROUPS = 18;
        pub const JOB_CONTROL = 19;
        pub const SAVED_IDS = 20;
        pub const BOOTTIME = 21;
        pub const DOMAINNAME = 22;
        pub const MAXPARTITIONS = 23;
        pub const RAWPARTITION = 24;
        pub const MAXTHREAD = 25;
        pub const NTHREADS = 26;
        pub const OSVERSION = 27;
        pub const SOMAXCONN = 28;
        pub const SOMINCONN = 29;

        pub const NOSUIDCOREDUMP = 32;
        pub const FSYNC = 33;
        pub const SYSVMSG = 34;
        pub const SYSVSEM = 35;
        pub const SYSVSHM = 36;

        pub const MSGBUFSIZE = 38;
        pub const MALLOCSTATS = 39;
        pub const CPTIME = 40;
        pub const NCHSTATS = 41;
        pub const FORKSTAT = 42;
        pub const NSELCOLL = 43;
        pub const TTY = 44;
        pub const CCPU = 45;
        pub const FSCALE = 46;
        pub const NPROCS = 47;
        pub const MSGBUF = 48;
        pub const POOL = 49;
        pub const STACKGAPRANDOM = 50;
        pub const SYSVIPC_INFO = 51;
        pub const ALLOWKMEM = 52;
        pub const WITNESSWATCH = 53;
        pub const SPLASSERT = 54;
        pub const PROC_ARGS = 55;
        pub const NFILES = 56;
        pub const TTYCOUNT = 57;
        pub const NUMVNODES = 58;
        pub const MBSTAT = 59;
        pub const WITNESS = 60;
        pub const SEMINFO = 61;
        pub const SHMINFO = 62;
        pub const INTRCNT = 63;
        pub const WATCHDOG = 64;
        pub const ALLOWDT = 65;
        pub const PROC = 66;
        pub const MAXCLUSTERS = 67;
        pub const EVCOUNT = 68;
        pub const TIMECOUNTER = 69;
        pub const MAXLOCKSPERUID = 70;
        pub const CPTIME2 = 71;
        pub const CACHEPCT = 72;
        pub const FILE = 73;
        pub const WXABORT = 74;
        pub const CONSDEV = 75;
        pub const NETLIVELOCKS = 76;
        pub const POOL_DEBUG = 77;
        pub const PROC_CWD = 78;
        pub const PROC_NOBROADCASTKILL = 79;
        pub const PROC_VMMAP = 80;
        pub const GLOBAL_PTRACE = 81;
        pub const CONSBUFSIZE = 82;
        pub const CONSBUF = 83;
        pub const AUDIO = 84;
        pub const CPUSTATS = 85;
        pub const PFSTATUS = 86;
        pub const TIMEOUT_STATS = 87;
        pub const UTC_OFFSET = 88;
        pub const VIDEO = 89;

        pub const PROC_ALL = 0;
        pub const PROC_PID = 1;
        pub const PROC_PGRP = 2;
        pub const PROC_SESSION = 3;
        pub const PROC_TTY = 4;
        pub const PROC_UID = 5;
        pub const PROC_RUID = 6;
        pub const PROC_KTHREAD = 7;
        pub const PROC_SHOW_THREADS = 0x40000000;

        pub const PROC_ARGV = 1;
        pub const PROC_NARGV = 2;
        pub const PROC_ENV = 3;
        pub const PROC_NENV = 4;
    },
    else => void,
};
pub const MADV = switch (native_os) {
    .linux => linux.MADV,
    .emscripten => emscripten.MADV,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const NORMAL = 0;
        pub const RANDOM = 1;
        pub const SEQUENTIAL = 2;
        pub const WILLNEED = 3;
        pub const DONTNEED = 4;
        pub const FREE = 5;
        pub const ZERO_WIRED_PAGES = 6;
        pub const FREE_REUSABLE = 7;
        pub const FREE_REUSE = 8;
        pub const CAN_REUSE = 9;
        pub const PAGEOUT = 10;
        pub const ZERO = 11;
    },
    .freebsd => struct {
        pub const NORMAL = 0;
        pub const RANDOM = 1;
        pub const SEQUENTIAL = 2;
        pub const WILLNEED = 3;
        pub const DONTNEED = 4;
        pub const FREE = 5;
        pub const NOSYNC = 6;
        pub const AUTOSYNC = 7;
        pub const NOCORE = 8;
        pub const CORE = 9;
        pub const PROTECT = 10;
    },
    .solaris, .illumos => struct {
        /// no further special treatment
        pub const NORMAL = 0;
        /// expect random page references
        pub const RANDOM = 1;
        /// expect sequential page references
        pub const SEQUENTIAL = 2;
        /// will need these pages
        pub const WILLNEED = 3;
        /// don't need these pages
        pub const DONTNEED = 4;
        /// contents can be freed
        pub const FREE = 5;
        /// default access
        pub const ACCESS_DEFAULT = 6;
        /// next LWP to access heavily
        pub const ACCESS_LWP = 7;
        /// many processes to access heavily
        pub const ACCESS_MANY = 8;
        /// contents will be purged
        pub const PURGE = 9;
    },
    .dragonfly => struct {
        pub const SEQUENTIAL = 2;
        pub const CONTROL_END = SETMAP;
        pub const DONTNEED = 4;
        pub const RANDOM = 1;
        pub const WILLNEED = 3;
        pub const NORMAL = 0;
        pub const CONTROL_START = INVAL;
        pub const FREE = 5;
        pub const NOSYNC = 6;
        pub const AUTOSYNC = 7;
        pub const NOCORE = 8;
        pub const CORE = 9;
        pub const INVAL = 10;
        pub const SETMAP = 11;
    },
    else => void,
};
pub const MSF = switch (native_os) {
    .linux => linux.MSF,
    .emscripten => emscripten.MSF,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const ASYNC = 0x1;
        pub const INVALIDATE = 0x2;
        /// invalidate, leave mapped
        pub const KILLPAGES = 0x4;
        /// deactivate, leave mapped
        pub const DEACTIVATE = 0x8;
        pub const SYNC = 0x10;
    },
    .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd => struct {
        pub const ASYNC = 1;
        pub const INVALIDATE = 2;
        pub const SYNC = 4;
    },
    else => void,
};
pub const MMAP2_UNIT = switch (native_os) {
    .linux => linux.MMAP2_UNIT,
    else => void,
};
pub const NAME_MAX = switch (native_os) {
    .linux => linux.NAME_MAX,
    .emscripten => emscripten.NAME_MAX,
    // Haiku's headers make this 256, to contain room for the terminating null
    // character, but POSIX definition says that NAME_MAX does not include the
    // terminating null.
    .haiku, .openbsd, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => 255,
    else => {},
};
pub const PATH_MAX = switch (native_os) {
    .linux => linux.PATH_MAX,
    .emscripten => emscripten.PATH_MAX,
    .wasi => 4096,
    .windows => 260,
    .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => 1024,
    else => {},
};

pub const POLL = switch (native_os) {
    .linux => linux.POLL,
    .emscripten => emscripten.POLL,
    .wasi => struct {
        pub const RDNORM = 0x1;
        pub const WRNORM = 0x2;
        pub const IN = RDNORM;
        pub const OUT = WRNORM;
        pub const ERR = 0x1000;
        pub const HUP = 0x2000;
        pub const NVAL = 0x4000;
    },
    .windows => ws2_32.POLL,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const IN = 0x001;
        pub const PRI = 0x002;
        pub const OUT = 0x004;
        pub const RDNORM = 0x040;
        pub const WRNORM = OUT;
        pub const RDBAND = 0x080;
        pub const WRBAND = 0x100;

        pub const EXTEND = 0x0200;
        pub const ATTRIB = 0x0400;
        pub const NLINK = 0x0800;
        pub const WRITE = 0x1000;

        pub const ERR = 0x008;
        pub const HUP = 0x010;
        pub const NVAL = 0x020;

        pub const STANDARD = IN | PRI | OUT | RDNORM | RDBAND | WRBAND | ERR | HUP | NVAL;
    },
    .freebsd => struct {
        /// any readable data available.
        pub const IN = 0x0001;
        /// OOB/Urgent readable data.
        pub const PRI = 0x0002;
        /// file descriptor is writeable.
        pub const OUT = 0x0004;
        /// non-OOB/URG data available.
        pub const RDNORM = 0x0040;
        /// no write type differentiation.
        pub const WRNORM = OUT;
        /// OOB/Urgent readable data.
        pub const RDBAND = 0x0080;
        /// OOB/Urgent data can be written.
        pub const WRBAND = 0x0100;
        /// like IN, except ignore EOF.
        pub const INIGNEOF = 0x2000;
        /// some poll error occurred.
        pub const ERR = 0x0008;
        /// file descriptor was "hung up".
        pub const HUP = 0x0010;
        /// requested events "invalid".
        pub const NVAL = 0x0020;

        pub const STANDARD = IN | PRI | OUT | RDNORM | RDBAND | WRBAND | ERR | HUP | NVAL;
    },
    .solaris, .illumos => struct {
        pub const IN = 0x0001;
        pub const PRI = 0x0002;
        pub const OUT = 0x0004;
        pub const RDNORM = 0x0040;
        pub const WRNORM = .OUT;
        pub const RDBAND = 0x0080;
        pub const WRBAND = 0x0100;
        /// Read-side hangup.
        pub const RDHUP = 0x4000;

        /// Non-testable events (may not be specified in events).
        pub const ERR = 0x0008;
        pub const HUP = 0x0010;
        pub const NVAL = 0x0020;

        /// Events to control `/dev/poll` (not specified in revents)
        pub const REMOVE = 0x0800;
        pub const ONESHOT = 0x1000;
        pub const ET = 0x2000;
    },
    .dragonfly, .netbsd => struct {
        /// Testable events (may be specified in events field).
        pub const IN = 0x0001;
        pub const PRI = 0x0002;
        pub const OUT = 0x0004;
        pub const RDNORM = 0x0040;
        pub const WRNORM = OUT;
        pub const RDBAND = 0x0080;
        pub const WRBAND = 0x0100;

        /// Non-testable events (may not be specified in events field).
        pub const ERR = 0x0008;
        pub const HUP = 0x0010;
        pub const NVAL = 0x0020;
    },
    .haiku => struct {
        /// any readable data available
        pub const IN = 0x0001;
        /// file descriptor is writeable
        pub const OUT = 0x0002;
        pub const RDNORM = IN;
        pub const WRNORM = OUT;
        /// priority readable data
        pub const RDBAND = 0x0008;
        /// priority data can be written
        pub const WRBAND = 0x0010;
        /// high priority readable data
        pub const PRI = 0x0020;

        /// errors pending
        pub const ERR = 0x0004;
        /// disconnected
        pub const HUP = 0x0080;
        /// invalid file descriptor
        pub const NVAL = 0x1000;
    },
    .openbsd => struct {
        pub const IN = 0x0001;
        pub const PRI = 0x0002;
        pub const OUT = 0x0004;
        pub const ERR = 0x0008;
        pub const HUP = 0x0010;
        pub const NVAL = 0x0020;
        pub const RDNORM = 0x0040;
        pub const NORM = RDNORM;
        pub const WRNORM = OUT;
        pub const RDBAND = 0x0080;
        pub const WRBAND = 0x0100;
    },
    else => void,
};

/// Basic memory protection flags
pub const PROT = switch (native_os) {
    .linux => linux.PROT,
    .emscripten => emscripten.PROT,
    .openbsd, .haiku, .dragonfly, .netbsd, .solaris, .illumos, .freebsd, .windows => struct {
        /// page can not be accessed
        pub const NONE = 0x0;
        /// page can be read
        pub const READ = 0x1;
        /// page can be written
        pub const WRITE = 0x2;
        /// page can be executed
        pub const EXEC = 0x4;
    },
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        /// [MC2] no permissions
        pub const NONE: vm_prot_t = 0x00;
        /// [MC2] pages can be read
        pub const READ: vm_prot_t = 0x01;
        /// [MC2] pages can be written
        pub const WRITE: vm_prot_t = 0x02;
        /// [MC2] pages can be executed
        pub const EXEC: vm_prot_t = 0x04;
        /// When a caller finds that they cannot obtain write permission on a
        /// mapped entry, the following flag can be used. The entry will be
        /// made "needs copy" effectively copying the object (using COW),
        /// and write permission will be added to the maximum protections for
        /// the associated entry.
        pub const COPY: vm_prot_t = 0x10;
    },
    else => void,
};

pub const REG = switch (native_os) {
    .linux => linux.REG,
    .emscripten => emscripten.REG,
    .freebsd => switch (builtin.cpu.arch) {
        .aarch64 => struct {
            pub const FP = 29;
            pub const SP = 31;
            pub const PC = 32;
        },
        .arm => struct {
            pub const FP = 11;
            pub const SP = 13;
            pub const PC = 15;
        },
        .x86_64 => struct {
            pub const RBP = 12;
            pub const RIP = 21;
            pub const RSP = 24;
        },
        else => struct {},
    },
    .solaris, .illumos => struct {
        pub const R15 = 0;
        pub const R14 = 1;
        pub const R13 = 2;
        pub const R12 = 3;
        pub const R11 = 4;
        pub const R10 = 5;
        pub const R9 = 6;
        pub const R8 = 7;
        pub const RDI = 8;
        pub const RSI = 9;
        pub const RBP = 10;
        pub const RBX = 11;
        pub const RDX = 12;
        pub const RCX = 13;
        pub const RAX = 14;
        pub const RIP = 17;
        pub const RSP = 20;
    },
    .netbsd => switch (builtin.cpu.arch) {
        .aarch64 => struct {
            pub const FP = 29;
            pub const SP = 31;
            pub const PC = 32;
        },
        .arm => struct {
            pub const FP = 11;
            pub const SP = 13;
            pub const PC = 15;
        },
        .x86_64 => struct {
            pub const RDI = 0;
            pub const RSI = 1;
            pub const RDX = 2;
            pub const RCX = 3;
            pub const R8 = 4;
            pub const R9 = 5;
            pub const R10 = 6;
            pub const R11 = 7;
            pub const R12 = 8;
            pub const R13 = 9;
            pub const R14 = 10;
            pub const R15 = 11;
            pub const RBP = 12;
            pub const RBX = 13;
            pub const RAX = 14;
            pub const GS = 15;
            pub const FS = 16;
            pub const ES = 17;
            pub const DS = 18;
            pub const TRAPNO = 19;
            pub const ERR = 20;
            pub const RIP = 21;
            pub const CS = 22;
            pub const RFLAGS = 23;
            pub const RSP = 24;
            pub const SS = 25;
        },
        else => struct {},
    },
    else => struct {},
};
pub const RLIM = switch (native_os) {
    .linux => linux.RLIM,
    .emscripten => emscripten.RLIM,
    .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => struct {
        /// No limit
        pub const INFINITY: rlim_t = (1 << 63) - 1;

        pub const SAVED_MAX = INFINITY;
        pub const SAVED_CUR = INFINITY;
    },
    .solaris, .illumos => struct {
        /// No limit
        pub const INFINITY: rlim_t = (1 << 63) - 3;
        pub const SAVED_MAX: rlim_t = (1 << 63) - 2;
        pub const SAVED_CUR: rlim_t = (1 << 63) - 1;
    },
    else => void,
};
pub const S = switch (native_os) {
    .linux => linux.S,
    .emscripten => emscripten.S,
    .wasi => struct {
        // Match `S_*` constants from lib/libc/include/wasm-wasi-musl/__mode_t.h
        pub const IFBLK = 0x6000;
        pub const IFCHR = 0x2000;
        pub const IFDIR = 0x4000;
        pub const IFIFO = 0x1000;
        pub const IFLNK = 0xa000;
        pub const IFMT = IFBLK | IFCHR | IFDIR | IFIFO | IFLNK | IFREG | IFSOCK;
        pub const IFREG = 0x8000;
        pub const IFSOCK = 0xc000;

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }
    },
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const IFMT = 0o170000;

        pub const IFIFO = 0o010000;
        pub const IFCHR = 0o020000;
        pub const IFDIR = 0o040000;
        pub const IFBLK = 0o060000;
        pub const IFREG = 0o100000;
        pub const IFLNK = 0o120000;
        pub const IFSOCK = 0o140000;
        pub const IFWHT = 0o160000;

        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }

        pub fn IWHT(m: u32) bool {
            return m & IFMT == IFWHT;
        }
    },
    .freebsd => struct {
        pub const IFMT = 0o170000;

        pub const IFIFO = 0o010000;
        pub const IFCHR = 0o020000;
        pub const IFDIR = 0o040000;
        pub const IFBLK = 0o060000;
        pub const IFREG = 0o100000;
        pub const IFLNK = 0o120000;
        pub const IFSOCK = 0o140000;
        pub const IFWHT = 0o160000;

        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }

        pub fn IWHT(m: u32) bool {
            return m & IFMT == IFWHT;
        }
    },
    .solaris, .illumos => struct {
        pub const IFMT = 0o170000;

        pub const IFIFO = 0o010000;
        pub const IFCHR = 0o020000;
        pub const IFDIR = 0o040000;
        pub const IFBLK = 0o060000;
        pub const IFREG = 0o100000;
        pub const IFLNK = 0o120000;
        pub const IFSOCK = 0o140000;
        /// SunOS 2.6 Door
        pub const IFDOOR = 0o150000;
        /// Solaris 10 Event Port
        pub const IFPORT = 0o160000;

        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }

        pub fn ISDOOR(m: u32) bool {
            return m & IFMT == IFDOOR;
        }

        pub fn ISPORT(m: u32) bool {
            return m & IFMT == IFPORT;
        }
    },
    .netbsd => struct {
        pub const IFMT = 0o170000;

        pub const IFIFO = 0o010000;
        pub const IFCHR = 0o020000;
        pub const IFDIR = 0o040000;
        pub const IFBLK = 0o060000;
        pub const IFREG = 0o100000;
        pub const IFLNK = 0o120000;
        pub const IFSOCK = 0o140000;
        pub const IFWHT = 0o160000;

        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }

        pub fn IWHT(m: u32) bool {
            return m & IFMT == IFWHT;
        }
    },
    .dragonfly => struct {
        pub const IREAD = IRUSR;
        pub const IEXEC = IXUSR;
        pub const IWRITE = IWUSR;
        pub const IXOTH = 1;
        pub const IWOTH = 2;
        pub const IROTH = 4;
        pub const IRWXO = 7;
        pub const IXGRP = 8;
        pub const IWGRP = 16;
        pub const IRGRP = 32;
        pub const IRWXG = 56;
        pub const IXUSR = 64;
        pub const IWUSR = 128;
        pub const IRUSR = 256;
        pub const IRWXU = 448;
        pub const ISTXT = 512;
        pub const BLKSIZE = 512;
        pub const ISVTX = 512;
        pub const ISGID = 1024;
        pub const ISUID = 2048;
        pub const IFIFO = 4096;
        pub const IFCHR = 8192;
        pub const IFDIR = 16384;
        pub const IFBLK = 24576;
        pub const IFREG = 32768;
        pub const IFDB = 36864;
        pub const IFLNK = 40960;
        pub const IFSOCK = 49152;
        pub const IFWHT = 57344;
        pub const IFMT = 61440;

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }
    },
    .haiku => struct {
        pub const IFMT = 0o170000;
        pub const IFSOCK = 0o140000;
        pub const IFLNK = 0o120000;
        pub const IFREG = 0o100000;
        pub const IFBLK = 0o060000;
        pub const IFDIR = 0o040000;
        pub const IFCHR = 0o020000;
        pub const IFIFO = 0o010000;
        pub const INDEX_DIR = 0o4000000000;

        pub const IUMSK = 0o7777;
        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }

        pub fn ISINDEX(m: u32) bool {
            return m & INDEX_DIR == INDEX_DIR;
        }
    },
    .openbsd => struct {
        pub const IFMT = 0o170000;

        pub const IFIFO = 0o010000;
        pub const IFCHR = 0o020000;
        pub const IFDIR = 0o040000;
        pub const IFBLK = 0o060000;
        pub const IFREG = 0o100000;
        pub const IFLNK = 0o120000;
        pub const IFSOCK = 0o140000;

        pub const ISUID = 0o4000;
        pub const ISGID = 0o2000;
        pub const ISVTX = 0o1000;
        pub const IRWXU = 0o700;
        pub const IRUSR = 0o400;
        pub const IWUSR = 0o200;
        pub const IXUSR = 0o100;
        pub const IRWXG = 0o070;
        pub const IRGRP = 0o040;
        pub const IWGRP = 0o020;
        pub const IXGRP = 0o010;
        pub const IRWXO = 0o007;
        pub const IROTH = 0o004;
        pub const IWOTH = 0o002;
        pub const IXOTH = 0o001;

        pub fn ISFIFO(m: u32) bool {
            return m & IFMT == IFIFO;
        }

        pub fn ISCHR(m: u32) bool {
            return m & IFMT == IFCHR;
        }

        pub fn ISDIR(m: u32) bool {
            return m & IFMT == IFDIR;
        }

        pub fn ISBLK(m: u32) bool {
            return m & IFMT == IFBLK;
        }

        pub fn ISREG(m: u32) bool {
            return m & IFMT == IFREG;
        }

        pub fn ISLNK(m: u32) bool {
            return m & IFMT == IFLNK;
        }

        pub fn ISSOCK(m: u32) bool {
            return m & IFMT == IFSOCK;
        }
    },
    else => void,
};
pub const SA = switch (native_os) {
    .linux => linux.SA,
    .emscripten => emscripten.SA,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        /// take signal on signal stack
        pub const ONSTACK = 0x0001;
        /// restart system on signal return
        pub const RESTART = 0x0002;
        /// reset to SIG.DFL when taking signal
        pub const RESETHAND = 0x0004;
        /// do not generate SIG.CHLD on child stop
        pub const NOCLDSTOP = 0x0008;
        /// don't mask the signal we're delivering
        pub const NODEFER = 0x0010;
        /// don't keep zombies around
        pub const NOCLDWAIT = 0x0020;
        /// signal handler with SIGINFO args
        pub const SIGINFO = 0x0040;
        /// do not bounce off kernel's sigtramp
        pub const USERTRAMP = 0x0100;
        /// signal handler with SIGINFO args with 64bit regs information
        pub const @"64REGSET" = 0x0200;
    },
    .freebsd => struct {
        pub const ONSTACK = 0x0001;
        pub const RESTART = 0x0002;
        pub const RESETHAND = 0x0004;
        pub const NOCLDSTOP = 0x0008;
        pub const NODEFER = 0x0010;
        pub const NOCLDWAIT = 0x0020;
        pub const SIGINFO = 0x0040;
    },
    .solaris, .illumos => struct {
        pub const ONSTACK = 0x00000001;
        pub const RESETHAND = 0x00000002;
        pub const RESTART = 0x00000004;
        pub const SIGINFO = 0x00000008;
        pub const NODEFER = 0x00000010;
        pub const NOCLDWAIT = 0x00010000;
    },
    .netbsd => struct {
        pub const ONSTACK = 0x0001;
        pub const RESTART = 0x0002;
        pub const RESETHAND = 0x0004;
        pub const NOCLDSTOP = 0x0008;
        pub const NODEFER = 0x0010;
        pub const NOCLDWAIT = 0x0020;
        pub const SIGINFO = 0x0040;
    },
    .dragonfly => struct {
        pub const ONSTACK = 0x0001;
        pub const RESTART = 0x0002;
        pub const RESETHAND = 0x0004;
        pub const NODEFER = 0x0010;
        pub const NOCLDWAIT = 0x0020;
        pub const SIGINFO = 0x0040;
    },
    .haiku => struct {
        pub const NOCLDSTOP = 0x01;
        pub const NOCLDWAIT = 0x02;
        pub const RESETHAND = 0x04;
        pub const NODEFER = 0x08;
        pub const RESTART = 0x10;
        pub const ONSTACK = 0x20;
        pub const SIGINFO = 0x40;
        pub const NOMASK = NODEFER;
        pub const STACK = ONSTACK;
        pub const ONESHOT = RESETHAND;
    },
    .openbsd => struct {
        pub const ONSTACK = 0x0001;
        pub const RESTART = 0x0002;
        pub const RESETHAND = 0x0004;
        pub const NOCLDSTOP = 0x0008;
        pub const NODEFER = 0x0010;
        pub const NOCLDWAIT = 0x0020;
        pub const SIGINFO = 0x0040;
    },
    else => void,
};
pub const sigval_t = switch (native_os) {
    .netbsd, .solaris, .illumos => extern union {
        int: i32,
        ptr: ?*anyopaque,
    },
    else => void,
};

pub const SC = switch (native_os) {
    .linux => linux.SC,
    else => void,
};

pub const _SC = if (builtin.abi.isAndroid()) enum(c_int) {
    PAGESIZE = 39,
    NPROCESSORS_ONLN = 97,
} else switch (native_os) {
    .driverkit, .ios, .macos, .tvos, .visionos, .watchos => enum(c_int) {
        PAGESIZE = 29,
    },
    .dragonfly => enum(c_int) {
        PAGESIZE = 47,
    },
    .freebsd => enum(c_int) {
        PAGESIZE = 47,
    },
    .fuchsia => enum(c_int) {
        PAGESIZE = 30,
    },
    .haiku => enum(c_int) {
        PAGESIZE = 27,
    },
    .linux => enum(c_int) {
        PAGESIZE = 30,
    },
    .netbsd => enum(c_int) {
        PAGESIZE = 28,
    },
    .openbsd => enum(c_int) {
        PAGESIZE = 28,
    },
    .solaris, .illumos => enum(c_int) {
        PAGESIZE = 11,
        NPROCESSORS_ONLN = 15,
    },
    else => void,
};

pub const SEEK = switch (native_os) {
    .linux => linux.SEEK,
    .emscripten => emscripten.SEEK,
    .wasi => struct {
        pub const SET: wasi.whence_t = .SET;
        pub const CUR: wasi.whence_t = .CUR;
        pub const END: wasi.whence_t = .END;
    },
    .openbsd, .haiku, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos, .windows => struct {
        pub const SET = 0;
        pub const CUR = 1;
        pub const END = 2;
    },
    .dragonfly, .solaris, .illumos => struct {
        pub const SET = 0;
        pub const CUR = 1;
        pub const END = 2;
        pub const DATA = 3;
        pub const HOLE = 4;
    },
    else => void,
};
pub const SHUT = switch (native_os) {
    .linux => linux.SHUT,
    .emscripten => emscripten.SHUT,
    else => struct {
        pub const RD = 0;
        pub const WR = 1;
        pub const RDWR = 2;
    },
};

/// Signal types
pub const SIG = switch (native_os) {
    .linux => linux.SIG,
    .emscripten => emscripten.SIG,
    .windows => struct {
        /// interrupt
        pub const INT = 2;
        /// illegal instruction - invalid function image
        pub const ILL = 4;
        /// floating point exception
        pub const FPE = 8;
        /// segment violation
        pub const SEGV = 11;
        /// Software termination signal from kill
        pub const TERM = 15;
        /// Ctrl-Break sequence
        pub const BREAK = 21;
        /// abnormal termination triggered by abort call
        pub const ABRT = 22;
        /// SIGABRT compatible with other platforms, same as SIGABRT
        pub const ABRT_COMPAT = 6;

        // Signal action codes
        /// default signal action
        pub const DFL = 0;
        /// ignore signal
        pub const IGN = 1;
        /// return current value
        pub const GET = 2;
        /// signal gets error
        pub const SGE = 3;
        /// acknowledge
        pub const ACK = 4;
        /// Signal error value (returned by signal call on error)
        pub const ERR = -1;
    },
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const HOLD: ?Sigaction.handler_fn = @ptrFromInt(5);

        /// block specified signal set
        pub const BLOCK = 1;
        /// unblock specified signal set
        pub const UNBLOCK = 2;
        /// set specified signal set
        pub const SETMASK = 3;
        /// hangup
        pub const HUP = 1;
        /// interrupt
        pub const INT = 2;
        /// quit
        pub const QUIT = 3;
        /// illegal instruction (not reset when caught)
        pub const ILL = 4;
        /// trace trap (not reset when caught)
        pub const TRAP = 5;
        /// abort()
        pub const ABRT = 6;
        /// pollable event ([XSR] generated, not supported)
        pub const POLL = 7;
        /// compatibility
        pub const IOT = ABRT;
        /// EMT instruction
        pub const EMT = 7;
        /// floating point exception
        pub const FPE = 8;
        /// kill (cannot be caught or ignored)
        pub const KILL = 9;
        /// bus error
        pub const BUS = 10;
        /// segmentation violation
        pub const SEGV = 11;
        /// bad argument to system call
        pub const SYS = 12;
        /// write on a pipe with no one to read it
        pub const PIPE = 13;
        /// alarm clock
        pub const ALRM = 14;
        /// software termination signal from kill
        pub const TERM = 15;
        /// urgent condition on IO channel
        pub const URG = 16;
        /// sendable stop signal not from tty
        pub const STOP = 17;
        /// stop signal from tty
        pub const TSTP = 18;
        /// continue a stopped process
        pub const CONT = 19;
        /// to parent on child stop or exit
        pub const CHLD = 20;
        /// to readers pgrp upon background tty read
        pub const TTIN = 21;
        /// like TTIN for output if (tp->t_local&LTOSTOP)
        pub const TTOU = 22;
        /// input/output possible signal
        pub const IO = 23;
        /// exceeded CPU time limit
        pub const XCPU = 24;
        /// exceeded file size limit
        pub const XFSZ = 25;
        /// virtual time alarm
        pub const VTALRM = 26;
        /// profiling time alarm
        pub const PROF = 27;
        /// window size changes
        pub const WINCH = 28;
        /// information request
        pub const INFO = 29;
        /// user defined signal 1
        pub const USR1 = 30;
        /// user defined signal 2
        pub const USR2 = 31;
    },
    .freebsd => struct {
        pub const HUP = 1;
        pub const INT = 2;
        pub const QUIT = 3;
        pub const ILL = 4;
        pub const TRAP = 5;
        pub const ABRT = 6;
        pub const IOT = ABRT;
        pub const EMT = 7;
        pub const FPE = 8;
        pub const KILL = 9;
        pub const BUS = 10;
        pub const SEGV = 11;
        pub const SYS = 12;
        pub const PIPE = 13;
        pub const ALRM = 14;
        pub const TERM = 15;
        pub const URG = 16;
        pub const STOP = 17;
        pub const TSTP = 18;
        pub const CONT = 19;
        pub const CHLD = 20;
        pub const TTIN = 21;
        pub const TTOU = 22;
        pub const IO = 23;
        pub const XCPU = 24;
        pub const XFSZ = 25;
        pub const VTALRM = 26;
        pub const PROF = 27;
        pub const WINCH = 28;
        pub const INFO = 29;
        pub const USR1 = 30;
        pub const USR2 = 31;
        pub const THR = 32;
        pub const LWP = THR;
        pub const LIBRT = 33;

        pub const RTMIN = 65;
        pub const RTMAX = 126;

        pub const BLOCK = 1;
        pub const UNBLOCK = 2;
        pub const SETMASK = 3;

        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));

        pub const WORDS = 4;
        pub const MAXSIG = 128;

        pub inline fn IDX(sig: usize) usize {
            return sig - 1;
        }
        pub inline fn WORD(sig: usize) usize {
            return IDX(sig) >> 5;
        }
        pub inline fn BIT(sig: usize) usize {
            return 1 << (IDX(sig) & 31);
        }
        pub inline fn VALID(sig: usize) usize {
            return sig <= MAXSIG and sig > 0;
        }
    },
    .solaris, .illumos => struct {
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const HOLD: ?Sigaction.handler_fn = @ptrFromInt(2);

        pub const WORDS = 4;
        pub const MAXSIG = 75;

        pub const SIG_BLOCK = 1;
        pub const SIG_UNBLOCK = 2;
        pub const SIG_SETMASK = 3;

        pub const HUP = 1;
        pub const INT = 2;
        pub const QUIT = 3;
        pub const ILL = 4;
        pub const TRAP = 5;
        pub const IOT = 6;
        pub const ABRT = 6;
        pub const EMT = 7;
        pub const FPE = 8;
        pub const KILL = 9;
        pub const BUS = 10;
        pub const SEGV = 11;
        pub const SYS = 12;
        pub const PIPE = 13;
        pub const ALRM = 14;
        pub const TERM = 15;
        pub const USR1 = 16;
        pub const USR2 = 17;
        pub const CLD = 18;
        pub const CHLD = 18;
        pub const PWR = 19;
        pub const WINCH = 20;
        pub const URG = 21;
        pub const POLL = 22;
        pub const IO = .POLL;
        pub const STOP = 23;
        pub const TSTP = 24;
        pub const CONT = 25;
        pub const TTIN = 26;
        pub const TTOU = 27;
        pub const VTALRM = 28;
        pub const PROF = 29;
        pub const XCPU = 30;
        pub const XFSZ = 31;
        pub const WAITING = 32;
        pub const LWP = 33;
        pub const FREEZE = 34;
        pub const THAW = 35;
        pub const CANCEL = 36;
        pub const LOST = 37;
        pub const XRES = 38;
        pub const JVM1 = 39;
        pub const JVM2 = 40;
        pub const INFO = 41;

        pub const RTMIN = 42;
        pub const RTMAX = 74;

        pub inline fn IDX(sig: usize) usize {
            return sig - 1;
        }
        pub inline fn WORD(sig: usize) usize {
            return IDX(sig) >> 5;
        }
        pub inline fn BIT(sig: usize) usize {
            return 1 << (IDX(sig) & 31);
        }
        pub inline fn VALID(sig: usize) usize {
            return sig <= MAXSIG and sig > 0;
        }
    },
    .netbsd => struct {
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));

        pub const WORDS = 4;
        pub const MAXSIG = 128;

        pub const BLOCK = 1;
        pub const UNBLOCK = 2;
        pub const SETMASK = 3;

        pub const HUP = 1;
        pub const INT = 2;
        pub const QUIT = 3;
        pub const ILL = 4;
        pub const TRAP = 5;
        pub const ABRT = 6;
        pub const IOT = ABRT;
        pub const EMT = 7;
        pub const FPE = 8;
        pub const KILL = 9;
        pub const BUS = 10;
        pub const SEGV = 11;
        pub const SYS = 12;
        pub const PIPE = 13;
        pub const ALRM = 14;
        pub const TERM = 15;
        pub const URG = 16;
        pub const STOP = 17;
        pub const TSTP = 18;
        pub const CONT = 19;
        pub const CHLD = 20;
        pub const TTIN = 21;
        pub const TTOU = 22;
        pub const IO = 23;
        pub const XCPU = 24;
        pub const XFSZ = 25;
        pub const VTALRM = 26;
        pub const PROF = 27;
        pub const WINCH = 28;
        pub const INFO = 29;
        pub const USR1 = 30;
        pub const USR2 = 31;
        pub const PWR = 32;

        pub const RTMIN = 33;
        pub const RTMAX = 63;

        pub inline fn IDX(sig: usize) usize {
            return sig - 1;
        }
        pub inline fn WORD(sig: usize) usize {
            return IDX(sig) >> 5;
        }
        pub inline fn BIT(sig: usize) usize {
            return 1 << (IDX(sig) & 31);
        }
        pub inline fn VALID(sig: usize) usize {
            return sig <= MAXSIG and sig > 0;
        }
    },
    .dragonfly => struct {
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));

        pub const BLOCK = 1;
        pub const UNBLOCK = 2;
        pub const SETMASK = 3;

        pub const IOT = ABRT;
        pub const HUP = 1;
        pub const INT = 2;
        pub const QUIT = 3;
        pub const ILL = 4;
        pub const TRAP = 5;
        pub const ABRT = 6;
        pub const EMT = 7;
        pub const FPE = 8;
        pub const KILL = 9;
        pub const BUS = 10;
        pub const SEGV = 11;
        pub const SYS = 12;
        pub const PIPE = 13;
        pub const ALRM = 14;
        pub const TERM = 15;
        pub const URG = 16;
        pub const STOP = 17;
        pub const TSTP = 18;
        pub const CONT = 19;
        pub const CHLD = 20;
        pub const TTIN = 21;
        pub const TTOU = 22;
        pub const IO = 23;
        pub const XCPU = 24;
        pub const XFSZ = 25;
        pub const VTALRM = 26;
        pub const PROF = 27;
        pub const WINCH = 28;
        pub const INFO = 29;
        pub const USR1 = 30;
        pub const USR2 = 31;
        pub const THR = 32;
        pub const CKPT = 33;
        pub const CKPTEXIT = 34;

        pub const WORDS = 4;
    },
    .haiku => struct {
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));

        pub const HOLD: ?Sigaction.handler_fn = @ptrFromInt(3);

        pub const HUP = 1;
        pub const INT = 2;
        pub const QUIT = 3;
        pub const ILL = 4;
        pub const CHLD = 5;
        pub const ABRT = 6;
        pub const IOT = ABRT;
        pub const PIPE = 7;
        pub const FPE = 8;
        pub const KILL = 9;
        pub const STOP = 10;
        pub const SEGV = 11;
        pub const CONT = 12;
        pub const TSTP = 13;
        pub const ALRM = 14;
        pub const TERM = 15;
        pub const TTIN = 16;
        pub const TTOU = 17;
        pub const USR1 = 18;
        pub const USR2 = 19;
        pub const WINCH = 20;
        pub const KILLTHR = 21;
        pub const TRAP = 22;
        pub const POLL = 23;
        pub const PROF = 24;
        pub const SYS = 25;
        pub const URG = 26;
        pub const VTALRM = 27;
        pub const XCPU = 28;
        pub const XFSZ = 29;
        pub const BUS = 30;
        pub const RESERVED1 = 31;
        pub const RESERVED2 = 32;

        pub const BLOCK = 1;
        pub const UNBLOCK = 2;
        pub const SETMASK = 3;
    },
    .openbsd => struct {
        pub const DFL: ?Sigaction.handler_fn = @ptrFromInt(0);
        pub const IGN: ?Sigaction.handler_fn = @ptrFromInt(1);
        pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(maxInt(usize));
        pub const CATCH: ?Sigaction.handler_fn = @ptrFromInt(2);
        pub const HOLD: ?Sigaction.handler_fn = @ptrFromInt(3);

        pub const HUP = 1;
        pub const INT = 2;
        pub const QUIT = 3;
        pub const ILL = 4;
        pub const TRAP = 5;
        pub const ABRT = 6;
        pub const IOT = ABRT;
        pub const EMT = 7;
        pub const FPE = 8;
        pub const KILL = 9;
        pub const BUS = 10;
        pub const SEGV = 11;
        pub const SYS = 12;
        pub const PIPE = 13;
        pub const ALRM = 14;
        pub const TERM = 15;
        pub const URG = 16;
        pub const STOP = 17;
        pub const TSTP = 18;
        pub const CONT = 19;
        pub const CHLD = 20;
        pub const TTIN = 21;
        pub const TTOU = 22;
        pub const IO = 23;
        pub const XCPU = 24;
        pub const XFSZ = 25;
        pub const VTALRM = 26;
        pub const PROF = 27;
        pub const WINCH = 28;
        pub const INFO = 29;
        pub const USR1 = 30;
        pub const USR2 = 31;
        pub const PWR = 32;

        pub const BLOCK = 1;
        pub const UNBLOCK = 2;
        pub const SETMASK = 3;
    },
    else => void,
};

pub const SIOCGIFINDEX = switch (native_os) {
    .linux => linux.SIOCGIFINDEX,
    .emscripten => emscripten.SIOCGIFINDEX,
    .solaris, .illumos => solaris.SIOCGLIFINDEX,
    else => void,
};

pub const STDIN_FILENO = switch (native_os) {
    .linux => linux.STDIN_FILENO,
    .emscripten => emscripten.STDIN_FILENO,
    else => 0,
};
pub const STDOUT_FILENO = switch (native_os) {
    .linux => linux.STDOUT_FILENO,
    .emscripten => emscripten.STDOUT_FILENO,
    else => 1,
};
pub const STDERR_FILENO = switch (native_os) {
    .linux => linux.STDERR_FILENO,
    .emscripten => emscripten.STDERR_FILENO,
    else => 2,
};

pub const SYS = switch (native_os) {
    .linux => linux.SYS,
    else => void,
};
/// Renamed from `sigaction` to `Sigaction` to avoid conflict with function name.
pub const Sigaction = switch (native_os) {
    .linux => switch (native_arch) {
        .mips,
        .mipsel,
        .mips64,
        .mips64el,
        => if (builtin.target.abi.isMusl())
            linux.Sigaction
        else if (builtin.target.ptrBitWidth() == 64) extern struct {
            pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
            pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;

            flags: c_uint,
            handler: extern union {
                handler: ?handler_fn,
                sigaction: ?sigaction_fn,
            },
            mask: sigset_t,
            restorer: ?*const fn () callconv(.c) void = null,
        } else extern struct {
            pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
            pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;

            flags: c_uint,
            handler: extern union {
                handler: ?handler_fn,
                sigaction: ?sigaction_fn,
            },
            mask: sigset_t,
            restorer: ?*const fn () callconv(.c) void = null,
            __resv: [1]c_int = .{0},
        },
        .s390x => if (builtin.abi == .gnu) extern struct {
            pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
            pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;

            handler: extern union {
                handler: ?handler_fn,
                sigaction: ?sigaction_fn,
            },
            __glibc_reserved0: c_int = 0,
            flags: c_uint,
            restorer: ?*const fn () callconv(.c) void = null,
            mask: sigset_t,
        } else linux.Sigaction,
        else => linux.Sigaction,
    },
    .emscripten => emscripten.Sigaction,
    .netbsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
        pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;

        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },
        mask: sigset_t,
        flags: c_uint,
    },
    .dragonfly, .freebsd => extern struct {
        pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
        pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;

        /// signal handler
        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },
        /// see signal options
        flags: c_uint,
        /// signal mask to apply
        mask: sigset_t,
    },
    .solaris, .illumos => extern struct {
        pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
        pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;

        /// signal options
        flags: c_uint,
        /// signal handler
        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },
        /// signal mask to apply
        mask: sigset_t,
    },
    .haiku => extern struct {
        pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
        pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;

        /// signal handler
        handler: extern union {
            handler: handler_fn,
            sigaction: sigaction_fn,
        },

        /// signal mask to apply
        mask: sigset_t,

        /// see signal options
        flags: i32,

        /// will be passed to the signal handler, BeOS extension
        userdata: *allowzero anyopaque = undefined,
    },
    .openbsd => extern struct {
        pub const handler_fn = *align(1) const fn (i32) callconv(.c) void;
        pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.c) void;

        /// signal handler
        handler: extern union {
            handler: ?handler_fn,
            sigaction: ?sigaction_fn,
        },
        /// signal mask to apply
        mask: sigset_t,
        /// signal options
        flags: c_uint,
    },
    else => void,
};
pub const T = switch (native_os) {
    .linux => linux.T,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const IOCGWINSZ = ior(0x40000000, 't', 104, @sizeOf(winsize));

        fn ior(inout: u32, group: usize, num: usize, len: usize) usize {
            return (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num));
        }
    },
    .freebsd => struct {
        pub const IOCEXCL = 0x2000740d;
        pub const IOCNXCL = 0x2000740e;
        pub const IOCSCTTY = 0x20007461;
        pub const IOCGPGRP = 0x40047477;
        pub const IOCSPGRP = 0x80047476;
        pub const IOCOUTQ = 0x40047473;
        pub const IOCSTI = 0x80017472;
        pub const IOCGWINSZ = 0x40087468;
        pub const IOCSWINSZ = 0x80087467;
        pub const IOCMGET = 0x4004746a;
        pub const IOCMBIS = 0x8004746c;
        pub const IOCMBIC = 0x8004746b;
        pub const IOCMSET = 0x8004746d;
        pub const FIONREAD = 0x4004667f;
        pub const IOCCONS = 0x80047462;
        pub const IOCPKT = 0x80047470;
        pub const FIONBIO = 0x8004667e;
        pub const IOCNOTTY = 0x20007471;
        pub const IOCSETD = 0x8004741b;
        pub const IOCGETD = 0x4004741a;
        pub const IOCSBRK = 0x2000747b;
        pub const IOCCBRK = 0x2000747a;
        pub const IOCGSID = 0x40047463;
        pub const IOCGPTN = 0x4004740f;
        pub const IOCSIG = 0x2004745f;
    },
    .solaris, .illumos => struct {
        pub const CGETA = tioc('T', 1);
        pub const CSETA = tioc('T', 2);
        pub const CSETAW = tioc('T', 3);
        pub const CSETAF = tioc('T', 4);
        pub const CSBRK = tioc('T', 5);
        pub const CXONC = tioc('T', 6);
        pub const CFLSH = tioc('T', 7);
        pub const IOCGWINSZ = tioc('T', 104);
        pub const IOCSWINSZ = tioc('T', 103);
        // Softcarrier ioctls
        pub const IOCGSOFTCAR = tioc('T', 105);
        pub const IOCSSOFTCAR = tioc('T', 106);
        // termios ioctls
        pub const CGETS = tioc('T', 13);
        pub const CSETS = tioc('T', 14);
        pub const CSANOW = tioc('T', 14);
        pub const CSETSW = tioc('T', 15);
        pub const CSADRAIN = tioc('T', 15);
        pub const CSETSF = tioc('T', 16);
        pub const IOCSETLD = tioc('T', 123);
        pub const IOCGETLD = tioc('T', 124);
        // NTP PPS ioctls
        pub const IOCGPPS = tioc('T', 125);
        pub const IOCSPPS = tioc('T', 126);
        pub const IOCGPPSEV = tioc('T', 127);

        pub const IOCGETD = tioc('t', 0);
        pub const IOCSETD = tioc('t', 1);
        pub const IOCHPCL = tioc('t', 2);
        pub const IOCGETP = tioc('t', 8);
        pub const IOCSETP = tioc('t', 9);
        pub const IOCSETN = tioc('t', 10);
        pub const IOCEXCL = tioc('t', 13);
        pub const IOCNXCL = tioc('t', 14);
        pub const IOCFLUSH = tioc('t', 16);
        pub const IOCSETC = tioc('t', 17);
        pub const IOCGETC = tioc('t', 18);
        /// bis local mode bits
        pub const IOCLBIS = tioc('t', 127);
        /// bic local mode bits
        pub const IOCLBIC = tioc('t', 126);
        /// set entire local mode word
        pub const IOCLSET = tioc('t', 125);
        /// get local modes
        pub const IOCLGET = tioc('t', 124);
        /// set break bit
        pub const IOCSBRK = tioc('t', 123);
        /// clear break bit
        pub const IOCCBRK = tioc('t', 122);
        /// set data terminal ready
        pub const IOCSDTR = tioc('t', 121);
        /// clear data terminal ready
        pub const IOCCDTR = tioc('t', 120);
        /// set local special chars
        pub const IOCSLTC = tioc('t', 117);
        /// get local special chars
        pub const IOCGLTC = tioc('t', 116);
        /// driver output queue size
        pub const IOCOUTQ = tioc('t', 115);
        /// void tty association
        pub const IOCNOTTY = tioc('t', 113);
        /// get a ctty
        pub const IOCSCTTY = tioc('t', 132);
        /// stop output, like ^S
        pub const IOCSTOP = tioc('t', 111);
        /// start output, like ^Q
        pub const IOCSTART = tioc('t', 110);
        /// get pgrp of tty
        pub const IOCGPGRP = tioc('t', 20);
        /// set pgrp of tty
        pub const IOCSPGRP = tioc('t', 21);
        /// get session id on ctty
        pub const IOCGSID = tioc('t', 22);
        /// simulate terminal input
        pub const IOCSTI = tioc('t', 23);
        /// set all modem bits
        pub const IOCMSET = tioc('t', 26);
        /// bis modem bits
        pub const IOCMBIS = tioc('t', 27);
        /// bic modem bits
        pub const IOCMBIC = tioc('t', 28);
        /// get all modem bits
        pub const IOCMGET = tioc('t', 29);

        fn tioc(t: u16, num: u8) u16 {
            return (t << 8) | num;
        }
    },
    .netbsd => struct {
        pub const IOCCBRK = 0x2000747a;
        pub const IOCCDTR = 0x20007478;
        pub const IOCCONS = 0x80047462;
        pub const IOCDCDTIMESTAMP = 0x40107458;
        pub const IOCDRAIN = 0x2000745e;
        pub const IOCEXCL = 0x2000740d;
        pub const IOCEXT = 0x80047460;
        pub const IOCFLAG_CDTRCTS = 0x10;
        pub const IOCFLAG_CLOCAL = 0x2;
        pub const IOCFLAG_CRTSCTS = 0x4;
        pub const IOCFLAG_MDMBUF = 0x8;
        pub const IOCFLAG_SOFTCAR = 0x1;
        pub const IOCFLUSH = 0x80047410;
        pub const IOCGETA = 0x402c7413;
        pub const IOCGETD = 0x4004741a;
        pub const IOCGFLAGS = 0x4004745d;
        pub const IOCGLINED = 0x40207442;
        pub const IOCGPGRP = 0x40047477;
        pub const IOCGQSIZE = 0x40047481;
        pub const IOCGRANTPT = 0x20007447;
        pub const IOCGSID = 0x40047463;
        pub const IOCGSIZE = 0x40087468;
        pub const IOCGWINSZ = 0x40087468;
        pub const IOCMBIC = 0x8004746b;
        pub const IOCMBIS = 0x8004746c;
        pub const IOCMGET = 0x4004746a;
        pub const IOCMSET = 0x8004746d;
        pub const IOCM_CAR = 0x40;
        pub const IOCM_CD = 0x40;
        pub const IOCM_CTS = 0x20;
        pub const IOCM_DSR = 0x100;
        pub const IOCM_DTR = 0x2;
        pub const IOCM_LE = 0x1;
        pub const IOCM_RI = 0x80;
        pub const IOCM_RNG = 0x80;
        pub const IOCM_RTS = 0x4;
        pub const IOCM_SR = 0x10;
        pub const IOCM_ST = 0x8;
        pub const IOCNOTTY = 0x20007471;
        pub const IOCNXCL = 0x2000740e;
        pub const IOCOUTQ = 0x40047473;
        pub const IOCPKT = 0x80047470;
        pub const IOCPKT_DATA = 0x0;
        pub const IOCPKT_DOSTOP = 0x20;
        pub const IOCPKT_FLUSHREAD = 0x1;
        pub const IOCPKT_FLUSHWRITE = 0x2;
        pub const IOCPKT_IOCTL = 0x40;
        pub const IOCPKT_NOSTOP = 0x10;
        pub const IOCPKT_START = 0x8;
        pub const IOCPKT_STOP = 0x4;
        pub const IOCPTMGET = 0x40287446;
        pub const IOCPTSNAME = 0x40287448;
        pub const IOCRCVFRAME = 0x80087445;
        pub const IOCREMOTE = 0x80047469;
        pub const IOCSBRK = 0x2000747b;
        pub const IOCSCTTY = 0x20007461;
        pub const IOCSDTR = 0x20007479;
        pub const IOCSETA = 0x802c7414;
        pub const IOCSETAF = 0x802c7416;
        pub const IOCSETAW = 0x802c7415;
        pub const IOCSETD = 0x8004741b;
        pub const IOCSFLAGS = 0x8004745c;
        pub const IOCSIG = 0x2000745f;
        pub const IOCSLINED = 0x80207443;
        pub const IOCSPGRP = 0x80047476;
        pub const IOCSQSIZE = 0x80047480;
        pub const IOCSSIZE = 0x80087467;
        pub const IOCSTART = 0x2000746e;
        pub const IOCSTAT = 0x80047465;
        pub const IOCSTI = 0x80017472;
        pub const IOCSTOP = 0x2000746f;
        pub const IOCSWINSZ = 0x80087467;
        pub const IOCUCNTL = 0x80047466;
        pub const IOCXMTFRAME = 0x80087444;
    },
    .haiku => struct {
        pub const CGETA = 0x8000;
        pub const CSETA = 0x8001;
        pub const CSETAF = 0x8002;
        pub const CSETAW = 0x8003;
        pub const CWAITEVENT = 0x8004;
        pub const CSBRK = 0x8005;
        pub const CFLSH = 0x8006;
        pub const CXONC = 0x8007;
        pub const CQUERYCONNECTED = 0x8008;
        pub const CGETBITS = 0x8009;
        pub const CSETDTR = 0x8010;
        pub const CSETRTS = 0x8011;
        pub const IOCGWINSZ = 0x8012;
        pub const IOCSWINSZ = 0x8013;
        pub const CVTIME = 0x8014;
        pub const IOCGPGRP = 0x8015;
        pub const IOCSPGRP = 0x8016;
        pub const IOCSCTTY = 0x8017;
        pub const IOCMGET = 0x8018;
        pub const IOCMSET = 0x8019;
        pub const IOCSBRK = 0x8020;
        pub const IOCCBRK = 0x8021;
        pub const IOCMBIS = 0x8022;
        pub const IOCMBIC = 0x8023;
        pub const IOCGSID = 0x8024;

        pub const FIONREAD = 0xbe000001;
        pub const FIONBIO = 0xbe000000;
    },
    .openbsd => struct {
        pub const IOCCBRK = 0x2000747a;
        pub const IOCCDTR = 0x20007478;
        pub const IOCCONS = 0x80047462;
        pub const IOCDCDTIMESTAMP = 0x40107458;
        pub const IOCDRAIN = 0x2000745e;
        pub const IOCEXCL = 0x2000740d;
        pub const IOCEXT = 0x80047460;
        pub const IOCFLAG_CDTRCTS = 0x10;
        pub const IOCFLAG_CLOCAL = 0x2;
        pub const IOCFLAG_CRTSCTS = 0x4;
        pub const IOCFLAG_MDMBUF = 0x8;
        pub const IOCFLAG_SOFTCAR = 0x1;
        pub const IOCFLUSH = 0x80047410;
        pub const IOCGETA = 0x402c7413;
        pub const IOCGETD = 0x4004741a;
        pub const IOCGFLAGS = 0x4004745d;
        pub const IOCGLINED = 0x40207442;
        pub const IOCGPGRP = 0x40047477;
        pub const IOCGQSIZE = 0x40047481;
        pub const IOCGRANTPT = 0x20007447;
        pub const IOCGSID = 0x40047463;
        pub const IOCGSIZE = 0x40087468;
        pub const IOCGWINSZ = 0x40087468;
        pub const IOCMBIC = 0x8004746b;
        pub const IOCMBIS = 0x8004746c;
        pub const IOCMGET = 0x4004746a;
        pub const IOCMSET = 0x8004746d;
        pub const IOCM_CAR = 0x40;
        pub const IOCM_CD = 0x40;
        pub const IOCM_CTS = 0x20;
        pub const IOCM_DSR = 0x100;
        pub const IOCM_DTR = 0x2;
        pub const IOCM_LE = 0x1;
        pub const IOCM_RI = 0x80;
        pub const IOCM_RNG = 0x80;
        pub const IOCM_RTS = 0x4;
        pub const IOCM_SR = 0x10;
        pub const IOCM_ST = 0x8;
        pub const IOCNOTTY = 0x20007471;
        pub const IOCNXCL = 0x2000740e;
        pub const IOCOUTQ = 0x40047473;
        pub const IOCPKT = 0x80047470;
        pub const IOCPKT_DATA = 0x0;
        pub const IOCPKT_DOSTOP = 0x20;
        pub const IOCPKT_FLUSHREAD = 0x1;
        pub const IOCPKT_FLUSHWRITE = 0x2;
        pub const IOCPKT_IOCTL = 0x40;
        pub const IOCPKT_NOSTOP = 0x10;
        pub const IOCPKT_START = 0x8;
        pub const IOCPKT_STOP = 0x4;
        pub const IOCPTMGET = 0x40287446;
        pub const IOCPTSNAME = 0x40287448;
        pub const IOCRCVFRAME = 0x80087445;
        pub const IOCREMOTE = 0x80047469;
        pub const IOCSBRK = 0x2000747b;
        pub const IOCSCTTY = 0x20007461;
        pub const IOCSDTR = 0x20007479;
        pub const IOCSETA = 0x802c7414;
        pub const IOCSETAF = 0x802c7416;
        pub const IOCSETAW = 0x802c7415;
        pub const IOCSETD = 0x8004741b;
        pub const IOCSFLAGS = 0x8004745c;
        pub const IOCSIG = 0x2000745f;
        pub const IOCSLINED = 0x80207443;
        pub const IOCSPGRP = 0x80047476;
        pub const IOCSQSIZE = 0x80047480;
        pub const IOCSSIZE = 0x80087467;
        pub const IOCSTART = 0x2000746e;
        pub const IOCSTAT = 0x80047465;
        pub const IOCSTI = 0x80017472;
        pub const IOCSTOP = 0x2000746f;
        pub const IOCSWINSZ = 0x80087467;
        pub const IOCUCNTL = 0x80047466;
        pub const IOCXMTFRAME = 0x80087444;
    },
    .dragonfly => struct {
        pub const IOCMODG = 0x40047403;
        pub const IOCMODS = 0x80047404;
        pub const IOCM_LE = 0x00000001;
        pub const IOCM_DTR = 0x00000002;
        pub const IOCM_RTS = 0x00000004;
        pub const IOCM_ST = 0x00000008;
        pub const IOCM_SR = 0x00000010;
        pub const IOCM_CTS = 0x00000020;
        pub const IOCM_CAR = 0x00000040;
        pub const IOCM_CD = 0x00000040;
        pub const IOCM_RNG = 0x00000080;
        pub const IOCM_RI = 0x00000080;
        pub const IOCM_DSR = 0x00000100;
        pub const IOCEXCL = 0x2000740d;
        pub const IOCNXCL = 0x2000740e;
        pub const IOCFLUSH = 0x80047410;
        pub const IOCGETA = 0x402c7413;
        pub const IOCSETA = 0x802c7414;
        pub const IOCSETAW = 0x802c7415;
        pub const IOCSETAF = 0x802c7416;
        pub const IOCGETD = 0x4004741a;
        pub const IOCSETD = 0x8004741b;
        pub const IOCSBRK = 0x2000747b;
        pub const IOCCBRK = 0x2000747a;
        pub const IOCSDTR = 0x20007479;
        pub const IOCCDTR = 0x20007478;
        pub const IOCGPGRP = 0x40047477;
        pub const IOCSPGRP = 0x80047476;
        pub const IOCOUTQ = 0x40047473;
        pub const IOCSTI = 0x80017472;
        pub const IOCNOTTY = 0x20007471;
        pub const IOCPKT = 0x80047470;
        pub const IOCPKT_DATA = 0x00000000;
        pub const IOCPKT_FLUSHREAD = 0x00000001;
        pub const IOCPKT_FLUSHWRITE = 0x00000002;
        pub const IOCPKT_STOP = 0x00000004;
        pub const IOCPKT_START = 0x00000008;
        pub const IOCPKT_NOSTOP = 0x00000010;
        pub const IOCPKT_DOSTOP = 0x00000020;
        pub const IOCPKT_IOCTL = 0x00000040;
        pub const IOCSTOP = 0x2000746f;
        pub const IOCSTART = 0x2000746e;
        pub const IOCMSET = 0x8004746d;
        pub const IOCMBIS = 0x8004746c;
        pub const IOCMBIC = 0x8004746b;
        pub const IOCMGET = 0x4004746a;
        pub const IOCREMOTE = 0x80047469;
        pub const IOCGWINSZ = 0x40087468;
        pub const IOCSWINSZ = 0x80087467;
        pub const IOCUCNTL = 0x80047466;
        pub const IOCSTAT = 0x20007465;
        pub const IOCGSID = 0x40047463;
        pub const IOCCONS = 0x80047462;
        pub const IOCSCTTY = 0x20007461;
        pub const IOCEXT = 0x80047460;
        pub const IOCSIG = 0x2000745f;
        pub const IOCDRAIN = 0x2000745e;
        pub const IOCMSDTRWAIT = 0x8004745b;
        pub const IOCMGDTRWAIT = 0x4004745a;
        pub const IOCTIMESTAMP = 0x40107459;
        pub const IOCDCDTIMESTAMP = 0x40107458;
        pub const IOCSDRAINWAIT = 0x80047457;
        pub const IOCGDRAINWAIT = 0x40047456;
        pub const IOCISPTMASTER = 0x20007455;
    },
    else => void,
};
pub const IOCPARM_MASK = switch (native_os) {
    .windows => ws2_32.IOCPARM_MASK,
    .macos, .ios, .tvos, .watchos, .visionos => 0x1fff,
    else => void,
};
pub const TCSA = std.posix.TCSA;
pub const TFD = switch (native_os) {
    .linux => linux.TFD,
    else => void,
};
pub const VDSO = switch (native_os) {
    .linux => linux.VDSO,
    else => void,
};
pub const W = switch (native_os) {
    .linux => linux.W,
    .emscripten => emscripten.W,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        /// [XSI] no hang in wait/no child to reap
        pub const NOHANG = 0x00000001;
        /// [XSI] notify on stop, untraced child
        pub const UNTRACED = 0x00000002;

        pub fn EXITSTATUS(x: u32) u8 {
            return @as(u8, @intCast(x >> 8));
        }
        pub fn TERMSIG(x: u32) u32 {
            return status(x);
        }
        pub fn STOPSIG(x: u32) u32 {
            return x >> 8;
        }
        pub fn IFEXITED(x: u32) bool {
            return status(x) == 0;
        }
        pub fn IFSTOPPED(x: u32) bool {
            return status(x) == stopped and STOPSIG(x) != 0x13;
        }
        pub fn IFSIGNALED(x: u32) bool {
            return status(x) != stopped and status(x) != 0;
        }

        fn status(x: u32) u32 {
            return x & 0o177;
        }
        const stopped = 0o177;
    },
    .freebsd => struct {
        pub const NOHANG = 1;
        pub const UNTRACED = 2;
        pub const STOPPED = UNTRACED;
        pub const CONTINUED = 4;
        pub const NOWAIT = 8;
        pub const EXITED = 16;
        pub const TRAPPED = 32;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast((s & 0xff00) >> 8));
        }
        pub fn TERMSIG(s: u32) u32 {
            return s & 0x7f;
        }
        pub fn STOPSIG(s: u32) u32 {
            return EXITSTATUS(s);
        }
        pub fn IFEXITED(s: u32) bool {
            return TERMSIG(s) == 0;
        }
        pub fn IFSTOPPED(s: u32) bool {
            return @as(u16, @truncate((((s & 0xffff) *% 0x10001) >> 8))) > 0x7f00;
        }
        pub fn IFSIGNALED(s: u32) bool {
            return (s & 0xffff) -% 1 < 0xff;
        }
    },
    .solaris, .illumos => struct {
        pub const EXITED = 0o001;
        pub const TRAPPED = 0o002;
        pub const UNTRACED = 0o004;
        pub const STOPPED = UNTRACED;
        pub const CONTINUED = 0o010;
        pub const NOHANG = 0o100;
        pub const NOWAIT = 0o200;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast((s >> 8) & 0xff));
        }
        pub fn TERMSIG(s: u32) u32 {
            return s & 0x7f;
        }
        pub fn STOPSIG(s: u32) u32 {
            return EXITSTATUS(s);
        }
        pub fn IFEXITED(s: u32) bool {
            return TERMSIG(s) == 0;
        }

        pub fn IFCONTINUED(s: u32) bool {
            return ((s & 0o177777) == 0o177777);
        }

        pub fn IFSTOPPED(s: u32) bool {
            return (s & 0x00ff != 0o177) and !(s & 0xff00 != 0);
        }

        pub fn IFSIGNALED(s: u32) bool {
            return s & 0x00ff > 0 and s & 0xff00 == 0;
        }
    },
    .netbsd => struct {
        pub const NOHANG = 0x00000001;
        pub const UNTRACED = 0x00000002;
        pub const STOPPED = UNTRACED;
        pub const CONTINUED = 0x00000010;
        pub const NOWAIT = 0x00010000;
        pub const EXITED = 0x00000020;
        pub const TRAPPED = 0x00000040;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast((s >> 8) & 0xff));
        }
        pub fn TERMSIG(s: u32) u32 {
            return s & 0x7f;
        }
        pub fn STOPSIG(s: u32) u32 {
            return EXITSTATUS(s);
        }
        pub fn IFEXITED(s: u32) bool {
            return TERMSIG(s) == 0;
        }

        pub fn IFCONTINUED(s: u32) bool {
            return ((s & 0x7f) == 0xffff);
        }

        pub fn IFSTOPPED(s: u32) bool {
            return ((s & 0x7f != 0x7f) and !IFCONTINUED(s));
        }

        pub fn IFSIGNALED(s: u32) bool {
            return !IFSTOPPED(s) and !IFCONTINUED(s) and !IFEXITED(s);
        }
    },
    .dragonfly => struct {
        pub const NOHANG = 0x0001;
        pub const UNTRACED = 0x0002;
        pub const CONTINUED = 0x0004;
        pub const STOPPED = UNTRACED;
        pub const NOWAIT = 0x0008;
        pub const EXITED = 0x0010;
        pub const TRAPPED = 0x0020;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast((s & 0xff00) >> 8));
        }
        pub fn TERMSIG(s: u32) u32 {
            return s & 0x7f;
        }
        pub fn STOPSIG(s: u32) u32 {
            return EXITSTATUS(s);
        }
        pub fn IFEXITED(s: u32) bool {
            return TERMSIG(s) == 0;
        }
        pub fn IFSTOPPED(s: u32) bool {
            return @as(u16, @truncate((((s & 0xffff) *% 0x10001) >> 8))) > 0x7f00;
        }
        pub fn IFSIGNALED(s: u32) bool {
            return (s & 0xffff) -% 1 < 0xff;
        }
    },
    .haiku => struct {
        pub const NOHANG = 0x1;
        pub const UNTRACED = 0x2;
        pub const CONTINUED = 0x4;
        pub const EXITED = 0x08;
        pub const STOPPED = 0x10;
        pub const NOWAIT = 0x20;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast(s & 0xff));
        }

        pub fn TERMSIG(s: u32) u32 {
            return (s >> 8) & 0xff;
        }

        pub fn STOPSIG(s: u32) u32 {
            return (s >> 16) & 0xff;
        }

        pub fn IFEXITED(s: u32) bool {
            return (s & ~@as(u32, 0xff)) == 0;
        }

        pub fn IFSTOPPED(s: u32) bool {
            return ((s >> 16) & 0xff) != 0;
        }

        pub fn IFSIGNALED(s: u32) bool {
            return ((s >> 8) & 0xff) != 0;
        }
    },
    .openbsd => struct {
        pub const NOHANG = 1;
        pub const UNTRACED = 2;
        pub const CONTINUED = 8;

        pub fn EXITSTATUS(s: u32) u8 {
            return @as(u8, @intCast((s >> 8) & 0xff));
        }
        pub fn TERMSIG(s: u32) u32 {
            return (s & 0x7f);
        }
        pub fn STOPSIG(s: u32) u32 {
            return EXITSTATUS(s);
        }
        pub fn IFEXITED(s: u32) bool {
            return TERMSIG(s) == 0;
        }

        pub fn IFCONTINUED(s: u32) bool {
            return ((s & 0o177777) == 0o177777);
        }

        pub fn IFSTOPPED(s: u32) bool {
            return (s & 0xff == 0o177);
        }

        pub fn IFSIGNALED(s: u32) bool {
            return (((s) & 0o177) != 0o177) and (((s) & 0o177) != 0);
        }
    },
    else => void,
};
pub const clock_t = switch (native_os) {
    .linux => linux.clock_t,
    .emscripten => emscripten.clock_t,
    .macos, .ios, .tvos, .watchos, .visionos => c_ulong,
    .freebsd => isize,
    .openbsd, .solaris, .illumos => i64,
    .netbsd => u32,
    .haiku => i32,
    else => void,
};
pub const cpu_set_t = switch (native_os) {
    .linux => linux.cpu_set_t,
    .emscripten => emscripten.cpu_set_t,
    else => void,
};
pub const dl_phdr_info = switch (native_os) {
    .linux => linux.dl_phdr_info,
    .emscripten => emscripten.dl_phdr_info,
    .freebsd => extern struct {
        /// Module relocation base.
        addr: if (builtin.target.ptrBitWidth() == 32) std.elf.Elf32_Addr else std.elf.Elf64_Addr,
        /// Module name.
        name: ?[*:0]const u8,
        /// Pointer to module's phdr.
        phdr: [*]std.elf.Phdr,
        /// Number of entries in phdr.
        phnum: u16,
        /// Total number of loads.
        adds: u64,
        /// Total number of unloads.
        subs: u64,
        tls_modid: usize,
        tls_data: ?*anyopaque,
    },
    .solaris, .illumos => extern struct {
        addr: std.elf.Addr,
        name: ?[*:0]const u8,
        phdr: [*]std.elf.Phdr,
        phnum: std.elf.Half,
        /// Incremented when a new object is mapped into the process.
        adds: u64,
        /// Incremented when an object is unmapped from the process.
        subs: u64,
    },
    .openbsd, .haiku, .dragonfly, .netbsd => extern struct {
        addr: usize,
        name: ?[*:0]const u8,
        phdr: [*]std.elf.Phdr,
        phnum: u16,
    },
    else => void,
};
pub const epoll_event = switch (native_os) {
    .linux => linux.epoll_event,
    else => void,
};
pub const ifreq = switch (native_os) {
    .linux => linux.ifreq,
    .emscripten => emscripten.ifreq,
    .solaris, .illumos => lifreq,
    else => void,
};
pub const itimerspec = switch (native_os) {
    .linux => linux.itimerspec,
    .haiku => extern struct {
        interval: timespec,
        value: timespec,
    },
    else => void,
};
pub const msghdr = switch (native_os) {
    .linux => linux.msghdr,
    .openbsd,
    .emscripten,
    .dragonfly,
    .freebsd,
    .netbsd,
    .haiku,
    .solaris,
    .illumos,
    .macos,
    .driverkit,
    .ios,
    .tvos,
    .visionos,
    .watchos,
    => extern struct {
        /// optional address
        name: ?*sockaddr,
        /// size of address
        namelen: socklen_t,
        /// scatter/gather array
        iov: [*]iovec,
        /// # elements in iov
        iovlen: i32,
        /// ancillary data
        control: ?*anyopaque,
        /// ancillary data buffer len
        controllen: socklen_t,
        /// flags on received message
        flags: i32,
    },
    else => void,
};
pub const msghdr_const = switch (native_os) {
    .linux => linux.msghdr_const,
    .openbsd,
    .emscripten,
    .dragonfly,
    .freebsd,
    .netbsd,
    .haiku,
    .solaris,
    .illumos,
    .macos,
    .driverkit,
    .ios,
    .tvos,
    .visionos,
    .watchos,
    => extern struct {
        /// optional address
        name: ?*const sockaddr,
        /// size of address
        namelen: socklen_t,
        /// scatter/gather array
        iov: [*]const iovec_const,
        /// # elements in iov
        iovlen: i32,
        /// ancillary data
        control: ?*const anyopaque,
        /// ancillary data buffer len
        controllen: socklen_t,
        /// flags on received message
        flags: i32,
    },
    else => void,
};
pub const nfds_t = switch (native_os) {
    .linux => linux.nfds_t,
    .emscripten => emscripten.nfds_t,
    .haiku, .solaris, .illumos, .wasi => usize,
    .windows => c_ulong,
    .openbsd, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => u32,
    else => void,
};
pub const perf_event_attr = switch (native_os) {
    .linux => linux.perf_event_attr,
    else => void,
};
pub const pid_t = switch (native_os) {
    .linux => linux.pid_t,
    .emscripten => emscripten.pid_t,
    .windows => windows.HANDLE,
    else => i32,
};
pub const pollfd = switch (native_os) {
    .linux => linux.pollfd,
    .emscripten => emscripten.pollfd,
    .windows => ws2_32.pollfd,
    else => extern struct {
        fd: fd_t,
        events: i16,
        revents: i16,
    },
};
pub const rlim_t = switch (native_os) {
    .linux => linux.rlim_t,
    .emscripten => emscripten.rlim_t,
    .openbsd, .netbsd, .solaris, .illumos, .macos, .ios, .tvos, .watchos, .visionos => u64,
    .haiku, .dragonfly, .freebsd => i64,
    else => void,
};
pub const rlimit = switch (native_os) {
    .linux, .emscripten => linux.rlimit,
    .windows => void,
    else => extern struct {
        /// Soft limit
        cur: rlim_t,
        /// Hard limit
        max: rlim_t,
    },
};
pub const rlimit_resource = switch (native_os) {
    .linux => linux.rlimit_resource,
    .emscripten => emscripten.rlimit_resource,
    .openbsd, .macos, .ios, .tvos, .watchos, .visionos => enum(c_int) {
        CPU = 0,
        FSIZE = 1,
        DATA = 2,
        STACK = 3,
        CORE = 4,
        RSS = 5,
        MEMLOCK = 6,
        NPROC = 7,
        NOFILE = 8,
        _,

        pub const AS: rlimit_resource = .RSS;
    },
    .freebsd => enum(c_int) {
        CPU = 0,
        FSIZE = 1,
        DATA = 2,
        STACK = 3,
        CORE = 4,
        RSS = 5,
        MEMLOCK = 6,
        NPROC = 7,
        NOFILE = 8,
        SBSIZE = 9,
        VMEM = 10,
        NPTS = 11,
        SWAP = 12,
        KQUEUES = 13,
        UMTXP = 14,
        _,

        pub const AS: rlimit_resource = .VMEM;
    },
    .solaris, .illumos => enum(c_int) {
        CPU = 0,
        FSIZE = 1,
        DATA = 2,
        STACK = 3,
        CORE = 4,
        NOFILE = 5,
        VMEM = 6,
        _,

        pub const AS: rlimit_resource = .VMEM;
    },
    .netbsd => enum(c_int) {
        CPU = 0,
        FSIZE = 1,
        DATA = 2,
        STACK = 3,
        CORE = 4,
        RSS = 5,
        MEMLOCK = 6,
        NPROC = 7,
        NOFILE = 8,
        SBSIZE = 9,
        VMEM = 10,
        NTHR = 11,
        _,

        pub const AS: rlimit_resource = .VMEM;
    },
    .dragonfly => enum(c_int) {
        CPU = 0,
        FSIZE = 1,
        DATA = 2,
        STACK = 3,
        CORE = 4,
        RSS = 5,
        MEMLOCK = 6,
        NPROC = 7,
        NOFILE = 8,
        SBSIZE = 9,
        VMEM = 10,
        POSIXLOCKS = 11,
        _,

        pub const AS: rlimit_resource = .VMEM;
    },
    .haiku => enum(i32) {
        CORE = 0,
        CPU = 1,
        DATA = 2,
        FSIZE = 3,
        NOFILE = 4,
        STACK = 5,
        AS = 6,
        NOVMON = 7,
        _,
    },
    else => void,
};
pub const rusage = switch (native_os) {
    .linux => linux.rusage,
    .emscripten => emscripten.rusage,
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        utime: timeval,
        stime: timeval,
        maxrss: isize,
        ixrss: isize,
        idrss: isize,
        isrss: isize,
        minflt: isize,
        majflt: isize,
        nswap: isize,
        inblock: isize,
        oublock: isize,
        msgsnd: isize,
        msgrcv: isize,
        nsignals: isize,
        nvcsw: isize,
        nivcsw: isize,

        pub const SELF = 0;
        pub const CHILDREN = -1;
    },
    .solaris, .illumos => extern struct {
        utime: timeval,
        stime: timeval,
        maxrss: isize,
        ixrss: isize,
        idrss: isize,
        isrss: isize,
        minflt: isize,
        majflt: isize,
        nswap: isize,
        inblock: isize,
        oublock: isize,
        msgsnd: isize,
        msgrcv: isize,
        nsignals: isize,
        nvcsw: isize,
        nivcsw: isize,

        pub const SELF = 0;
        pub const CHILDREN = -1;
        pub const THREAD = 1;
    },
    else => void,
};

pub const siginfo_t = switch (native_os) {
    .linux => linux.siginfo_t,
    .emscripten => emscripten.siginfo_t,
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        signo: c_int,
        errno: c_int,
        code: c_int,
        pid: pid_t,
        uid: uid_t,
        status: c_int,
        addr: *allowzero anyopaque,
        value: extern union {
            int: c_int,
            ptr: *anyopaque,
        },
        si_band: c_long,
        _pad: [7]c_ulong,
    },
    .freebsd => extern struct {
        // Signal number.
        signo: c_int,
        // Errno association.
        errno: c_int,
        /// Signal code.
        ///
        /// Cause of signal, one of the SI_ macros or signal-specific values, i.e.
        /// one of the FPE_... values for SIGFPE.
        /// This value is equivalent to the second argument to an old-style FreeBSD
        /// signal handler.
        code: c_int,
        /// Sending process.
        pid: pid_t,
        /// Sender's ruid.
        uid: uid_t,
        /// Exit value.
        status: c_int,
        /// Faulting instruction.
        addr: *allowzero anyopaque,
        /// Signal value.
        value: sigval,
        reason: extern union {
            fault: extern struct {
                /// Machine specific trap code.
                trapno: c_int,
            },
            timer: extern struct {
                timerid: c_int,
                overrun: c_int,
            },
            mesgq: extern struct {
                mqd: c_int,
            },
            poll: extern struct {
                /// Band event for SIGPOLL. UNUSED.
                band: c_long,
            },
            spare: extern struct {
                spare1: c_long,
                spare2: [7]c_int,
            },
        },
    },
    .solaris, .illumos => extern struct {
        signo: c_int,
        code: c_int,
        errno: c_int,
        // 64bit architectures insert 4bytes of padding here, this is done by
        // correctly aligning the reason field
        reason: extern union {
            proc: extern struct {
                pid: pid_t,
                pdata: extern union {
                    kill: extern struct {
                        uid: uid_t,
                        value: sigval_t,
                    },
                    cld: extern struct {
                        utime: clock_t,
                        status: c_int,
                        stime: clock_t,
                    },
                },
                contract: solaris.ctid_t,
                zone: solaris.zoneid_t,
            },
            fault: extern struct {
                addr: *allowzero anyopaque,
                trapno: c_int,
                pc: ?*anyopaque,
            },
            file: extern struct {
                // fd not currently available for SIGPOLL.
                fd: c_int,
                band: c_long,
            },
            prof: extern struct {
                addr: ?*anyopaque,
                timestamp: timespec,
                syscall: c_short,
                sysarg: u8,
                fault: u8,
                args: [8]c_long,
                state: [10]c_int,
            },
            rctl: extern struct {
                entity: i32,
            },
            __pad: [256 - 4 * @sizeOf(c_int)]u8,
        } align(@sizeOf(usize)),

        comptime {
            assert(@sizeOf(@This()) == 256);
            assert(@alignOf(@This()) == @sizeOf(usize));
        }
    },
    .netbsd => extern union {
        pad: [128]u8,
        info: netbsd._ksiginfo,
    },
    .dragonfly => extern struct {
        signo: c_int,
        errno: c_int,
        code: c_int,
        pid: c_int,
        uid: uid_t,
        status: c_int,
        addr: *allowzero anyopaque,
        value: sigval,
        band: c_long,
        __spare__: [7]c_int,
    },
    .haiku => extern struct {
        signo: i32,
        code: i32,
        errno: i32,

        pid: pid_t,
        uid: uid_t,
        addr: *allowzero anyopaque,
    },
    .openbsd => extern struct {
        signo: c_int,
        code: c_int,
        errno: c_int,
        data: extern union {
            proc: extern struct {
                pid: pid_t,
                pdata: extern union {
                    kill: extern struct {
                        uid: uid_t,
                        value: sigval,
                    },
                    cld: extern struct {
                        utime: clock_t,
                        stime: clock_t,
                        status: c_int,
                    },
                },
            },
            fault: extern struct {
                addr: *allowzero anyopaque,
                trapno: c_int,
            },
            __pad: [128 - 3 * @sizeOf(c_int)]u8,
        },

        comptime {
            if (@sizeOf(usize) == 4)
                assert(@sizeOf(@This()) == 128)
            else
                // Take into account the padding between errno and data fields.
                assert(@sizeOf(@This()) == 136);
        }
    },
    else => void,
};
pub const sigset_t = switch (native_os) {
    .linux => linux.sigset_t,
    .emscripten => emscripten.sigset_t,
    .openbsd, .macos, .ios, .tvos, .watchos, .visionos => u32,
    .dragonfly, .netbsd, .solaris, .illumos, .freebsd => extern struct {
        __bits: [SIG.WORDS]u32,
    },
    .haiku => u64,
    else => u0,
};
pub const empty_sigset: sigset_t = switch (native_os) {
    .linux => linux.empty_sigset,
    .emscripten => emscripten.empty_sigset,
    .dragonfly, .netbsd, .solaris, .illumos, .freebsd => .{ .__bits = [_]u32{0} ** SIG.WORDS },
    else => 0,
};
pub const filled_sigset = switch (native_os) {
    .linux => linux.filled_sigset,
    .haiku => ~@as(sigset_t, 0),
    else => 0,
};
pub const sigval = switch (native_os) {
    .linux => linux.sigval,
    .openbsd, .dragonfly, .freebsd => extern union {
        int: c_int,
        ptr: ?*anyopaque,
    },
    else => void,
};

pub const addrinfo = if (builtin.abi.isAndroid()) extern struct {
    flags: AI,
    family: i32,
    socktype: i32,
    protocol: i32,
    addrlen: socklen_t,
    canonname: ?[*:0]u8,
    addr: ?*sockaddr,
    next: ?*addrinfo,
} else switch (native_os) {
    .linux, .emscripten => linux.addrinfo,
    .windows => ws2_32.addrinfo,
    .freebsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        flags: AI,
        family: i32,
        socktype: i32,
        protocol: i32,
        addrlen: socklen_t,
        canonname: ?[*:0]u8,
        addr: ?*sockaddr,
        next: ?*addrinfo,
    },
    .solaris, .illumos => extern struct {
        flags: AI,
        family: i32,
        socktype: i32,
        protocol: i32,
        addrlen: socklen_t,
        canonname: ?[*:0]u8,
        addr: ?*sockaddr,
        next: ?*addrinfo,
    },
    .netbsd => extern struct {
        flags: AI,
        family: i32,
        socktype: i32,
        protocol: i32,
        addrlen: socklen_t,
        canonname: ?[*:0]u8,
        addr: ?*sockaddr,
        next: ?*addrinfo,
    },
    .dragonfly => extern struct {
        flags: AI,
        family: i32,
        socktype: i32,
        protocol: i32,
        addrlen: socklen_t,
        canonname: ?[*:0]u8,
        addr: ?*sockaddr,
        next: ?*addrinfo,
    },
    .haiku => extern struct {
        flags: AI,
        family: i32,
        socktype: i32,
        protocol: i32,
        addrlen: socklen_t,
        canonname: ?[*:0]u8,
        addr: ?*sockaddr,
        next: ?*addrinfo,
    },
    .openbsd => extern struct {
        flags: AI,
        family: c_int,
        socktype: c_int,
        protocol: c_int,
        addrlen: socklen_t,
        addr: ?*sockaddr,
        canonname: ?[*:0]u8,
        next: ?*addrinfo,
    },
    else => void,
};
pub const sockaddr = switch (native_os) {
    .linux, .emscripten => linux.sockaddr,
    .windows => ws2_32.sockaddr,
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        len: u8,
        family: sa_family_t,
        data: [14]u8,

        pub const SS_MAXSIZE = 128;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [126]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };
        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };
        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        /// UNIX domain socket
        pub const un = extern struct {
            len: u8 = @sizeOf(un),
            family: sa_family_t = AF.UNIX,
            path: [104]u8,
        };
    },
    .freebsd => extern struct {
        /// total length
        len: u8,
        /// address family
        family: sa_family_t,
        /// actually longer; address value
        data: [14]u8,

        pub const SS_MAXSIZE = 128;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [126]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        pub const un = extern struct {
            len: u8 = @sizeOf(un),
            family: sa_family_t = AF.UNIX,
            path: [104]u8,
        };
    },
    .solaris, .illumos => extern struct {
        /// address family
        family: sa_family_t,

        /// actually longer; address value
        data: [14]u8,

        pub const SS_MAXSIZE = 256;
        pub const storage = extern struct {
            family: sa_family_t align(8),
            padding: [254]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
            __src_id: u32 = 0,
        };

        /// Definitions for UNIX IPC domain.
        pub const un = extern struct {
            family: sa_family_t = AF.UNIX,
            path: [108]u8,
        };
    },
    .netbsd => extern struct {
        /// total length
        len: u8,
        /// address family
        family: sa_family_t,
        /// actually longer; address value
        data: [14]u8,

        pub const SS_MAXSIZE = 128;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [126]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        /// Definitions for UNIX IPC domain.
        pub const un = extern struct {
            /// total sockaddr length
            len: u8 = @sizeOf(un),

            family: sa_family_t = AF.LOCAL,

            /// path name
            path: [104]u8,
        };
    },
    .dragonfly => extern struct {
        len: u8,
        family: sa_family_t,
        data: [14]u8,

        pub const SS_MAXSIZE = 128;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [126]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        pub const un = extern struct {
            len: u8 = @sizeOf(un),
            family: sa_family_t = AF.UNIX,
            path: [104]u8,
        };
    },
    .haiku => extern struct {
        /// total length
        len: u8,
        /// address family
        family: sa_family_t,
        /// actually longer; address value
        data: [14]u8,

        pub const SS_MAXSIZE = 128;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [126]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        pub const un = extern struct {
            len: u8 = @sizeOf(un),
            family: sa_family_t = AF.UNIX,
            path: [104]u8,
        };
    },
    .openbsd => extern struct {
        /// total length
        len: u8,
        /// address family
        family: sa_family_t,
        /// actually longer; address value
        data: [14]u8,

        pub const SS_MAXSIZE = 256;
        pub const storage = extern struct {
            len: u8 align(8),
            family: sa_family_t,
            padding: [254]u8 = undefined,

            comptime {
                assert(@sizeOf(storage) == SS_MAXSIZE);
                assert(@alignOf(storage) == 8);
            }
        };

        pub const in = extern struct {
            len: u8 = @sizeOf(in),
            family: sa_family_t = AF.INET,
            port: in_port_t,
            addr: u32,
            zero: [8]u8 = [8]u8{ 0, 0, 0, 0, 0, 0, 0, 0 },
        };

        pub const in6 = extern struct {
            len: u8 = @sizeOf(in6),
            family: sa_family_t = AF.INET6,
            port: in_port_t,
            flowinfo: u32,
            addr: [16]u8,
            scope_id: u32,
        };

        /// Definitions for UNIX IPC domain.
        pub const un = extern struct {
            /// total sockaddr length
            len: u8 = @sizeOf(un),

            family: sa_family_t = AF.LOCAL,

            /// path name
            path: [104]u8,
        };
    },
    else => void,
};
pub const socklen_t = switch (native_os) {
    .linux, .emscripten => linux.socklen_t,
    .windows => ws2_32.socklen_t,
    else => u32,
};
pub const in_port_t = u16;
pub const sa_family_t = switch (native_os) {
    .linux, .emscripten => linux.sa_family_t,
    .windows => ws2_32.ADDRESS_FAMILY,
    .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => u8,
    .solaris, .illumos => u16,
    else => void,
};
pub const AF = if (builtin.abi.isAndroid()) struct {
    pub const UNSPEC = 0;
    pub const UNIX = 1;
    pub const LOCAL = 1;
    pub const INET = 2;
    pub const AX25 = 3;
    pub const IPX = 4;
    pub const APPLETALK = 5;
    pub const NETROM = 6;
    pub const BRIDGE = 7;
    pub const ATMPVC = 8;
    pub const X25 = 9;
    pub const INET6 = 10;
    pub const ROSE = 11;
    pub const DECnet = 12;
    pub const NETBEUI = 13;
    pub const SECURITY = 14;
    pub const KEY = 15;
    pub const NETLINK = 16;
    pub const ROUTE = NETLINK;
    pub const PACKET = 17;
    pub const ASH = 18;
    pub const ECONET = 19;
    pub const ATMSVC = 20;
    pub const RDS = 21;
    pub const SNA = 22;
    pub const IRDA = 23;
    pub const PPPOX = 24;
    pub const WANPIPE = 25;
    pub const LLC = 26;
    pub const CAN = 29;
    pub const TIPC = 30;
    pub const BLUETOOTH = 31;
    pub const IUCV = 32;
    pub const RXRPC = 33;
    pub const ISDN = 34;
    pub const PHONET = 35;
    pub const IEEE802154 = 36;
    pub const CAIF = 37;
    pub const ALG = 38;
    pub const NFC = 39;
    pub const VSOCK = 40;
    pub const KCM = 41;
    pub const QIPCRTR = 42;
    pub const MAX = 43;
} else switch (native_os) {
    .linux, .emscripten => linux.AF,
    .windows => ws2_32.AF,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const UNSPEC = 0;
        pub const LOCAL = 1;
        pub const UNIX = LOCAL;
        pub const INET = 2;
        pub const SYS_CONTROL = 2;
        pub const IMPLINK = 3;
        pub const PUP = 4;
        pub const CHAOS = 5;
        pub const NS = 6;
        pub const ISO = 7;
        pub const OSI = ISO;
        pub const ECMA = 8;
        pub const DATAKIT = 9;
        pub const CCITT = 10;
        pub const SNA = 11;
        pub const DECnet = 12;
        pub const DLI = 13;
        pub const LAT = 14;
        pub const HYLINK = 15;
        pub const APPLETALK = 16;
        pub const ROUTE = 17;
        pub const LINK = 18;
        pub const XTP = 19;
        pub const COIP = 20;
        pub const CNT = 21;
        pub const RTIP = 22;
        pub const IPX = 23;
        pub const SIP = 24;
        pub const PIP = 25;
        pub const ISDN = 28;
        pub const E164 = ISDN;
        pub const KEY = 29;
        pub const INET6 = 30;
        pub const NATM = 31;
        pub const SYSTEM = 32;
        pub const NETBIOS = 33;
        pub const PPP = 34;
        pub const MAX = 40;
    },
    .freebsd => struct {
        pub const UNSPEC = 0;
        pub const UNIX = 1;
        pub const LOCAL = UNIX;
        pub const FILE = LOCAL;
        pub const INET = 2;
        pub const IMPLINK = 3;
        pub const PUP = 4;
        pub const CHAOS = 5;
        pub const NETBIOS = 6;
        pub const ISO = 7;
        pub const OSI = ISO;
        pub const ECMA = 8;
        pub const DATAKIT = 9;
        pub const CCITT = 10;
        pub const SNA = 11;
        pub const DECnet = 12;
        pub const DLI = 13;
        pub const LAT = 14;
        pub const HYLINK = 15;
        pub const APPLETALK = 16;
        pub const ROUTE = 17;
        pub const LINK = 18;
        pub const pseudo_XTP = 19;
        pub const COIP = 20;
        pub const CNT = 21;
        pub const pseudo_RTIP = 22;
        pub const IPX = 23;
        pub const SIP = 24;
        pub const pseudo_PIP = 25;
        pub const ISDN = 26;
        pub const E164 = ISDN;
        pub const pseudo_KEY = 27;
        pub const INET6 = 28;
        pub const NATM = 29;
        pub const ATM = 30;
        pub const pseudo_HDRCMPLT = 31;
        pub const NETGRAPH = 32;
        pub const SLOW = 33;
        pub const SCLUSTER = 34;
        pub const ARP = 35;
        pub const BLUETOOTH = 36;
        pub const IEEE80211 = 37;
        pub const INET_SDP = 40;
        pub const INET6_SDP = 42;
        pub const MAX = 42;
    },
    .solaris, .illumos => struct {
        pub const UNSPEC = 0;
        pub const UNIX = 1;
        pub const LOCAL = UNIX;
        pub const FILE = UNIX;
        pub const INET = 2;
        pub const IMPLINK = 3;
        pub const PUP = 4;
        pub const CHAOS = 5;
        pub const NS = 6;
        pub const NBS = 7;
        pub const ECMA = 8;
        pub const DATAKIT = 9;
        pub const CCITT = 10;
        pub const SNA = 11;
        pub const DECnet = 12;
        pub const DLI = 13;
        pub const LAT = 14;
        pub const HYLINK = 15;
        pub const APPLETALK = 16;
        pub const NIT = 17;
        pub const @"802" = 18;
        pub const OSI = 19;
        pub const X25 = 20;
        pub const OSINET = 21;
        pub const GOSIP = 22;
        pub const IPX = 23;
        pub const ROUTE = 24;
        pub const LINK = 25;
        pub const INET6 = 26;
        pub const KEY = 27;
        pub const NCA = 28;
        pub const POLICY = 29;
        pub const INET_OFFLOAD = 30;
        pub const TRILL = 31;
        pub const PACKET = 32;
        pub const LX_NETLINK = 33;
        pub const MAX = 33;
    },
    .netbsd => struct {
        pub const UNSPEC = 0;
        pub const LOCAL = 1;
        pub const UNIX = LOCAL;
        pub const INET = 2;
        pub const IMPLINK = 3;
        pub const PUP = 4;
        pub const CHAOS = 5;
        pub const NS = 6;
        pub const ISO = 7;
        pub const OSI = ISO;
        pub const ECMA = 8;
        pub const DATAKIT = 9;
        pub const CCITT = 10;
        pub const SNA = 11;
        pub const DECnet = 12;
        pub const DLI = 13;
        pub const LAT = 14;
        pub const HYLINK = 15;
        pub const APPLETALK = 16;
        pub const OROUTE = 17;
        pub const LINK = 18;
        pub const COIP = 20;
        pub const CNT = 21;
        pub const IPX = 23;
        pub const INET6 = 24;
        pub const ISDN = 26;
        pub const E164 = ISDN;
        pub const NATM = 27;
        pub const ARP = 28;
        pub const BLUETOOTH = 31;
        pub const IEEE80211 = 32;
        pub const MPLS = 33;
        pub const ROUTE = 34;
        pub const CAN = 35;
        pub const ETHER = 36;
        pub const MAX = 37;
    },
    .dragonfly => struct {
        pub const UNSPEC = 0;
        pub const OSI = ISO;
        pub const UNIX = LOCAL;
        pub const LOCAL = 1;
        pub const INET = 2;
        pub const IMPLINK = 3;
        pub const PUP = 4;
        pub const CHAOS = 5;
        pub const NETBIOS = 6;
        pub const ISO = 7;
        pub const ECMA = 8;
        pub const DATAKIT = 9;
        pub const CCITT = 10;
        pub const SNA = 11;
        pub const DLI = 13;
        pub const LAT = 14;
        pub const HYLINK = 15;
        pub const APPLETALK = 16;
        pub const ROUTE = 17;
        pub const LINK = 18;
        pub const COIP = 20;
        pub const CNT = 21;
        pub const IPX = 23;
        pub const SIP = 24;
        pub const ISDN = 26;
        pub const INET6 = 28;
        pub const NATM = 29;
        pub const ATM = 30;
        pub const NETGRAPH = 32;
        pub const BLUETOOTH = 33;
        pub const MPLS = 34;
        pub const MAX = 36;
    },
    .haiku => struct {
        pub const UNSPEC = 0;
        pub const INET = 1;
        pub const APPLETALK = 2;
        pub const ROUTE = 3;
        pub const LINK = 4;
        pub const INET6 = 5;
        pub const DLI = 6;
        pub const IPX = 7;
        pub const NOTIFY = 8;
        pub const LOCAL = 9;
        pub const UNIX = LOCAL;
        pub const BLUETOOTH = 10;
        pub const MAX = 11;
    },
    .openbsd => struct {
        pub const UNSPEC = 0;
        pub const UNIX = 1;
        pub const LOCAL = UNIX;
        pub const INET = 2;
        pub const APPLETALK = 16;
        pub const INET6 = 24;
        pub const KEY = 30;
        pub const ROUTE = 17;
        pub const SNA = 11;
        pub const MPLS = 33;
        pub const BLUETOOTH = 32;
        pub const ISDN = 26;
        pub const MAX = 36;
    },
    else => void,
};
pub const PF = if (builtin.abi.isAndroid()) struct {
    pub const UNSPEC = AF.UNSPEC;
    pub const UNIX = AF.UNIX;
    pub const LOCAL = AF.LOCAL;
    pub const INET = AF.INET;
    pub const AX25 = AF.AX25;
    pub const IPX = AF.IPX;
    pub const APPLETALK = AF.APPLETALK;
    pub const NETROM = AF.NETROM;
    pub const BRIDGE = AF.BRIDGE;
    pub const ATMPVC = AF.ATMPVC;
    pub const X25 = AF.X25;
    pub const PF_INET6 = AF.INET6;
    pub const PF_ROSE = AF.ROSE;
    pub const PF_DECnet = AF.DECnet;
    pub const PF_NETBEUI = AF.NETBEUI;
    pub const PF_SECURITY = AF.SECURITY;
    pub const PF_KEY = AF.KEY;
    pub const PF_NETLINK = AF.NETLINK;
    pub const PF_ROUTE = AF.ROUTE;
    pub const PF_PACKET = AF.PACKET;
    pub const PF_ASH = AF.ASH;
    pub const PF_ECONET = AF.ECONET;
    pub const PF_ATMSVC = AF.ATMSVC;
    pub const PF_RDS = AF.RDS;
    pub const PF_SNA = AF.SNA;
    pub const PF_IRDA = AF.IRDA;
    pub const PF_PPPOX = AF.PPPOX;
    pub const PF_WANPIPE = AF.WANPIPE;
    pub const PF_LLC = AF.LLC;
    pub const PF_CAN = AF.CAN;
    pub const PF_TIPC = AF.TIPC;
    pub const PF_BLUETOOTH = AF.BLUETOOTH;
    pub const PF_IUCV = AF.IUCV;
    pub const PF_RXRPC = AF.RXRPC;
    pub const PF_ISDN = AF.ISDN;
    pub const PF_PHONET = AF.PHONET;
    pub const PF_IEEE802154 = AF.IEEE802154;
    pub const PF_CAIF = AF.CAIF;
    pub const PF_ALG = AF.ALG;
    pub const PF_NFC = AF.NFC;
    pub const PF_VSOCK = AF.VSOCK;
    pub const PF_KCM = AF.KCM;
    pub const PF_QIPCRTR = AF.QIPCRTR;
    pub const PF_MAX = AF.MAX;
} else switch (native_os) {
    .linux, .emscripten => linux.PF,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const LOCAL = AF.LOCAL;
        pub const UNIX = PF.LOCAL;
        pub const INET = AF.INET;
        pub const IMPLINK = AF.IMPLINK;
        pub const PUP = AF.PUP;
        pub const CHAOS = AF.CHAOS;
        pub const NS = AF.NS;
        pub const ISO = AF.ISO;
        pub const OSI = AF.ISO;
        pub const ECMA = AF.ECMA;
        pub const DATAKIT = AF.DATAKIT;
        pub const CCITT = AF.CCITT;
        pub const SNA = AF.SNA;
        pub const DECnet = AF.DECnet;
        pub const DLI = AF.DLI;
        pub const LAT = AF.LAT;
        pub const HYLINK = AF.HYLINK;
        pub const APPLETALK = AF.APPLETALK;
        pub const ROUTE = AF.ROUTE;
        pub const LINK = AF.LINK;
        pub const XTP = AF.XTP;
        pub const COIP = AF.COIP;
        pub const CNT = AF.CNT;
        pub const SIP = AF.SIP;
        pub const IPX = AF.IPX;
        pub const RTIP = AF.RTIP;
        pub const PIP = AF.PIP;
        pub const ISDN = AF.ISDN;
        pub const KEY = AF.KEY;
        pub const INET6 = AF.INET6;
        pub const NATM = AF.NATM;
        pub const SYSTEM = AF.SYSTEM;
        pub const NETBIOS = AF.NETBIOS;
        pub const PPP = AF.PPP;
        pub const MAX = AF.MAX;
    },
    .freebsd => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const LOCAL = AF.LOCAL;
        pub const UNIX = PF.LOCAL;
        pub const INET = AF.INET;
        pub const IMPLINK = AF.IMPLINK;
        pub const PUP = AF.PUP;
        pub const CHAOS = AF.CHAOS;
        pub const NETBIOS = AF.NETBIOS;
        pub const ISO = AF.ISO;
        pub const OSI = AF.ISO;
        pub const ECMA = AF.ECMA;
        pub const DATAKIT = AF.DATAKIT;
        pub const CCITT = AF.CCITT;
        pub const DECnet = AF.DECnet;
        pub const DLI = AF.DLI;
        pub const LAT = AF.LAT;
        pub const HYLINK = AF.HYLINK;
        pub const APPLETALK = AF.APPLETALK;
        pub const ROUTE = AF.ROUTE;
        pub const LINK = AF.LINK;
        pub const XTP = AF.pseudo_XTP;
        pub const COIP = AF.COIP;
        pub const CNT = AF.CNT;
        pub const SIP = AF.SIP;
        pub const IPX = AF.IPX;
        pub const RTIP = AF.pseudo_RTIP;
        pub const PIP = AF.pseudo_PIP;
        pub const ISDN = AF.ISDN;
        pub const KEY = AF.pseudo_KEY;
        pub const INET6 = AF.pseudo_INET6;
        pub const NATM = AF.NATM;
        pub const ATM = AF.ATM;
        pub const NETGRAPH = AF.NETGRAPH;
        pub const SLOW = AF.SLOW;
        pub const SCLUSTER = AF.SCLUSTER;
        pub const ARP = AF.ARP;
        pub const BLUETOOTH = AF.BLUETOOTH;
        pub const IEEE80211 = AF.IEEE80211;
        pub const INET_SDP = AF.INET_SDP;
        pub const INET6_SDP = AF.INET6_SDP;
        pub const MAX = AF.MAX;
    },
    .solaris, .illumos => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const UNIX = AF.UNIX;
        pub const LOCAL = UNIX;
        pub const FILE = UNIX;
        pub const INET = AF.INET;
        pub const IMPLINK = AF.IMPLINK;
        pub const PUP = AF.PUP;
        pub const CHAOS = AF.CHAOS;
        pub const NS = AF.NS;
        pub const NBS = AF.NBS;
        pub const ECMA = AF.ECMA;
        pub const DATAKIT = AF.DATAKIT;
        pub const CCITT = AF.CCITT;
        pub const SNA = AF.SNA;
        pub const DECnet = AF.DECnet;
        pub const DLI = AF.DLI;
        pub const LAT = AF.LAT;
        pub const HYLINK = AF.HYLINK;
        pub const APPLETALK = AF.APPLETALK;
        pub const NIT = AF.NIT;
        pub const @"802" = AF.@"802";
        pub const OSI = AF.OSI;
        pub const X25 = AF.X25;
        pub const OSINET = AF.OSINET;
        pub const GOSIP = AF.GOSIP;
        pub const IPX = AF.IPX;
        pub const ROUTE = AF.ROUTE;
        pub const LINK = AF.LINK;
        pub const INET6 = AF.INET6;
        pub const KEY = AF.KEY;
        pub const NCA = AF.NCA;
        pub const POLICY = AF.POLICY;
        pub const TRILL = AF.TRILL;
        pub const PACKET = AF.PACKET;
        pub const LX_NETLINK = AF.LX_NETLINK;
        pub const MAX = AF.MAX;
    },
    .netbsd => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const LOCAL = AF.LOCAL;
        pub const UNIX = PF.LOCAL;
        pub const INET = AF.INET;
        pub const IMPLINK = AF.IMPLINK;
        pub const PUP = AF.PUP;
        pub const CHAOS = AF.CHAOS;
        pub const NS = AF.NS;
        pub const ISO = AF.ISO;
        pub const OSI = AF.ISO;
        pub const ECMA = AF.ECMA;
        pub const DATAKIT = AF.DATAKIT;
        pub const CCITT = AF.CCITT;
        pub const SNA = AF.SNA;
        pub const DECnet = AF.DECnet;
        pub const DLI = AF.DLI;
        pub const LAT = AF.LAT;
        pub const HYLINK = AF.HYLINK;
        pub const APPLETALK = AF.APPLETALK;
        pub const OROUTE = AF.OROUTE;
        pub const LINK = AF.LINK;
        pub const COIP = AF.COIP;
        pub const CNT = AF.CNT;
        pub const INET6 = AF.INET6;
        pub const IPX = AF.IPX;
        pub const ISDN = AF.ISDN;
        pub const E164 = AF.E164;
        pub const NATM = AF.NATM;
        pub const ARP = AF.ARP;
        pub const BLUETOOTH = AF.BLUETOOTH;
        pub const MPLS = AF.MPLS;
        pub const ROUTE = AF.ROUTE;
        pub const CAN = AF.CAN;
        pub const ETHER = AF.ETHER;
        pub const MAX = AF.MAX;
    },
    .dragonfly => struct {
        pub const INET6 = AF.INET6;
        pub const IMPLINK = AF.IMPLINK;
        pub const ROUTE = AF.ROUTE;
        pub const ISO = AF.ISO;
        pub const PIP = AF.pseudo_PIP;
        pub const CHAOS = AF.CHAOS;
        pub const DATAKIT = AF.DATAKIT;
        pub const INET = AF.INET;
        pub const APPLETALK = AF.APPLETALK;
        pub const SIP = AF.SIP;
        pub const OSI = AF.ISO;
        pub const CNT = AF.CNT;
        pub const LINK = AF.LINK;
        pub const HYLINK = AF.HYLINK;
        pub const MAX = AF.MAX;
        pub const KEY = AF.pseudo_KEY;
        pub const PUP = AF.PUP;
        pub const COIP = AF.COIP;
        pub const SNA = AF.SNA;
        pub const LOCAL = AF.LOCAL;
        pub const NETBIOS = AF.NETBIOS;
        pub const NATM = AF.NATM;
        pub const BLUETOOTH = AF.BLUETOOTH;
        pub const UNSPEC = AF.UNSPEC;
        pub const NETGRAPH = AF.NETGRAPH;
        pub const ECMA = AF.ECMA;
        pub const IPX = AF.IPX;
        pub const DLI = AF.DLI;
        pub const ATM = AF.ATM;
        pub const CCITT = AF.CCITT;
        pub const ISDN = AF.ISDN;
        pub const RTIP = AF.pseudo_RTIP;
        pub const LAT = AF.LAT;
        pub const UNIX = PF.LOCAL;
        pub const XTP = AF.pseudo_XTP;
        pub const DECnet = AF.DECnet;
    },
    .haiku => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const INET = AF.INET;
        pub const ROUTE = AF.ROUTE;
        pub const LINK = AF.LINK;
        pub const INET6 = AF.INET6;
        pub const LOCAL = AF.LOCAL;
        pub const UNIX = AF.UNIX;
        pub const BLUETOOTH = AF.BLUETOOTH;
    },
    .openbsd => struct {
        pub const UNSPEC = AF.UNSPEC;
        pub const LOCAL = AF.LOCAL;
        pub const UNIX = AF.UNIX;
        pub const INET = AF.INET;
        pub const APPLETALK = AF.APPLETALK;
        pub const INET6 = AF.INET6;
        pub const DECnet = AF.DECnet;
        pub const KEY = AF.KEY;
        pub const ROUTE = AF.ROUTE;
        pub const SNA = AF.SNA;
        pub const MPLS = AF.MPLS;
        pub const BLUETOOTH = AF.BLUETOOTH;
        pub const ISDN = AF.ISDN;
        pub const MAX = AF.MAX;
    },
    else => void,
};
pub const DT = switch (native_os) {
    .linux => linux.DT,
    .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const UNKNOWN = 0;
        pub const FIFO = 1;
        pub const CHR = 2;
        pub const DIR = 4;
        pub const BLK = 6;
        pub const REG = 8;
        pub const LNK = 10;
        pub const SOCK = 12;
        pub const WHT = 14;
    },
    .dragonfly => struct {
        pub const UNKNOWN = 0;
        pub const FIFO = 1;
        pub const CHR = 2;
        pub const DIR = 4;
        pub const BLK = 6;
        pub const REG = 8;
        pub const LNK = 10;
        pub const SOCK = 12;
        pub const WHT = 14;
        pub const DBF = 15;
    },
    .openbsd => struct {
        pub const UNKNOWN = 0;
        pub const FIFO = 1;
        pub const CHR = 2;
        pub const DIR = 4;
        pub const BLK = 6;
        pub const REG = 8;
        pub const LNK = 10;
        pub const SOCK = 12;
        pub const WHT = 14; // XXX
    },
    else => void,
};
pub const MSG = switch (native_os) {
    .linux => linux.MSG,
    .emscripten => emscripten.MSG,
    .windows => ws2_32.MSG,
    .haiku => struct {
        pub const OOB = 0x0001;
        pub const PEEK = 0x0002;
        pub const DONTROUTE = 0x0004;
        pub const EOR = 0x0008;
        pub const TRUNC = 0x0010;
        pub const CTRUNC = 0x0020;
        pub const WAITALL = 0x0040;
        pub const DONTWAIT = 0x0080;
        pub const BCAST = 0x0100;
        pub const MCAST = 0x0200;
        pub const EOF = 0x0400;
        pub const NOSIGNAL = 0x0800;
    },
    else => void,
};
pub const SOCK = switch (native_os) {
    .linux => linux.SOCK,
    .emscripten => emscripten.SOCK,
    .windows => ws2_32.SOCK,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const RDM = 4;
        pub const SEQPACKET = 5;
        pub const MAXADDRLEN = 255;

        /// Not actually supported by Darwin, but Zig supplies a shim.
        /// This numerical value is not ABI-stable. It need only not conflict
        /// with any other `SOCK` bits.
        pub const CLOEXEC = 1 << 15;
        /// Not actually supported by Darwin, but Zig supplies a shim.
        /// This numerical value is not ABI-stable. It need only not conflict
        /// with any other `SOCK` bits.
        pub const NONBLOCK = 1 << 16;
    },
    .freebsd => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const RDM = 4;
        pub const SEQPACKET = 5;

        pub const CLOEXEC = 0x10000000;
        pub const NONBLOCK = 0x20000000;
    },
    .solaris, .illumos => struct {
        /// Datagram.
        pub const DGRAM = 1;
        /// STREAM.
        pub const STREAM = 2;
        /// Raw-protocol interface.
        pub const RAW = 4;
        /// Reliably-delivered message.
        pub const RDM = 5;
        /// Sequenced packed stream.
        pub const SEQPACKET = 6;

        pub const NONBLOCK = 0x100000;
        pub const NDELAY = 0x200000;
        pub const CLOEXEC = 0x080000;
    },
    .netbsd => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const RDM = 4;
        pub const SEQPACKET = 5;
        pub const CONN_DGRAM = 6;
        pub const DCCP = CONN_DGRAM;

        pub const CLOEXEC = 0x10000000;
        pub const NONBLOCK = 0x20000000;
        pub const NOSIGPIPE = 0x40000000;
        pub const FLAGS_MASK = 0xf0000000;
    },
    .dragonfly => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const RDM = 4;
        pub const SEQPACKET = 5;
        pub const MAXADDRLEN = 255;
        pub const CLOEXEC = 0x10000000;
        pub const NONBLOCK = 0x20000000;
    },
    .haiku => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const SEQPACKET = 5;
        pub const MISC = 255;
    },
    .openbsd => struct {
        pub const STREAM = 1;
        pub const DGRAM = 2;
        pub const RAW = 3;
        pub const RDM = 4;
        pub const SEQPACKET = 5;

        pub const CLOEXEC = 0x8000;
        pub const NONBLOCK = 0x4000;
    },
    else => void,
};
pub const TCP = switch (native_os) {
    .macos => darwin.TCP,
    .linux => linux.TCP,
    .emscripten => emscripten.TCP,
    .windows => ws2_32.TCP,
    else => void,
};
pub const IPPROTO = switch (native_os) {
    .linux, .emscripten => linux.IPPROTO,
    .windows => ws2_32.IPPROTO,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const ICMP = 1;
        pub const ICMPV6 = 58;
        pub const TCP = 6;
        pub const UDP = 17;
        pub const IP = 0;
        pub const IPV6 = 41;
    },
    .freebsd => struct {
        /// dummy for IP
        pub const IP = 0;
        /// control message protocol
        pub const ICMP = 1;
        /// tcp
        pub const TCP = 6;
        /// user datagram protocol
        pub const UDP = 17;
        /// IP6 header
        pub const IPV6 = 41;
        /// raw IP packet
        pub const RAW = 255;
        /// IP6 hop-by-hop options
        pub const HOPOPTS = 0;
        /// group mgmt protocol
        pub const IGMP = 2;
        /// gateway^2 (deprecated)
        pub const GGP = 3;
        /// IPv4 encapsulation
        pub const IPV4 = 4;
        /// for compatibility
        pub const IPIP = IPV4;
        /// Stream protocol II
        pub const ST = 7;
        /// exterior gateway protocol
        pub const EGP = 8;
        /// private interior gateway
        pub const PIGP = 9;
        /// BBN RCC Monitoring
        pub const RCCMON = 10;
        /// network voice protocol
        pub const NVPII = 11;
        /// pup
        pub const PUP = 12;
        /// Argus
        pub const ARGUS = 13;
        /// EMCON
        pub const EMCON = 14;
        /// Cross Net Debugger
        pub const XNET = 15;
        /// Chaos
        pub const CHAOS = 16;
        /// Multiplexing
        pub const MUX = 18;
        /// DCN Measurement Subsystems
        pub const MEAS = 19;
        /// Host Monitoring
        pub const HMP = 20;
        /// Packet Radio Measurement
        pub const PRM = 21;
        /// xns idp
        pub const IDP = 22;
        /// Trunk-1
        pub const TRUNK1 = 23;
        /// Trunk-2
        pub const TRUNK2 = 24;
        /// Leaf-1
        pub const LEAF1 = 25;
        /// Leaf-2
        pub const LEAF2 = 26;
        /// Reliable Data
        pub const RDP = 27;
        /// Reliable Transaction
        pub const IRTP = 28;
        /// tp-4 w/ class negotiation
        pub const TP = 29;
        /// Bulk Data Transfer
        pub const BLT = 30;
        /// Network Services
        pub const NSP = 31;
        /// Merit Internodal
        pub const INP = 32;
        /// Datagram Congestion Control Protocol
        pub const DCCP = 33;
        /// Third Party Connect
        pub const @"3PC" = 34;
        /// InterDomain Policy Routing
        pub const IDPR = 35;
        /// XTP
        pub const XTP = 36;
        /// Datagram Delivery
        pub const DDP = 37;
        /// Control Message Transport
        pub const CMTP = 38;
        /// TP++ Transport
        pub const TPXX = 39;
        /// IL transport protocol
        pub const IL = 40;
        /// Source Demand Routing
        pub const SDRP = 42;
        /// IP6 routing header
        pub const ROUTING = 43;
        /// IP6 fragmentation header
        pub const FRAGMENT = 44;
        /// InterDomain Routing
        pub const IDRP = 45;
        /// resource reservation
        pub const RSVP = 46;
        /// General Routing Encap.
        pub const GRE = 47;
        /// Mobile Host Routing
        pub const MHRP = 48;
        /// BHA
        pub const BHA = 49;
        /// IP6 Encap Sec. Payload
        pub const ESP = 50;
        /// IP6 Auth Header
        pub const AH = 51;
        /// Integ. Net Layer Security
        pub const INLSP = 52;
        /// IP with encryption
        pub const SWIPE = 53;
        /// Next Hop Resolution
        pub const NHRP = 54;
        /// IP Mobility
        pub const MOBILE = 55;
        /// Transport Layer Security
        pub const TLSP = 56;
        /// SKIP
        pub const SKIP = 57;
        /// ICMP6
        pub const ICMPV6 = 58;
        /// IP6 no next header
        pub const NONE = 59;
        /// IP6 destination option
        pub const DSTOPTS = 60;
        /// any host internal protocol
        pub const AHIP = 61;
        /// CFTP
        pub const CFTP = 62;
        /// "hello" routing protocol
        pub const HELLO = 63;
        /// SATNET/Backroom EXPAK
        pub const SATEXPAK = 64;
        /// Kryptolan
        pub const KRYPTOLAN = 65;
        /// Remote Virtual Disk
        pub const RVD = 66;
        /// Pluribus Packet Core
        pub const IPPC = 67;
        /// Any distributed FS
        pub const ADFS = 68;
        /// Satnet Monitoring
        pub const SATMON = 69;
        /// VISA Protocol
        pub const VISA = 70;
        /// Packet Core Utility
        pub const IPCV = 71;
        /// Comp. Prot. Net. Executive
        pub const CPNX = 72;
        /// Comp. Prot. HeartBeat
        pub const CPHB = 73;
        /// Wang Span Network
        pub const WSN = 74;
        /// Packet Video Protocol
        pub const PVP = 75;
        /// BackRoom SATNET Monitoring
        pub const BRSATMON = 76;
        /// Sun net disk proto (temp.)
        pub const ND = 77;
        /// WIDEBAND Monitoring
        pub const WBMON = 78;
        /// WIDEBAND EXPAK
        pub const WBEXPAK = 79;
        /// ISO cnlp
        pub const EON = 80;
        /// VMTP
        pub const VMTP = 81;
        /// Secure VMTP
        pub const SVMTP = 82;
        /// Banyon VINES
        pub const VINES = 83;
        /// TTP
        pub const TTP = 84;
        /// NSFNET-IGP
        pub const IGP = 85;
        /// dissimilar gateway prot.
        pub const DGP = 86;
        /// TCF
        pub const TCF = 87;
        /// Cisco/GXS IGRP
        pub const IGRP = 88;
        /// OSPFIGP
        pub const OSPFIGP = 89;
        /// Strite RPC protocol
        pub const SRPC = 90;
        /// Locus Address Resoloution
        pub const LARP = 91;
        /// Multicast Transport
        pub const MTP = 92;
        /// AX.25 Frames
        pub const AX25 = 93;
        /// IP encapsulated in IP
        pub const IPEIP = 94;
        /// Mobile Int.ing control
        pub const MICP = 95;
        /// Semaphore Comm. security
        pub const SCCSP = 96;
        /// Ethernet IP encapsulation
        pub const ETHERIP = 97;
        /// encapsulation header
        pub const ENCAP = 98;
        /// any private encr. scheme
        pub const APES = 99;
        /// GMTP
        pub const GMTP = 100;
        /// payload compression (IPComp)
        pub const IPCOMP = 108;
        /// SCTP
        pub const SCTP = 132;
        /// IPv6 Mobility Header
        pub const MH = 135;
        /// UDP-Lite
        pub const UDPLITE = 136;
        /// IP6 Host Identity Protocol
        pub const HIP = 139;
        /// IP6 Shim6 Protocol
        pub const SHIM6 = 140;
        /// Protocol Independent Mcast
        pub const PIM = 103;
        /// CARP
        pub const CARP = 112;
        /// PGM
        pub const PGM = 113;
        /// MPLS-in-IP
        pub const MPLS = 137;
        /// PFSYNC
        pub const PFSYNC = 240;
        /// Reserved
        pub const RESERVED_253 = 253;
        /// Reserved
        pub const RESERVED_254 = 254;
    },
    .solaris, .illumos => struct {
        /// dummy for IP
        pub const IP = 0;
        /// Hop by hop header for IPv6
        pub const HOPOPTS = 0;
        /// control message protocol
        pub const ICMP = 1;
        /// group control protocol
        pub const IGMP = 2;
        /// gateway^2 (deprecated)
        pub const GGP = 3;
        /// IP in IP encapsulation
        pub const ENCAP = 4;
        /// tcp
        pub const TCP = 6;
        /// exterior gateway protocol
        pub const EGP = 8;
        /// pup
        pub const PUP = 12;
        /// user datagram protocol
        pub const UDP = 17;
        /// xns idp
        pub const IDP = 22;
        /// IPv6 encapsulated in IP
        pub const IPV6 = 41;
        /// Routing header for IPv6
        pub const ROUTING = 43;
        /// Fragment header for IPv6
        pub const FRAGMENT = 44;
        /// rsvp
        pub const RSVP = 46;
        /// IPsec Encap. Sec. Payload
        pub const ESP = 50;
        /// IPsec Authentication Hdr.
        pub const AH = 51;
        /// ICMP for IPv6
        pub const ICMPV6 = 58;
        /// No next header for IPv6
        pub const NONE = 59;
        /// Destination options
        pub const DSTOPTS = 60;
        /// "hello" routing protocol
        pub const HELLO = 63;
        /// UNOFFICIAL net disk proto
        pub const ND = 77;
        /// ISO clnp
        pub const EON = 80;
        /// OSPF
        pub const OSPF = 89;
        /// PIM routing protocol
        pub const PIM = 103;
        /// Stream Control
        pub const SCTP = 132;
        /// raw IP packet
        pub const RAW = 255;
        /// Sockets Direct Protocol
        pub const PROTO_SDP = 257;
    },
    .netbsd => struct {
        /// dummy for IP
        pub const IP = 0;
        /// IP6 hop-by-hop options
        pub const HOPOPTS = 0;
        /// control message protocol
        pub const ICMP = 1;
        /// group mgmt protocol
        pub const IGMP = 2;
        /// gateway^2 (deprecated)
        pub const GGP = 3;
        /// IP header
        pub const IPV4 = 4;
        /// IP inside IP
        pub const IPIP = 4;
        /// tcp
        pub const TCP = 6;
        /// exterior gateway protocol
        pub const EGP = 8;
        /// pup
        pub const PUP = 12;
        /// user datagram protocol
        pub const UDP = 17;
        /// xns idp
        pub const IDP = 22;
        /// tp-4 w/ class negotiation
        pub const TP = 29;
        /// DCCP
        pub const DCCP = 33;
        /// IP6 header
        pub const IPV6 = 41;
        /// IP6 routing header
        pub const ROUTING = 43;
        /// IP6 fragmentation header
        pub const FRAGMENT = 44;
        /// resource reservation
        pub const RSVP = 46;
        /// GRE encaps RFC 1701
        pub const GRE = 47;
        /// encap. security payload
        pub const ESP = 50;
        /// authentication header
        pub const AH = 51;
        /// IP Mobility RFC 2004
        pub const MOBILE = 55;
        /// IPv6 ICMP
        pub const IPV6_ICMP = 58;
        /// ICMP6
        pub const ICMPV6 = 58;
        /// IP6 no next header
        pub const NONE = 59;
        /// IP6 destination option
        pub const DSTOPTS = 60;
        /// ISO cnlp
        pub const EON = 80;
        /// Ethernet-in-IP
        pub const ETHERIP = 97;
        /// encapsulation header
        pub const ENCAP = 98;
        /// Protocol indep. multicast
        pub const PIM = 103;
        /// IP Payload Comp. Protocol
        pub const IPCOMP = 108;
        /// VRRP RFC 2338
        pub const VRRP = 112;
        /// Common Address Resolution Protocol
        pub const CARP = 112;
        /// L2TPv3
        pub const L2TP = 115;
        /// SCTP
        pub const SCTP = 132;
        /// PFSYNC
        pub const PFSYNC = 240;
        /// raw IP packet
        pub const RAW = 255;
    },
    .dragonfly => struct {
        pub const IP = 0;
        pub const ICMP = 1;
        pub const TCP = 6;
        pub const UDP = 17;
        pub const IPV6 = 41;
        pub const RAW = 255;
        pub const HOPOPTS = 0;
        pub const IGMP = 2;
        pub const GGP = 3;
        pub const IPV4 = 4;
        pub const IPIP = IPV4;
        pub const ST = 7;
        pub const EGP = 8;
        pub const PIGP = 9;
        pub const RCCMON = 10;
        pub const NVPII = 11;
        pub const PUP = 12;
        pub const ARGUS = 13;
        pub const EMCON = 14;
        pub const XNET = 15;
        pub const CHAOS = 16;
        pub const MUX = 18;
        pub const MEAS = 19;
        pub const HMP = 20;
        pub const PRM = 21;
        pub const IDP = 22;
        pub const TRUNK1 = 23;
        pub const TRUNK2 = 24;
        pub const LEAF1 = 25;
        pub const LEAF2 = 26;
        pub const RDP = 27;
        pub const IRTP = 28;
        pub const TP = 29;
        pub const BLT = 30;
        pub const NSP = 31;
        pub const INP = 32;
        pub const SEP = 33;
        pub const @"3PC" = 34;
        pub const IDPR = 35;
        pub const XTP = 36;
        pub const DDP = 37;
        pub const CMTP = 38;
        pub const TPXX = 39;
        pub const IL = 40;
        pub const SDRP = 42;
        pub const ROUTING = 43;
        pub const FRAGMENT = 44;
        pub const IDRP = 45;
        pub const RSVP = 46;
        pub const GRE = 47;
        pub const MHRP = 48;
        pub const BHA = 49;
        pub const ESP = 50;
        pub const AH = 51;
        pub const INLSP = 52;
        pub const SWIPE = 53;
        pub const NHRP = 54;
        pub const MOBILE = 55;
        pub const TLSP = 56;
        pub const SKIP = 57;
        pub const ICMPV6 = 58;
        pub const NONE = 59;
        pub const DSTOPTS = 60;
        pub const AHIP = 61;
        pub const CFTP = 62;
        pub const HELLO = 63;
        pub const SATEXPAK = 64;
        pub const KRYPTOLAN = 65;
        pub const RVD = 66;
        pub const IPPC = 67;
        pub const ADFS = 68;
        pub const SATMON = 69;
        pub const VISA = 70;
        pub const IPCV = 71;
        pub const CPNX = 72;
        pub const CPHB = 73;
        pub const WSN = 74;
        pub const PVP = 75;
        pub const BRSATMON = 76;
        pub const ND = 77;
        pub const WBMON = 78;
        pub const WBEXPAK = 79;
        pub const EON = 80;
        pub const VMTP = 81;
        pub const SVMTP = 82;
        pub const VINES = 83;
        pub const TTP = 84;
        pub const IGP = 85;
        pub const DGP = 86;
        pub const TCF = 87;
        pub const IGRP = 88;
        pub const OSPFIGP = 89;
        pub const SRPC = 90;
        pub const LARP = 91;
        pub const MTP = 92;
        pub const AX25 = 93;
        pub const IPEIP = 94;
        pub const MICP = 95;
        pub const SCCSP = 96;
        pub const ETHERIP = 97;
        pub const ENCAP = 98;
        pub const APES = 99;
        pub const GMTP = 100;
        pub const IPCOMP = 108;
        pub const PIM = 103;
        pub const CARP = 112;
        pub const PGM = 113;
        pub const PFSYNC = 240;
        pub const DIVERT = 254;
        pub const MAX = 256;
        pub const DONE = 257;
        pub const UNKNOWN = 258;
    },
    .haiku => struct {
        pub const IP = 0;
        pub const HOPOPTS = 0;
        pub const ICMP = 1;
        pub const IGMP = 2;
        pub const TCP = 6;
        pub const UDP = 17;
        pub const IPV6 = 41;
        pub const ROUTING = 43;
        pub const FRAGMENT = 44;
        pub const ESP = 50;
        pub const AH = 51;
        pub const ICMPV6 = 58;
        pub const NONE = 59;
        pub const DSTOPTS = 60;
        pub const ETHERIP = 97;
        pub const RAW = 255;
        pub const MAX = 256;
    },
    .openbsd => struct {
        /// dummy for IP
        pub const IP = 0;
        /// IP6 hop-by-hop options
        pub const HOPOPTS = IP;
        /// control message protocol
        pub const ICMP = 1;
        /// group mgmt protocol
        pub const IGMP = 2;
        /// gateway^2 (deprecated)
        pub const GGP = 3;
        /// IP header
        pub const IPV4 = IPIP;
        /// IP inside IP
        pub const IPIP = 4;
        /// tcp
        pub const TCP = 6;
        /// exterior gateway protocol
        pub const EGP = 8;
        /// pup
        pub const PUP = 12;
        /// user datagram protocol
        pub const UDP = 17;
        /// xns idp
        pub const IDP = 22;
        /// tp-4 w/ class negotiation
        pub const TP = 29;
        /// IP6 header
        pub const IPV6 = 41;
        /// IP6 routing header
        pub const ROUTING = 43;
        /// IP6 fragmentation header
        pub const FRAGMENT = 44;
        /// resource reservation
        pub const RSVP = 46;
        /// GRE encaps RFC 1701
        pub const GRE = 47;
        /// encap. security payload
        pub const ESP = 50;
        /// authentication header
        pub const AH = 51;
        /// IP Mobility RFC 2004
        pub const MOBILE = 55;
        /// IPv6 ICMP
        pub const IPV6_ICMP = 58;
        /// ICMP6
        pub const ICMPV6 = 58;
        /// IP6 no next header
        pub const NONE = 59;
        /// IP6 destination option
        pub const DSTOPTS = 60;
        /// ISO cnlp
        pub const EON = 80;
        /// Ethernet-in-IP
        pub const ETHERIP = 97;
        /// encapsulation header
        pub const ENCAP = 98;
        /// Protocol indep. multicast
        pub const PIM = 103;
        /// IP Payload Comp. Protocol
        pub const IPCOMP = 108;
        /// VRRP RFC 2338
        pub const VRRP = 112;
        /// Common Address Resolution Protocol
        pub const CARP = 112;
        /// PFSYNC
        pub const PFSYNC = 240;
        /// raw IP packet
        pub const RAW = 255;
    },
    else => void,
};
pub const SOL = switch (native_os) {
    .linux => linux.SOL,
    .emscripten => emscripten.SOL,
    .windows => ws2_32.SOL,
    .openbsd, .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const SOCKET = 0xffff;
    },
    .solaris, .illumos => struct {
        pub const SOCKET = 0xffff;
        pub const ROUTE = 0xfffe;
        pub const PACKET = 0xfffd;
        pub const FILTER = 0xfffc;
    },
    else => void,
};
pub const SO = switch (native_os) {
    .linux => linux.SO,
    .emscripten => emscripten.SO,
    .windows => ws2_32.SO,
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const DEBUG = 0x0001;
        pub const ACCEPTCONN = 0x0002;
        pub const REUSEADDR = 0x0004;
        pub const KEEPALIVE = 0x0008;
        pub const DONTROUTE = 0x0010;
        pub const BROADCAST = 0x0020;
        pub const USELOOPBACK = 0x0040;
        pub const LINGER = 0x1080;
        pub const OOBINLINE = 0x0100;
        pub const REUSEPORT = 0x0200;
        pub const ACCEPTFILTER = 0x1000;
        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const SNDTIMEO = 0x1005;
        pub const RCVTIMEO = 0x1006;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;

        pub const NREAD = 0x1020;
        pub const NKE = 0x1021;
        pub const NOSIGPIPE = 0x1022;
        pub const NOADDRERR = 0x1023;
        pub const NWRITE = 0x1024;
        pub const REUSESHAREUID = 0x1025;
    },
    .freebsd => struct {
        pub const DEBUG = 0x00000001;
        pub const ACCEPTCONN = 0x00000002;
        pub const REUSEADDR = 0x00000004;
        pub const KEEPALIVE = 0x00000008;
        pub const DONTROUTE = 0x00000010;
        pub const BROADCAST = 0x00000020;
        pub const USELOOPBACK = 0x00000040;
        pub const LINGER = 0x00000080;
        pub const OOBINLINE = 0x00000100;
        pub const REUSEPORT = 0x00000200;
        pub const TIMESTAMP = 0x00000400;
        pub const NOSIGPIPE = 0x00000800;
        pub const ACCEPTFILTER = 0x00001000;
        pub const BINTIME = 0x00002000;
        pub const NO_OFFLOAD = 0x00004000;
        pub const NO_DDP = 0x00008000;
        pub const REUSEPORT_LB = 0x00010000;

        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const SNDTIMEO = 0x1005;
        pub const RCVTIMEO = 0x1006;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;
        pub const LABEL = 0x1009;
        pub const PEERLABEL = 0x1010;
        pub const LISTENQLIMIT = 0x1011;
        pub const LISTENQLEN = 0x1012;
        pub const LISTENINCQLEN = 0x1013;
        pub const SETFIB = 0x1014;
        pub const USER_COOKIE = 0x1015;
        pub const PROTOCOL = 0x1016;
        pub const PROTOTYPE = PROTOCOL;
        pub const TS_CLOCK = 0x1017;
        pub const MAX_PACING_RATE = 0x1018;
        pub const DOMAIN = 0x1019;
    },
    .solaris, .illumos => struct {
        pub const DEBUG = 0x0001;
        pub const ACCEPTCONN = 0x0002;
        pub const REUSEADDR = 0x0004;
        pub const KEEPALIVE = 0x0008;
        pub const DONTROUTE = 0x0010;
        pub const BROADCAST = 0x0020;
        pub const USELOOPBACK = 0x0040;
        pub const LINGER = 0x0080;
        pub const OOBINLINE = 0x0100;
        pub const DGRAM_ERRIND = 0x0200;
        pub const RECVUCRED = 0x0400;

        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const SNDTIMEO = 0x1005;
        pub const RCVTIMEO = 0x1006;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;
        pub const PROTOTYPE = 0x1009;
        pub const ANON_MLP = 0x100a;
        pub const MAC_EXEMPT = 0x100b;
        pub const DOMAIN = 0x100c;
        pub const RCVPSH = 0x100d;

        pub const SECATTR = 0x1011;
        pub const TIMESTAMP = 0x1013;
        pub const ALLZONES = 0x1014;
        pub const EXCLBIND = 0x1015;
        pub const MAC_IMPLICIT = 0x1016;
        pub const VRRP = 0x1017;
    },
    .netbsd => struct {
        pub const DEBUG = 0x0001;
        pub const ACCEPTCONN = 0x0002;
        pub const REUSEADDR = 0x0004;
        pub const KEEPALIVE = 0x0008;
        pub const DONTROUTE = 0x0010;
        pub const BROADCAST = 0x0020;
        pub const USELOOPBACK = 0x0040;
        pub const LINGER = 0x0080;
        pub const OOBINLINE = 0x0100;
        pub const REUSEPORT = 0x0200;
        pub const NOSIGPIPE = 0x0800;
        pub const ACCEPTFILTER = 0x1000;
        pub const TIMESTAMP = 0x2000;
        pub const RERROR = 0x4000;

        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;
        pub const OVERFLOWED = 0x1009;

        pub const NOHEADER = 0x100a;
        pub const SNDTIMEO = 0x100b;
        pub const RCVTIMEO = 0x100c;
    },
    .dragonfly => struct {
        pub const DEBUG = 0x0001;
        pub const ACCEPTCONN = 0x0002;
        pub const REUSEADDR = 0x0004;
        pub const KEEPALIVE = 0x0008;
        pub const DONTROUTE = 0x0010;
        pub const BROADCAST = 0x0020;
        pub const USELOOPBACK = 0x0040;
        pub const LINGER = 0x0080;
        pub const OOBINLINE = 0x0100;
        pub const REUSEPORT = 0x0200;
        pub const TIMESTAMP = 0x0400;
        pub const NOSIGPIPE = 0x0800;
        pub const ACCEPTFILTER = 0x1000;
        pub const RERROR = 0x2000;
        pub const PASSCRED = 0x4000;

        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const SNDTIMEO = 0x1005;
        pub const RCVTIMEO = 0x1006;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;
        pub const SNDSPACE = 0x100a;
        pub const CPUHINT = 0x1030;
    },
    .haiku => struct {
        pub const ACCEPTCONN = 0x00000001;
        pub const BROADCAST = 0x00000002;
        pub const DEBUG = 0x00000004;
        pub const DONTROUTE = 0x00000008;
        pub const KEEPALIVE = 0x00000010;
        pub const OOBINLINE = 0x00000020;
        pub const REUSEADDR = 0x00000040;
        pub const REUSEPORT = 0x00000080;
        pub const USELOOPBACK = 0x00000100;
        pub const LINGER = 0x00000200;

        pub const SNDBUF = 0x40000001;
        pub const SNDLOWAT = 0x40000002;
        pub const SNDTIMEO = 0x40000003;
        pub const RCVBUF = 0x40000004;
        pub const RCVLOWAT = 0x40000005;
        pub const RCVTIMEO = 0x40000006;
        pub const ERROR = 0x40000007;
        pub const TYPE = 0x40000008;
        pub const NONBLOCK = 0x40000009;
        pub const BINDTODEVICE = 0x4000000a;
        pub const PEERCRED = 0x4000000b;
    },
    .openbsd => struct {
        pub const DEBUG = 0x0001;
        pub const ACCEPTCONN = 0x0002;
        pub const REUSEADDR = 0x0004;
        pub const KEEPALIVE = 0x0008;
        pub const DONTROUTE = 0x0010;
        pub const BROADCAST = 0x0020;
        pub const USELOOPBACK = 0x0040;
        pub const LINGER = 0x0080;
        pub const OOBINLINE = 0x0100;
        pub const REUSEPORT = 0x0200;
        pub const TIMESTAMP = 0x0800;
        pub const BINDANY = 0x1000;
        pub const ZEROIZE = 0x2000;
        pub const SNDBUF = 0x1001;
        pub const RCVBUF = 0x1002;
        pub const SNDLOWAT = 0x1003;
        pub const RCVLOWAT = 0x1004;
        pub const SNDTIMEO = 0x1005;
        pub const RCVTIMEO = 0x1006;
        pub const ERROR = 0x1007;
        pub const TYPE = 0x1008;
        pub const NETPROC = 0x1020;
        pub const RTABLE = 0x1021;
        pub const PEERCRED = 0x1022;
        pub const SPLICE = 0x1023;
        pub const DOMAIN = 0x1024;
        pub const PROTOCOL = 0x1025;
    },
    else => void,
};
pub const SOMAXCONN = switch (native_os) {
    .linux => linux.SOMAXCONN,
    .windows => ws2_32.SOMAXCONN,
    .solaris, .illumos => 128,
    .openbsd => 28,
    else => void,
};
pub const IFNAMESIZE = switch (native_os) {
    .linux => linux.IFNAMESIZE,
    .emscripten => emscripten.IFNAMESIZE,
    .windows => 30,
    .openbsd, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => 16,
    .solaris, .illumos => 32,
    else => void,
};

pub const stack_t = switch (native_os) {
    .linux => linux.stack_t,
    .emscripten => emscripten.stack_t,
    .freebsd, .openbsd => extern struct {
        /// Signal stack base.
        sp: *anyopaque,
        /// Signal stack length.
        size: usize,
        /// SS_DISABLE and/or SS_ONSTACK.
        flags: i32,
    },
    else => extern struct {
        sp: [*]u8,
        size: isize,
        flags: i32,
    },
};
pub const time_t = switch (native_os) {
    .linux => linux.time_t,
    .emscripten => emscripten.time_t,
    .haiku, .dragonfly => isize,
    else => i64,
};
pub const suseconds_t = switch (native_os) {
    .solaris, .illumos => i64,
    .freebsd, .dragonfly => c_long,
    .netbsd => c_int,
    .haiku => i32,
    else => void,
};

pub const timeval = switch (native_os) {
    .linux => linux.timeval,
    .emscripten => emscripten.timeval,
    .windows => extern struct {
        sec: c_long,
        usec: c_long,
    },
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        sec: c_long,
        usec: i32,
    },
    .dragonfly, .netbsd, .freebsd, .solaris, .illumos => extern struct {
        /// seconds
        sec: time_t,
        /// microseconds
        usec: suseconds_t,
    },
    .openbsd => extern struct {
        sec: time_t,
        usec: c_long,
    },
    else => void,
};
pub const timezone = switch (native_os) {
    .linux => linux.timezone,
    .emscripten => emscripten.timezone,
    .openbsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        minuteswest: i32,
        dsttime: i32,
    },
    else => void,
};

pub const ucontext_t = switch (native_os) {
    .linux => linux.ucontext_t,
    .emscripten => emscripten.ucontext_t,
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        onstack: c_int,
        sigmask: sigset_t,
        stack: stack_t,
        link: ?*ucontext_t,
        mcsize: u64,
        mcontext: *mcontext_t,
        __mcontext_data: mcontext_t,
    },
    .freebsd => extern struct {
        sigmask: sigset_t,
        mcontext: mcontext_t,
        link: ?*ucontext_t,
        stack: stack_t,
        flags: c_int,
        __spare__: [4]c_int,
    },
    .solaris, .illumos => extern struct {
        flags: u64,
        link: ?*ucontext_t,
        sigmask: sigset_t,
        stack: stack_t,
        mcontext: mcontext_t,
        brand_data: [3]?*anyopaque,
        filler: [2]i64,
    },
    .netbsd => extern struct {
        flags: u32,
        link: ?*ucontext_t,
        sigmask: sigset_t,
        stack: stack_t,
        mcontext: mcontext_t,
        __pad: [
            switch (builtin.cpu.arch) {
                .x86 => 4,
                .mips, .mipsel, .mips64, .mips64el => 14,
                .arm, .armeb, .thumb, .thumbeb => 1,
                .sparc, .sparc64 => if (@sizeOf(usize) == 4) 43 else 8,
                else => 0,
            }
        ]u32,
    },
    .dragonfly => extern struct {
        sigmask: sigset_t,
        mcontext: mcontext_t,
        link: ?*ucontext_t,
        stack: stack_t,
        cofunc: ?*fn (?*ucontext_t, ?*anyopaque) void,
        arg: ?*void,
        _spare: [4]c_int,
    },
    .haiku => extern struct {
        link: ?*ucontext_t,
        sigmask: sigset_t,
        stack: stack_t,
        mcontext: mcontext_t,
    },
    .openbsd => openbsd.ucontext_t,
    else => void,
};
pub const mcontext_t = switch (native_os) {
    .linux => linux.mcontext_t,
    .emscripten => emscripten.mcontext_t,
    .macos, .ios, .tvos, .watchos, .visionos => darwin.mcontext_t,
    .freebsd => switch (builtin.cpu.arch) {
        .x86_64 => extern struct {
            onstack: u64,
            rdi: u64,
            rsi: u64,
            rdx: u64,
            rcx: u64,
            r8: u64,
            r9: u64,
            rax: u64,
            rbx: u64,
            rbp: u64,
            r10: u64,
            r11: u64,
            r12: u64,
            r13: u64,
            r14: u64,
            r15: u64,
            trapno: u32,
            fs: u16,
            gs: u16,
            addr: u64,
            flags: u32,
            es: u16,
            ds: u16,
            err: u64,
            rip: u64,
            cs: u64,
            rflags: u64,
            rsp: u64,
            ss: u64,
            len: u64,
            fpformat: u64,
            ownedfp: u64,
            fpstate: [64]u64 align(16),
            fsbase: u64,
            gsbase: u64,
            xfpustate: u64,
            xfpustate_len: u64,
            spare: [4]u64,
        },
        .aarch64 => extern struct {
            gpregs: extern struct {
                x: [30]u64,
                lr: u64,
                sp: u64,
                elr: u64,
                spsr: u32,
                _pad: u32,
            },
            fpregs: extern struct {
                q: [32]u128,
                sr: u32,
                cr: u32,
                flags: u32,
                _pad: u32,
            },
            flags: u32,
            _pad: u32,
            _spare: [8]u64,
        },
        else => struct {},
    },
    .solaris, .illumos => extern struct {
        gregs: [28]u64,
        fpregs: solaris.fpregset_t,
    },
    .netbsd => switch (builtin.cpu.arch) {
        .aarch64 => extern struct {
            gregs: [35]u64,
            fregs: [528]u8 align(16),
            spare: [8]u64,
        },
        .x86_64 => extern struct {
            gregs: [26]u64,
            mc_tlsbase: u64,
            fpregs: [512]u8 align(8),
        },
        else => struct {},
    },
    .dragonfly => dragonfly.mcontext_t,
    .haiku => haiku.mcontext_t,
    else => void,
};

pub const user_desc = switch (native_os) {
    .linux => linux.user_desc,
    else => void,
};
pub const utsname = switch (native_os) {
    .linux => linux.utsname,
    .emscripten => emscripten.utsname,
    .solaris, .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,
    },
    .macos => extern struct {
        sysname: [256:0]u8,
        nodename: [256:0]u8,
        release: [256:0]u8,
        version: [256:0]u8,
        machine: [256:0]u8,
    },
    else => void,
};
pub const PR = switch (native_os) {
    .linux => linux.PR,
    else => void,
};
pub const _errno = switch (native_os) {
    .linux => switch (native_abi) {
        .android, .androideabi => private.__errno,
        else => private.__errno_location,
    },
    .emscripten => private.__errno_location,
    .wasi, .dragonfly => private.errnoFromThreadLocal,
    .windows => private._errno,
    .macos, .ios, .tvos, .watchos, .visionos, .freebsd => private.__error,
    .solaris, .illumos => private.___errno,
    .openbsd, .netbsd => private.__errno,
    .haiku => haiku._errnop,
    else => {},
};

pub const RTLD = switch (native_os) {
    .linux, .emscripten => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        NOLOAD: bool = false,
        _3: u5 = 0,
        GLOBAL: bool = false,
        _9: u3 = 0,
        NODELETE: bool = false,
        _: u19 = 0,
    },
    .dragonfly, .freebsd => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        _2: u6 = 0,
        GLOBAL: bool = false,
        TRACE: bool = false,
        _10: u2 = 0,
        NODELETE: bool = false,
        NOLOAD: bool = false,
        _: u18 = 0,
    },
    .haiku => packed struct(u32) {
        NOW: bool = false,
        GLOBAL: bool = false,
        _: u30 = 0,
    },
    .netbsd => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        _2: u6 = 0,
        GLOBAL: bool = false,
        LOCAL: bool = false,
        _10: u2 = 0,
        NODELETE: bool = false,
        NOLOAD: bool = false,
        _: u18 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        NOLOAD: bool = false,
        _3: u5 = 0,
        GLOBAL: bool = false,
        PARENT: bool = false,
        GROUP: bool = false,
        WORLD: bool = false,
        NODELETE: bool = false,
        FIRST: bool = false,
        _14: u2 = 0,
        CONFGEN: bool = false,
        _: u15 = 0,
    },
    .openbsd => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        _2: u6 = 0,
        GLOBAL: bool = false,
        TRACE: bool = false,
        _: u22 = 0,
    },
    .macos, .ios, .tvos, .watchos, .visionos => packed struct(u32) {
        LAZY: bool = false,
        NOW: bool = false,
        LOCAL: bool = false,
        GLOBAL: bool = false,
        NOLOAD: bool = false,
        _5: u2 = 0,
        NODELETE: bool = false,
        FIRST: bool = false,
        _: u23 = 0,
    },
    else => void,
};

pub const dirent = switch (native_os) {
    .linux, .emscripten => extern struct {
        ino: c_uint,
        off: c_uint,
        reclen: c_ushort,
        type: u8,
        name: [256]u8,
    },
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        ino: u64,
        seekoff: u64,
        reclen: u16,
        namlen: u16,
        type: u8,
        name: [1024]u8,
    },
    .freebsd => extern struct {
        /// File number of entry.
        fileno: ino_t,
        /// Directory offset of entry.
        off: off_t,
        /// Length of this record.
        reclen: u16,
        /// File type, one of DT_.
        type: u8,
        pad0: u8 = 0,
        /// Length of the name member.
        namlen: u16,
        pad1: u16 = 0,
        /// Name of entry.
        name: [255:0]u8,
    },
    .solaris, .illumos => extern struct {
        /// Inode number of entry.
        ino: ino_t,
        /// Offset of this entry on disk.
        off: off_t,
        /// Length of this record.
        reclen: u16,
        /// File name.
        name: [MAXNAMLEN:0]u8,
    },
    .netbsd => extern struct {
        fileno: ino_t,
        reclen: u16,
        namlen: u16,
        type: u8,
        name: [MAXNAMLEN:0]u8,
    },
    .dragonfly => extern struct {
        fileno: c_ulong,
        namlen: u16,
        type: u8,
        unused1: u8,
        unused2: u32,
        name: [256]u8,

        pub fn reclen(self: dirent) u16 {
            return (@offsetOf(dirent, "name") + self.namlen + 1 + 7) & ~@as(u16, 7);
        }
    },
    .openbsd => extern struct {
        fileno: ino_t,
        off: off_t,
        reclen: u16,
        type: u8,
        namlen: u8,
        _: u32 align(1) = 0,
        name: [MAXNAMLEN:0]u8,
    },
    else => void,
};
pub const MAXNAMLEN = switch (native_os) {
    .netbsd, .solaris, .illumos => 511,
    .haiku => NAME_MAX,
    .openbsd => 255,
    else => {},
};
pub const dirent64 = switch (native_os) {
    .linux => extern struct {
        ino: c_ulong,
        off: c_ulong,
        reclen: c_ushort,
        type: u8,
        name: [256]u8,
    },
    else => void,
};

pub const AI = if (builtin.abi.isAndroid()) packed struct(u32) {
    PASSIVE: bool = false,
    CANONNAME: bool = false,
    NUMERICHOST: bool = false,
    NUMERICSERV: bool = false,
    _4: u4 = 0,
    ALL: bool = false,
    V4MAPPED_CFG: bool = false,
    ADDRCONFIG: bool = false,
    V4MAPPED: bool = false,
    _: u20 = 0,
} else switch (native_os) {
    .linux, .emscripten => linux.AI,
    .dragonfly, .haiku, .freebsd => packed struct(u32) {
        PASSIVE: bool = false,
        CANONNAME: bool = false,
        NUMERICHOST: bool = false,
        NUMERICSERV: bool = false,
        _4: u4 = 0,
        ALL: bool = false,
        V4MAPPED_CFG: bool = false,
        ADDRCONFIG: bool = false,
        V4MAPPED: bool = false,
        _: u20 = 0,
    },
    .netbsd => packed struct(u32) {
        PASSIVE: bool = false,
        CANONNAME: bool = false,
        NUMERICHOST: bool = false,
        NUMERICSERV: bool = false,
        _4: u6 = 0,
        ADDRCONFIG: bool = false,
        _: u21 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        V4MAPPED: bool = false,
        ALL: bool = false,
        ADDRCONFIG: bool = false,
        PASSIVE: bool = false,
        CANONNAME: bool = false,
        NUMERICHOST: bool = false,
        NUMERICSERV: bool = false,
        _: u25 = 0,
    },
    .openbsd => packed struct(u32) {
        PASSIVE: bool = false,
        CANONNAME: bool = false,
        NUMERICHOST: bool = false,
        _3: u1 = 0,
        NUMERICSERV: bool = false,
        _5: u1 = 0,
        ADDRCONFIG: bool = false,
        _: u25 = 0,
    },
    .macos, .ios, .tvos, .watchos, .visionos => packed struct(u32) {
        PASSIVE: bool = false,
        CANONNAME: bool = false,
        NUMERICHOST: bool = false,
        _3: u5 = 0,
        ALL: bool = false,
        V4MAPPED_CFG: bool = false,
        ADDRCONFIG: bool = false,
        V4MAPPED: bool = false,
        NUMERICSERV: bool = false,
        _: u19 = 0,
    },
    .windows => ws2_32.AI,
    else => void,
};

pub const NI = switch (native_os) {
    .linux, .emscripten => packed struct(u32) {
        NUMERICHOST: bool = false,
        NUMERICSERV: bool = false,
        NOFQDN: bool = false,
        NAMEREQD: bool = false,
        DGRAM: bool = false,
        _5: u3 = 0,
        NUMERICSCOPE: bool = false,
        _: u23 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        NOFQDN: bool = false,
        NUMERICHOST: bool = false,
        NAMEREQD: bool = false,
        NUMERICSERV: bool = false,
        DGRAM: bool = false,
        WITHSCOPEID: bool = false,
        NUMERICSCOPE: bool = false,
        _: u25 = 0,
    },
    else => void,
};

pub const EAI = if (builtin.abi.isAndroid()) enum(c_int) {
    /// address family for hostname not supported
    ADDRFAMILY = 1,
    /// temporary failure in name resolution
    AGAIN = 2,
    /// invalid value for ai_flags
    BADFLAGS = 3,
    /// non-recoverable failure in name resolution
    FAIL = 4,
    /// ai_family not supported
    FAMILY = 5,
    /// memory allocation failure
    MEMORY = 6,
    /// no address associated with hostname
    NODATA = 7,
    /// hostname nor servname provided, or not known
    NONAME = 8,
    /// servname not supported for ai_socktype
    SERVICE = 9,
    /// ai_socktype not supported
    SOCKTYPE = 10,
    /// system error returned in errno
    SYSTEM = 11,
    /// invalid value for hints
    BADHINTS = 12,
    /// resolved protocol is unknown
    PROTOCOL = 13,
    /// argument buffer overflow
    OVERFLOW = 14,

    MAX = 15,

    _,
} else switch (native_os) {
    .linux, .emscripten => enum(c_int) {
        BADFLAGS = -1,
        NONAME = -2,
        AGAIN = -3,
        FAIL = -4,
        FAMILY = -6,
        SOCKTYPE = -7,
        SERVICE = -8,
        MEMORY = -10,
        SYSTEM = -11,
        OVERFLOW = -12,

        NODATA = -5,
        ADDRFAMILY = -9,
        INPROGRESS = -100,
        CANCELED = -101,
        NOTCANCELED = -102,
        ALLDONE = -103,
        INTR = -104,
        IDN_ENCODE = -105,

        _,
    },
    .haiku, .dragonfly, .netbsd, .freebsd, .macos, .ios, .tvos, .watchos, .visionos => enum(c_int) {
        /// address family for hostname not supported
        ADDRFAMILY = 1,
        /// temporary failure in name resolution
        AGAIN = 2,
        /// invalid value for ai_flags
        BADFLAGS = 3,
        /// non-recoverable failure in name resolution
        FAIL = 4,
        /// ai_family not supported
        FAMILY = 5,
        /// memory allocation failure
        MEMORY = 6,
        /// no address associated with hostname
        NODATA = 7,
        /// hostname nor servname provided, or not known
        NONAME = 8,
        /// servname not supported for ai_socktype
        SERVICE = 9,
        /// ai_socktype not supported
        SOCKTYPE = 10,
        /// system error returned in errno
        SYSTEM = 11,
        /// invalid value for hints
        BADHINTS = 12,
        /// resolved protocol is unknown
        PROTOCOL = 13,
        /// argument buffer overflow
        OVERFLOW = 14,
        _,
    },
    .solaris, .illumos => enum(c_int) {
        /// address family for hostname not supported
        ADDRFAMILY = 1,
        /// name could not be resolved at this time
        AGAIN = 2,
        /// flags parameter had an invalid value
        BADFLAGS = 3,
        /// non-recoverable failure in name resolution
        FAIL = 4,
        /// address family not recognized
        FAMILY = 5,
        /// memory allocation failure
        MEMORY = 6,
        /// no address associated with hostname
        NODATA = 7,
        /// name does not resolve
        NONAME = 8,
        /// service not recognized for socket type
        SERVICE = 9,
        /// intended socket type was not recognized
        SOCKTYPE = 10,
        /// system error returned in errno
        SYSTEM = 11,
        /// argument buffer overflow
        OVERFLOW = 12,
        /// resolved protocol is unknown
        PROTOCOL = 13,

        _,
    },
    .openbsd => enum(c_int) {
        /// address family for hostname not supported
        ADDRFAMILY = -9,
        /// name could not be resolved at this time
        AGAIN = -3,
        /// flags parameter had an invalid value
        BADFLAGS = -1,
        /// non-recoverable failure in name resolution
        FAIL = -4,
        /// address family not recognized
        FAMILY = -6,
        /// memory allocation failure
        MEMORY = -10,
        /// no address associated with hostname
        NODATA = -5,
        /// name does not resolve
        NONAME = -2,
        /// service not recognized for socket type
        SERVICE = -8,
        /// intended socket type was not recognized
        SOCKTYPE = -7,
        /// system error returned in errno
        SYSTEM = -11,
        /// invalid value for hints
        BADHINTS = -12,
        /// resolved protocol is unknown
        PROTOCOL = -13,
        /// argument buffer overflow
        OVERFLOW = -14,
        _,
    },
    else => void,
};

pub const dl_iterate_phdr_callback = *const fn (info: *dl_phdr_info, size: usize, data: ?*anyopaque) callconv(.c) c_int;

pub const Stat = switch (native_os) {
    .linux => switch (native_arch) {
        .sparc64 => extern struct {
            dev: u64,
            __pad1: u16,
            ino: ino_t,
            mode: u32,
            nlink: u32,

            uid: u32,
            gid: u32,
            rdev: u64,
            __pad2: u16,

            size: off_t,
            blksize: isize,
            blocks: i64,

            atim: timespec,
            mtim: timespec,
            ctim: timespec,
            __reserved: [2]usize,

            pub fn atime(self: @This()) timespec {
                return self.atim;
            }

            pub fn mtime(self: @This()) timespec {
                return self.mtim;
            }

            pub fn ctime(self: @This()) timespec {
                return self.ctim;
            }
        },
        .mips, .mipsel => if (builtin.target.abi.isMusl()) extern struct {
            dev: dev_t,
            __pad0: [2]i32,
            ino: ino_t,
            mode: mode_t,
            nlink: nlink_t,
            uid: uid_t,
            gid: gid_t,
            rdev: dev_t,
            __pad1: [2]i32,
            size: off_t,
            atim: timespec,
            mtim: timespec,
            ctim: timespec,
            blksize: blksize_t,
            __pad3: i32,
            blocks: blkcnt_t,
            __pad4: [14]i32,

            pub fn atime(self: @This()) timespec {
                return self.atim;
            }

            pub fn mtime(self: @This()) timespec {
                return self.mtim;
            }

            pub fn ctime(self: @This()) timespec {
                return self.ctim;
            }
        } else extern struct {
            dev: u32,
            __pad0: [3]u32,
            ino: ino_t,
            mode: mode_t,
            nlink: nlink_t,
            uid: uid_t,
            gid: gid_t,
            rdev: u32,
            __pad1: [3]u32,
            size: off_t,
            atim: timespec,
            mtim: timespec,
            ctim: timespec,
            blksize: blksize_t,
            __pad3: u32,
            blocks: blkcnt_t,
            __pad4: [14]u32,

            pub fn atime(self: @This()) timespec {
                return self.atim;
            }

            pub fn mtime(self: @This()) timespec {
                return self.mtim;
            }

            pub fn ctime(self: @This()) timespec {
                return self.ctim;
            }
        },
        .mips64, .mips64el => if (builtin.target.abi.isMusl()) extern struct {
            dev: dev_t,
            __pad0: [3]i32,
            ino: ino_t,
            mode: mode_t,
            nlink: nlink_t,
            uid: uid_t,
            gid: gid_t,
            rdev: dev_t,
            __pad1: [2]u32,
            size: off_t,
            __pad2: i32,
            atim: timespec,
            mtim: timespec,
            ctim: timespec,
            blksize: blksize_t,
            __pad3: u32,
            blocks: blkcnt_t,
            __pad4: [14]i32,

            pub fn atime(self: @This()) timespec {
                return self.atim;
            }

            pub fn mtime(self: @This()) timespec {
                return self.mtim;
            }

            pub fn ctime(self: @This()) timespec {
                return self.ctim;
            }
        } else extern struct {
            dev: dev_t,
            __pad0: [3]u32,
            ino: ino_t,
            mode: mode_t,
            nlink: nlink_t,
            uid: uid_t,
            gid: gid_t,
            rdev: dev_t,
            __pad1: [3]u32,
            size: off_t,
            atim: timespec,
            mtim: timespec,
            ctim: timespec,
            blksize: blksize_t,
            __pad3: u32,
            blocks: blkcnt_t,
            __pad4: [14]i32,

            pub fn atime(self: @This()) timespec {
                return self.atim;
            }

            pub fn mtime(self: @This()) timespec {
                return self.mtim;
            }

            pub fn ctime(self: @This()) timespec {
                return self.ctim;
            }
        },

        else => std.os.linux.Stat, // libc stat is the same as kernel stat.
    },
    .emscripten => emscripten.Stat,
    .wasi => extern struct {
        // Match wasi-libc's `struct stat` in lib/libc/include/wasm-wasi-musl/__struct_stat.h
        dev: dev_t,
        ino: ino_t,
        nlink: nlink_t,
        mode: mode_t,
        uid: uid_t,
        gid: gid_t,
        __pad0: c_uint = 0,
        rdev: dev_t,
        size: off_t,
        blksize: blksize_t,
        blocks: blkcnt_t,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        __reserved: [3]c_longlong = [3]c_longlong{ 0, 0, 0 },

        pub fn atime(self: @This()) timespec {
            return self.atim;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }

        pub fn fromFilestat(st: wasi.filestat_t) Stat {
            return .{
                .dev = st.dev,
                .ino = st.ino,
                .mode = switch (st.filetype) {
                    .UNKNOWN => 0,
                    .BLOCK_DEVICE => S.IFBLK,
                    .CHARACTER_DEVICE => S.IFCHR,
                    .DIRECTORY => S.IFDIR,
                    .REGULAR_FILE => S.IFREG,
                    .SOCKET_DGRAM => S.IFSOCK,
                    .SOCKET_STREAM => S.IFIFO,
                    .SYMBOLIC_LINK => S.IFLNK,
                    _ => 0,
                },
                .nlink = st.nlink,
                .size = @intCast(st.size),
                .atim = timespec.fromTimestamp(st.atim),
                .mtim = timespec.fromTimestamp(st.mtim),
                .ctim = timespec.fromTimestamp(st.ctim),

                .uid = 0,
                .gid = 0,
                .rdev = 0,
                .blksize = 0,
                .blocks = 0,
            };
        }
    },
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        dev: i32,
        mode: u16,
        nlink: u16,
        ino: ino_t,
        uid: uid_t,
        gid: gid_t,
        rdev: i32,
        atimespec: timespec,
        mtimespec: timespec,
        ctimespec: timespec,
        birthtimespec: timespec,
        size: off_t,
        blocks: i64,
        blksize: i32,
        flags: u32,
        gen: u32,
        lspare: i32,
        qspare: [2]i64,

        pub fn atime(self: @This()) timespec {
            return self.atimespec;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtimespec;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctimespec;
        }

        pub fn birthtime(self: @This()) timespec {
            return self.birthtimespec;
        }
    },
    .freebsd => freebsd.Stat,
    .solaris, .illumos => extern struct {
        dev: dev_t,
        ino: ino_t,
        mode: mode_t,
        nlink: nlink_t,
        uid: uid_t,
        gid: gid_t,
        rdev: dev_t,
        size: off_t,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        blksize: blksize_t,
        blocks: blkcnt_t,
        fstype: [16]u8,

        pub fn atime(self: @This()) timespec {
            return self.atim;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }
    },
    .netbsd => extern struct {
        dev: dev_t,
        mode: mode_t,
        ino: ino_t,
        nlink: nlink_t,
        uid: uid_t,
        gid: gid_t,
        rdev: dev_t,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        birthtim: timespec,
        size: off_t,
        blocks: blkcnt_t,
        blksize: blksize_t,
        flags: u32,
        gen: u32,
        __spare: [2]u32,

        pub fn atime(self: @This()) timespec {
            return self.atim;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }

        pub fn birthtime(self: @This()) timespec {
            return self.birthtim;
        }
    },
    .dragonfly => extern struct {
        ino: ino_t,
        nlink: c_uint,
        dev: c_uint,
        mode: c_ushort,
        padding1: u16,
        uid: uid_t,
        gid: gid_t,
        rdev: c_uint,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        size: c_ulong,
        blocks: i64,
        blksize: u32,
        flags: u32,
        gen: u32,
        lspare: i32,
        qspare1: i64,
        qspare2: i64,
        pub fn atime(self: @This()) timespec {
            return self.atim;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }
    },
    .haiku => extern struct {
        dev: dev_t,
        ino: ino_t,
        mode: mode_t,
        nlink: nlink_t,
        uid: uid_t,
        gid: gid_t,
        size: off_t,
        rdev: dev_t,
        blksize: blksize_t,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        crtim: timespec,
        type: u32,
        blocks: blkcnt_t,

        pub fn atime(self: @This()) timespec {
            return self.atim;
        }
        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }
        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }
        pub fn birthtime(self: @This()) timespec {
            return self.crtim;
        }
    },
    .openbsd => extern struct {
        mode: mode_t,
        dev: dev_t,
        ino: ino_t,
        nlink: nlink_t,
        uid: uid_t,
        gid: gid_t,
        rdev: dev_t,
        atim: timespec,
        mtim: timespec,
        ctim: timespec,
        size: off_t,
        blocks: blkcnt_t,
        blksize: blksize_t,
        flags: u32,
        gen: u32,
        birthtim: timespec,

        pub fn atime(self: @This()) timespec {
            return self.atim;
        }

        pub fn mtime(self: @This()) timespec {
            return self.mtim;
        }

        pub fn ctime(self: @This()) timespec {
            return self.ctim;
        }

        pub fn birthtime(self: @This()) timespec {
            return self.birthtim;
        }
    },
    else => void,
};

pub const pthread_mutex_t = switch (native_os) {
    .linux => extern struct {
        data: [data_len]u8 align(@alignOf(usize)) = [_]u8{0} ** data_len,

        const data_len = switch (native_abi) {
            .musl, .musleabi, .musleabihf => if (@sizeOf(usize) == 8) 40 else 24,
            .gnu, .gnuabin32, .gnuabi64, .gnueabi, .gnueabihf, .gnux32 => switch (native_arch) {
                .aarch64 => 48,
                .x86_64 => if (native_abi == .gnux32) 32 else 40,
                .mips64, .powerpc64, .powerpc64le, .sparc64 => 40,
                else => if (@sizeOf(usize) == 8) 40 else 24,
            },
            .android, .androideabi => if (@sizeOf(usize) == 8) 40 else 4,
            else => @compileError("unsupported ABI"),
        };
    },
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        sig: c_long = 0x32AAABA7,
        data: [data_len]u8 = [_]u8{0} ** data_len,

        const data_len = if (@sizeOf(usize) == 8) 56 else 40;
    },
    .freebsd, .dragonfly, .openbsd => extern struct {
        inner: ?*anyopaque = null,
    },
    .hermit => extern struct {
        ptr: usize = maxInt(usize),
    },
    .netbsd => extern struct {
        magic: u32 = 0x33330003,
        errorcheck: padded_pthread_spin_t = 0,
        ceiling: padded_pthread_spin_t = 0,
        owner: usize = 0,
        waiters: ?*u8 = null,
        recursed: u32 = 0,
        spare2: ?*anyopaque = null,
    },
    .haiku => extern struct {
        flags: u32 = 0,
        lock: i32 = 0,
        unused: i32 = -42,
        owner: i32 = -1,
        owner_count: i32 = 0,
    },
    .solaris, .illumos => extern struct {
        flag1: u16 = 0,
        flag2: u8 = 0,
        ceiling: u8 = 0,
        type: u16 = 0,
        magic: u16 = 0x4d58,
        lock: u64 = 0,
        data: u64 = 0,
    },
    .fuchsia => extern struct {
        data: [40]u8 align(@alignOf(usize)) = [_]u8{0} ** 40,
    },
    .emscripten => extern struct {
        data: [24]u8 align(4) = [_]u8{0} ** 24,
    },
    else => void,
};

pub const pthread_cond_t = switch (native_os) {
    .linux => extern struct {
        data: [48]u8 align(@alignOf(usize)) = [_]u8{0} ** 48,
    },
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        sig: c_long = 0x3CB0B1BB,
        data: [data_len]u8 = [_]u8{0} ** data_len,
        const data_len = if (@sizeOf(usize) == 8) 40 else 24;
    },
    .freebsd, .dragonfly, .openbsd => extern struct {
        inner: ?*anyopaque = null,
    },
    .hermit => extern struct {
        ptr: usize = maxInt(usize),
    },
    .netbsd => extern struct {
        magic: u32 = 0x55550005,
        lock: pthread_spin_t = 0,
        waiters_first: ?*u8 = null,
        waiters_last: ?*u8 = null,
        mutex: ?*pthread_mutex_t = null,
        private: ?*anyopaque = null,
    },
    .haiku => extern struct {
        flags: u32 = 0,
        unused: i32 = -42,
        mutex: ?*anyopaque = null,
        waiter_count: i32 = 0,
        lock: i32 = 0,
    },
    .solaris, .illumos => extern struct {
        flag: [4]u8 = [_]u8{0} ** 4,
        type: u16 = 0,
        magic: u16 = 0x4356,
        data: u64 = 0,
    },
    .fuchsia, .emscripten => extern struct {
        data: [48]u8 align(@alignOf(usize)) = [_]u8{0} ** 48,
    },
    else => void,
};

pub const pthread_rwlock_t = switch (native_os) {
    .linux => switch (native_abi) {
        .android, .androideabi => switch (@sizeOf(usize)) {
            4 => extern struct {
                data: [40]u8 align(@alignOf(usize)) = [_]u8{0} ** 40,
            },
            8 => extern struct {
                data: [56]u8 align(@alignOf(usize)) = [_]u8{0} ** 56,
            },
            else => @compileError("impossible pointer size"),
        },
        else => extern struct {
            data: [56]u8 align(@alignOf(usize)) = [_]u8{0} ** 56,
        },
    },
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        sig: c_long = 0x2DA8B3B4,
        data: [192]u8 = [_]u8{0} ** 192,
    },
    .freebsd, .dragonfly, .openbsd => extern struct {
        ptr: ?*anyopaque = null,
    },
    .hermit => extern struct {
        ptr: usize = maxInt(usize),
    },
    .netbsd => extern struct {
        magic: c_uint = 0x99990009,
        interlock: switch (builtin.cpu.arch) {
            .aarch64, .sparc, .x86_64, .x86 => u8,
            .arm, .powerpc => c_int,
            else => unreachable,
        } = 0,
        rblocked_first: ?*u8 = null,
        rblocked_last: ?*u8 = null,
        wblocked_first: ?*u8 = null,
        wblocked_last: ?*u8 = null,
        nreaders: c_uint = 0,
        owner: ?pthread_t = null,
        private: ?*anyopaque = null,
    },
    .solaris, .illumos => extern struct {
        readers: i32 = 0,
        type: u16 = 0,
        magic: u16 = 0x5257,
        mutex: pthread_mutex_t = .{},
        readercv: pthread_cond_t = .{},
        writercv: pthread_cond_t = .{},
    },
    .fuchsia => extern struct {
        size: [56]u8 align(@alignOf(usize)) = [_]u8{0} ** 56,
    },
    .emscripten => extern struct {
        size: [32]u8 align(4) = [_]u8{0} ** 32,
    },
    else => void,
};

pub const pthread_attr_t = switch (native_os) {
    .linux, .emscripten, .dragonfly => extern struct {
        __size: [56]u8,
        __align: c_long,
    },
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        __sig: c_long,
        __opaque: [56]u8,
    },
    .freebsd => extern struct {
        inner: ?*anyopaque = null,
    },
    .solaris, .illumos => extern struct {
        mutexattr: ?*anyopaque = null,
    },
    .netbsd => extern struct {
        magic: u32,
        flags: i32,
        private: ?*anyopaque,
    },
    .haiku => extern struct {
        detach_state: i32,
        sched_priority: i32,
        stack_size: i32,
        guard_size: i32,
        stack_address: ?*anyopaque,
    },
    .openbsd => extern struct {
        inner: ?*anyopaque = null,
    },
    else => void,
};

pub const pthread_key_t = switch (native_os) {
    .linux, .emscripten => c_uint,
    .macos, .ios, .tvos, .watchos, .visionos => c_ulong,
    .openbsd, .solaris, .illumos => c_int,
    else => void,
};

pub const padded_pthread_spin_t = switch (native_os) {
    .netbsd => switch (builtin.cpu.arch) {
        .x86, .x86_64 => u32,
        .sparc, .sparc64 => u32,
        else => pthread_spin_t,
    },
    else => void,
};

pub const pthread_spin_t = switch (native_os) {
    .netbsd => switch (builtin.cpu.arch) {
        .aarch64, .aarch64_be => u8,
        .mips, .mipsel, .mips64, .mips64el => u32,
        .powerpc, .powerpc64, .powerpc64le => i32,
        .x86, .x86_64 => u8,
        .arm, .armeb, .thumb, .thumbeb => i32,
        .sparc, .sparc64 => u8,
        .riscv32, .riscv64 => u32,
        else => @compileError("undefined pthread_spin_t for this arch"),
    },
    else => void,
};

pub const sem_t = switch (native_os) {
    .linux, .emscripten => extern struct {
        __size: [4 * @sizeOf(usize)]u8 align(@alignOf(usize)),
    },
    .macos, .ios, .tvos, .watchos, .visionos => c_int,
    .freebsd => extern struct {
        _magic: u32,
        _kern: extern struct {
            _count: u32,
            _flags: u32,
        },
        _padding: u32,
    },
    .solaris, .illumos => extern struct {
        count: u32 = 0,
        type: u16 = 0,
        magic: u16 = 0x534d,
        __pad1: [3]u64 = [_]u64{0} ** 3,
        __pad2: [2]u64 = [_]u64{0} ** 2,
    },
    .openbsd, .netbsd, .dragonfly => ?*opaque {},
    .haiku => extern struct {
        type: i32,
        u: extern union {
            named_sem_id: i32,
            unnamed_sem: i32,
        },
        padding: [2]i32,
    },
    else => void,
};

/// Renamed from `kevent` to `Kevent` to avoid conflict with function name.
pub const Kevent = switch (native_os) {
    .netbsd => extern struct {
        ident: usize,
        filter: i32,
        flags: u32,
        fflags: u32,
        data: i64,
        udata: usize,
    },
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        ident: usize,
        filter: i16,
        flags: u16,
        fflags: u32,
        data: isize,
        udata: usize,

        // sys/types.h on macos uses #pragma pack(4) so these checks are
        // to make sure the struct is laid out the same. These values were
        // produced from C code using the offsetof macro.
        comptime {
            assert(@offsetOf(@This(), "ident") == 0);
            assert(@offsetOf(@This(), "filter") == 8);
            assert(@offsetOf(@This(), "flags") == 10);
            assert(@offsetOf(@This(), "fflags") == 12);
            assert(@offsetOf(@This(), "data") == 16);
            assert(@offsetOf(@This(), "udata") == 24);
        }
    },
    .freebsd => extern struct {
        /// Identifier for this event.
        ident: usize,
        /// Filter for event.
        filter: i16,
        /// Action flags for kqueue.
        flags: u16,
        /// Filter flag value.
        fflags: u32,
        /// Filter data value.
        data: i64,
        /// Opaque user data identifier.
        udata: usize,
        /// Future extensions.
        _ext: [4]u64 = [_]u64{0} ** 4,
    },
    .dragonfly => extern struct {
        ident: usize,
        filter: c_short,
        flags: c_ushort,
        fflags: c_uint,
        data: isize,
        udata: usize,
    },
    .openbsd => extern struct {
        ident: usize,
        filter: c_short,
        flags: u16,
        fflags: c_uint,
        data: i64,
        udata: usize,
    },
    else => void,
};

pub const port_t = switch (native_os) {
    .solaris, .illumos => c_int,
    else => void,
};

pub const port_event = switch (native_os) {
    .solaris, .illumos => extern struct {
        events: u32,
        /// Event source.
        source: u16,
        __pad: u16,
        /// Source-specific object.
        object: ?*anyopaque,
        /// User cookie.
        cookie: ?*anyopaque,
    },
    else => void,
};

pub const AT = switch (native_os) {
    .linux => linux.AT,
    .windows => struct {
        /// Remove directory instead of unlinking file
        pub const REMOVEDIR = 0x200;
    },
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const FDCWD = -2;
        /// Use effective ids in access check
        pub const EACCESS = 0x0010;
        /// Act on the symlink itself not the target
        pub const SYMLINK_NOFOLLOW = 0x0020;
        /// Act on target of symlink
        pub const SYMLINK_FOLLOW = 0x0040;
        /// Path refers to directory
        pub const REMOVEDIR = 0x0080;
    },
    .freebsd => struct {
        /// Magic value that specify the use of the current working directory
        /// to determine the target of relative file paths in the openat() and
        /// similar syscalls.
        pub const FDCWD = -100;
        /// Check access using effective user and group ID
        pub const EACCESS = 0x0100;
        /// Do not follow symbolic links
        pub const SYMLINK_NOFOLLOW = 0x0200;
        /// Follow symbolic link
        pub const SYMLINK_FOLLOW = 0x0400;
        /// Remove directory instead of file
        pub const REMOVEDIR = 0x0800;
        /// Fail if not under dirfd
        pub const BENEATH = 0x1000;
    },
    .netbsd => struct {
        /// Magic value that specify the use of the current working directory
        /// to determine the target of relative file paths in the openat() and
        /// similar syscalls.
        pub const FDCWD = -100;
        /// Check access using effective user and group ID
        pub const EACCESS = 0x0100;
        /// Do not follow symbolic links
        pub const SYMLINK_NOFOLLOW = 0x0200;
        /// Follow symbolic link
        pub const SYMLINK_FOLLOW = 0x0400;
        /// Remove directory instead of file
        pub const REMOVEDIR = 0x0800;
    },
    .dragonfly => struct {
        pub const FDCWD = -328243;
        pub const SYMLINK_NOFOLLOW = 1;
        pub const REMOVEDIR = 2;
        pub const EACCESS = 4;
        pub const SYMLINK_FOLLOW = 8;
    },
    .openbsd => struct {
        /// Magic value that specify the use of the current working directory
        /// to determine the target of relative file paths in the openat() and
        /// similar syscalls.
        pub const FDCWD = -100;
        /// Check access using effective user and group ID
        pub const EACCESS = 0x01;
        /// Do not follow symbolic links
        pub const SYMLINK_NOFOLLOW = 0x02;
        /// Follow symbolic link
        pub const SYMLINK_FOLLOW = 0x04;
        /// Remove directory instead of file
        pub const REMOVEDIR = 0x08;
    },
    .haiku => struct {
        pub const FDCWD = -1;
        pub const SYMLINK_NOFOLLOW = 0x01;
        pub const SYMLINK_FOLLOW = 0x02;
        pub const REMOVEDIR = 0x04;
        pub const EACCESS = 0x08;
    },
    .solaris, .illumos => struct {
        /// Magic value that specify the use of the current working directory
        /// to determine the target of relative file paths in the openat() and
        /// similar syscalls.
        pub const FDCWD: fd_t = @bitCast(@as(u32, 0xffd19553));
        /// Do not follow symbolic links
        pub const SYMLINK_NOFOLLOW = 0x1000;
        /// Follow symbolic link
        pub const SYMLINK_FOLLOW = 0x2000;
        /// Remove directory instead of file
        pub const REMOVEDIR = 0x1;
        pub const TRIGGER = 0x2;
        /// Check access using effective user and group ID
        pub const EACCESS = 0x4;
    },
    .emscripten => struct {
        pub const FDCWD = -100;
        pub const SYMLINK_NOFOLLOW = 0x100;
        pub const REMOVEDIR = 0x200;
        pub const SYMLINK_FOLLOW = 0x400;
        pub const NO_AUTOMOUNT = 0x800;
        pub const EMPTY_PATH = 0x1000;
        pub const STATX_SYNC_TYPE = 0x6000;
        pub const STATX_SYNC_AS_STAT = 0x0000;
        pub const STATX_FORCE_SYNC = 0x2000;
        pub const STATX_DONT_SYNC = 0x4000;
        pub const RECURSIVE = 0x8000;
    },
    .wasi => struct {
        // Match `AT_*` constants in lib/libc/include/wasm-wasi-musl/__header_fcntl.h
        pub const EACCESS = 0x0;
        pub const SYMLINK_NOFOLLOW = 0x1;
        pub const SYMLINK_FOLLOW = 0x2;
        pub const REMOVEDIR = 0x4;
        /// When linking libc, we follow their convention and use -2 for current working directory.
        /// However, without libc, Zig does a different convention: it assumes the
        /// current working directory is the first preopen. This behavior can be
        /// overridden with a public function called `wasi_cwd` in the root source
        /// file.
        pub const FDCWD: fd_t = if (builtin.link_libc) -2 else 3;
    },
    else => void,
};

pub const O = switch (native_os) {
    .linux => linux.O,
    .emscripten => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        _2: u4 = 0,
        CREAT: bool = false,
        EXCL: bool = false,
        NOCTTY: bool = false,
        TRUNC: bool = false,
        APPEND: bool = false,
        NONBLOCK: bool = false,
        DSYNC: bool = false,
        ASYNC: bool = false,
        DIRECT: bool = false,
        LARGEFILE: bool = false,
        DIRECTORY: bool = false,
        NOFOLLOW: bool = false,
        NOATIME: bool = false,
        CLOEXEC: bool = false,
        SYNC: bool = false,
        PATH: bool = false,
        TMPFILE: bool = false,
        _: u9 = 0,
    },
    .wasi => packed struct(u32) {
        // Match `O_*` bits from lib/libc/include/wasm-wasi-musl/__header_fcntl.h
        APPEND: bool = false,
        DSYNC: bool = false,
        NONBLOCK: bool = false,
        RSYNC: bool = false,
        SYNC: bool = false,
        _5: u7 = 0,
        CREAT: bool = false,
        DIRECTORY: bool = false,
        EXCL: bool = false,
        TRUNC: bool = false,
        _16: u8 = 0,
        NOFOLLOW: bool = false,
        EXEC: bool = false,
        read: bool = false,
        SEARCH: bool = false,
        write: bool = false,
        // O_CLOEXEC, O_TTY_ININT, O_NOCTTY are 0 in wasi-musl, so they're silently
        // ignored in C code.  Thus no mapping in Zig.
        _: u3 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NDELAY: bool = false,
        APPEND: bool = false,
        SYNC: bool = false,
        _5: u1 = 0,
        DSYNC: bool = false,
        NONBLOCK: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        NOCTTY: bool = false,
        _12: u1 = 0,
        LARGEFILE: bool = false,
        XATTR: bool = false,
        RSYNC: bool = false,
        _16: u1 = 0,
        NOFOLLOW: bool = false,
        NOLINKS: bool = false,
        _19: u2 = 0,
        SEARCH: bool = false,
        EXEC: bool = false,
        CLOEXEC: bool = false,
        DIRECTORY: bool = false,
        DIRECT: bool = false,
        _: u6 = 0,
    },
    .netbsd => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NONBLOCK: bool = false,
        APPEND: bool = false,
        SHLOCK: bool = false,
        EXLOCK: bool = false,
        ASYNC: bool = false,
        SYNC: bool = false,
        NOFOLLOW: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        _12: u3 = 0,
        NOCTTY: bool = false,
        DSYNC: bool = false,
        RSYNC: bool = false,
        ALT_IO: bool = false,
        DIRECT: bool = false,
        _20: u1 = 0,
        DIRECTORY: bool = false,
        CLOEXEC: bool = false,
        SEARCH: bool = false,
        _: u8 = 0,
    },
    .openbsd => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NONBLOCK: bool = false,
        APPEND: bool = false,
        SHLOCK: bool = false,
        EXLOCK: bool = false,
        ASYNC: bool = false,
        SYNC: bool = false,
        NOFOLLOW: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        _12: u3 = 0,
        NOCTTY: bool = false,
        CLOEXEC: bool = false,
        DIRECTORY: bool = false,
        _: u14 = 0,
    },
    .haiku => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        _2: u4 = 0,
        CLOEXEC: bool = false,
        NONBLOCK: bool = false,
        EXCL: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        APPEND: bool = false,
        NOCTTY: bool = false,
        NOTRAVERSE: bool = false,
        _14: u2 = 0,
        SYNC: bool = false,
        RSYNC: bool = false,
        DSYNC: bool = false,
        NOFOLLOW: bool = false,
        DIRECT: bool = false,
        DIRECTORY: bool = false,
        _: u10 = 0,
    },
    .macos, .ios, .tvos, .watchos, .visionos => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NONBLOCK: bool = false,
        APPEND: bool = false,
        SHLOCK: bool = false,
        EXLOCK: bool = false,
        ASYNC: bool = false,
        SYNC: bool = false,
        NOFOLLOW: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        _12: u3 = 0,
        EVTONLY: bool = false,
        _16: u1 = 0,
        NOCTTY: bool = false,
        _18: u2 = 0,
        DIRECTORY: bool = false,
        SYMLINK: bool = false,
        DSYNC: bool = false,
        _23: u1 = 0,
        CLOEXEC: bool = false,
        _25: u4 = 0,
        ALERT: bool = false,
        _30: u1 = 0,
        POPUP: bool = false,
    },
    .dragonfly => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NONBLOCK: bool = false,
        APPEND: bool = false,
        SHLOCK: bool = false,
        EXLOCK: bool = false,
        ASYNC: bool = false,
        SYNC: bool = false,
        NOFOLLOW: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        _12: u3 = 0,
        NOCTTY: bool = false,
        DIRECT: bool = false,
        CLOEXEC: bool = false,
        FBLOCKING: bool = false,
        FNONBLOCKING: bool = false,
        FAPPEND: bool = false,
        FOFFSET: bool = false,
        FSYNCWRITE: bool = false,
        FASYNCWRITE: bool = false,
        _24: u3 = 0,
        DIRECTORY: bool = false,
        _: u4 = 0,
    },
    .freebsd => packed struct(u32) {
        ACCMODE: std.posix.ACCMODE = .RDONLY,
        NONBLOCK: bool = false,
        APPEND: bool = false,
        SHLOCK: bool = false,
        EXLOCK: bool = false,
        ASYNC: bool = false,
        SYNC: bool = false,
        NOFOLLOW: bool = false,
        CREAT: bool = false,
        TRUNC: bool = false,
        EXCL: bool = false,
        DSYNC: bool = false,
        _13: u2 = 0,
        NOCTTY: bool = false,
        DIRECT: bool = false,
        DIRECTORY: bool = false,
        NOATIME: bool = false,
        _19: u1 = 0,
        CLOEXEC: bool = false,
        PATH: bool = false,
        TMPFILE: bool = false,
        _: u9 = 0,
    },
    else => void,
};

pub const MAP = switch (native_os) {
    .linux => linux.MAP,
    .emscripten => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
            SHARED_VALIDATE = 0x03,
        },
        FIXED: bool = false,
        ANONYMOUS: bool = false,
        _6: u2 = 0,
        GROWSDOWN: bool = false,
        _9: u2 = 0,
        DENYWRITE: bool = false,
        EXECUTABLE: bool = false,
        LOCKED: bool = false,
        NORESERVE: bool = false,
        POPULATE: bool = false,
        NONBLOCK: bool = false,
        STACK: bool = false,
        HUGETLB: bool = false,
        SYNC: bool = false,
        FIXED_NOREPLACE: bool = false,
        _: u11 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        RENAME: bool = false,
        NORESERVE: bool = false,
        @"32BIT": bool = false,
        ANONYMOUS: bool = false,
        ALIGN: bool = false,
        TEXT: bool = false,
        INITDATA: bool = false,
        _: u20 = 0,
    },
    .netbsd => packed struct(u32) {
        TYPE: enum(u2) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        REMAPDUP: bool = false,
        _3: u1 = 0,
        FIXED: bool = false,
        RENAME: bool = false,
        NORESERVE: bool = false,
        INHERIT: bool = false,
        _8: u1 = 0,
        HASSEMAPHORE: bool = false,
        TRYFIXED: bool = false,
        WIRED: bool = false,
        ANONYMOUS: bool = false,
        STACK: bool = false,
        _: u18 = 0,
    },
    .openbsd => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        _5: u7 = 0,
        ANONYMOUS: bool = false,
        _13: u1 = 0,
        STACK: bool = false,
        CONCEAL: bool = false,
        _: u16 = 0,
    },
    .haiku => packed struct(u32) {
        TYPE: enum(u2) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        ANONYMOUS: bool = false,
        NORESERVE: bool = false,
        _: u27 = 0,
    },
    .macos, .ios, .tvos, .watchos, .visionos => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        _5: u1 = 0,
        NORESERVE: bool = false,
        _7: u2 = 0,
        HASSEMAPHORE: bool = false,
        NOCACHE: bool = false,
        JIT: bool = false,
        ANONYMOUS: bool = false,
        _: u19 = 0,
    },
    .dragonfly => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        RENAME: bool = false,
        NORESERVE: bool = false,
        INHERIT: bool = false,
        NOEXTEND: bool = false,
        HASSEMAPHORE: bool = false,
        STACK: bool = false,
        NOSYNC: bool = false,
        ANONYMOUS: bool = false,
        VPAGETABLE: bool = false,
        _14: u2 = 0,
        TRYFIXED: bool = false,
        NOCORE: bool = false,
        SIZEALIGN: bool = false,
        _: u13 = 0,
    },
    .freebsd => packed struct(u32) {
        TYPE: enum(u4) {
            SHARED = 0x01,
            PRIVATE = 0x02,
        },
        FIXED: bool = false,
        _5: u5 = 0,
        STACK: bool = false,
        NOSYNC: bool = false,
        ANONYMOUS: bool = false,
        GUARD: bool = false,
        EXCL: bool = false,
        _15: u2 = 0,
        NOCORE: bool = false,
        PREFAULT_READ: bool = false,
        @"32BIT": bool = false,
        _: u12 = 0,
    },
    else => void,
};

pub const MREMAP = switch (native_os) {
    .linux => linux.MREMAP,
    else => void,
};

/// Used by libc to communicate failure. Not actually part of the underlying syscall.
pub const MAP_FAILED: *anyopaque = @ptrFromInt(maxInt(usize));

pub const cc_t = u8;

/// Indices into the `cc` array in the `termios` struct.
pub const V = switch (native_os) {
    .linux => linux.V,
    .macos, .ios, .tvos, .watchos, .visionos, .netbsd, .openbsd => enum {
        EOF,
        EOL,
        EOL2,
        ERASE,
        WERASE,
        KILL,
        REPRINT,
        reserved,
        INTR,
        QUIT,
        SUSP,
        DSUSP,
        START,
        STOP,
        LNEXT,
        DISCARD,
        MIN,
        TIME,
        STATUS,
    },
    .freebsd => enum {
        EOF,
        EOL,
        EOL2,
        ERASE,
        WERASE,
        KILL,
        REPRINT,
        ERASE2,
        INTR,
        QUIT,
        SUSP,
        DSUSP,
        START,
        STOP,
        LNEXT,
        DISCARD,
        MIN,
        TIME,
        STATUS,
    },
    .haiku => enum {
        INTR,
        QUIT,
        ERASE,
        KILL,
        EOF,
        EOL,
        EOL2,
        SWTCH,
        START,
        STOP,
        SUSP,
    },
    .solaris, .illumos => enum {
        INTR,
        QUIT,
        ERASE,
        KILL,
        EOF,
        EOL,
        EOL2,
        SWTCH,
        START,
        STOP,
        SUSP,
        DSUSP,
        REPRINT,
        DISCARD,
        WERASE,
        LNEXT,
        STATUS,
        ERASE2,
    },
    .emscripten, .wasi => enum {
        INTR,
        QUIT,
        ERASE,
        KILL,
        EOF,
        TIME,
        MIN,
        SWTC,
        START,
        STOP,
        SUSP,
        EOL,
        REPRINT,
        DISCARD,
        WERASE,
        LNEXT,
        EOL2,
    },
    else => void,
};

pub const NCCS = switch (native_os) {
    .linux => linux.NCCS,
    .macos, .ios, .tvos, .watchos, .visionos, .freebsd, .netbsd, .openbsd, .dragonfly => 20,
    .haiku => 11,
    .solaris, .illumos => 19,
    .emscripten, .wasi => 32,
    else => void,
};

pub const termios = switch (native_os) {
    .linux => linux.termios,
    .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        iflag: tc_iflag_t,
        oflag: tc_oflag_t,
        cflag: tc_cflag_t,
        lflag: tc_lflag_t,
        cc: [NCCS]cc_t,
        ispeed: speed_t align(8),
        ospeed: speed_t,
    },
    .freebsd, .netbsd, .dragonfly, .openbsd => extern struct {
        iflag: tc_iflag_t,
        oflag: tc_oflag_t,
        cflag: tc_cflag_t,
        lflag: tc_lflag_t,
        cc: [NCCS]cc_t,
        ispeed: speed_t,
        ospeed: speed_t,
    },
    .haiku => extern struct {
        iflag: tc_iflag_t,
        oflag: tc_oflag_t,
        cflag: tc_cflag_t,
        lflag: tc_lflag_t,
        line: cc_t,
        ispeed: speed_t,
        ospeed: speed_t,
        cc: [NCCS]cc_t,
    },
    .solaris, .illumos => extern struct {
        iflag: tc_iflag_t,
        oflag: tc_oflag_t,
        cflag: tc_cflag_t,
        lflag: tc_lflag_t,
        cc: [NCCS]cc_t,
    },
    .emscripten, .wasi => extern struct {
        iflag: tc_iflag_t,
        oflag: tc_oflag_t,
        cflag: tc_cflag_t,
        lflag: tc_lflag_t,
        line: cc_t,
        cc: [NCCS]cc_t,
        ispeed: speed_t,
        ospeed: speed_t,
    },
    else => void,
};

pub const tc_iflag_t = switch (native_os) {
    .linux => linux.tc_iflag_t,
    .macos, .ios, .tvos, .watchos, .visionos => packed struct(u64) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IXON: bool = false,
        IXOFF: bool = false,
        IXANY: bool = false,
        _12: u1 = 0,
        IMAXBEL: bool = false,
        IUTF8: bool = false,
        _: u49 = 0,
    },
    .netbsd, .freebsd, .dragonfly => packed struct(u32) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IXON: bool = false,
        IXOFF: bool = false,
        IXANY: bool = false,
        _12: u1 = 0,
        IMAXBEL: bool = false,
        _: u18 = 0,
    },
    .openbsd => packed struct(u32) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IXON: bool = false,
        IXOFF: bool = false,
        IXANY: bool = false,
        IUCLC: bool = false,
        IMAXBEL: bool = false,
        _: u18 = 0,
    },
    .haiku => packed struct(u32) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IUCLC: bool = false,
        IXON: bool = false,
        IXANY: bool = false,
        IXOFF: bool = false,
        _: u19 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IUCLC: bool = false,
        IXON: bool = false,
        IXANY: bool = false,
        _12: u1 = 0,
        IMAXBEL: bool = false,
        _14: u1 = 0,
        DOSMODE: bool = false,
        _: u16 = 0,
    },
    .emscripten, .wasi => packed struct(u32) {
        IGNBRK: bool = false,
        BRKINT: bool = false,
        IGNPAR: bool = false,
        PARMRK: bool = false,
        INPCK: bool = false,
        ISTRIP: bool = false,
        INLCR: bool = false,
        IGNCR: bool = false,
        ICRNL: bool = false,
        IUCLC: bool = false,
        IXON: bool = false,
        IXANY: bool = false,
        IXOFF: bool = false,
        IMAXBEL: bool = false,
        IUTF8: bool = false,
        _: u17 = 0,
    },
    else => void,
};

pub const tc_oflag_t = switch (native_os) {
    .linux => linux.tc_oflag_t,
    .macos, .ios, .tvos, .watchos, .visionos => packed struct(u64) {
        OPOST: bool = false,
        ONLCR: bool = false,
        OXTABS: bool = false,
        ONOEOT: bool = false,
        OCRNL: bool = false,
        ONOCR: bool = false,
        ONLRET: bool = false,
        OFILL: bool = false,
        NLDLY: u2 = 0,
        TABDLY: u2 = 0,
        CRDLY: u2 = 0,
        FFDLY: u1 = 0,
        BSDLY: u1 = 0,
        VTDLY: u1 = 0,
        OFDEL: bool = false,
        _: u46 = 0,
    },
    .netbsd => packed struct(u32) {
        OPOST: bool = false,
        ONLCR: bool = false,
        OXTABS: bool = false,
        ONOEOT: bool = false,
        OCRNL: bool = false,
        _5: u1 = 0,
        ONOCR: bool = false,
        ONLRET: bool = false,
        _: u24 = 0,
    },
    .openbsd => packed struct(u32) {
        OPOST: bool = false,
        ONLCR: bool = false,
        OXTABS: bool = false,
        ONOEOT: bool = false,
        OCRNL: bool = false,
        OLCUC: bool = false,
        ONOCR: bool = false,
        ONLRET: bool = false,
        _: u24 = 0,
    },
    .freebsd, .dragonfly => packed struct(u32) {
        OPOST: bool = false,
        ONLCR: bool = false,
        _2: u1 = 0,
        ONOEOT: bool = false,
        OCRNL: bool = false,
        ONOCR: bool = false,
        ONLRET: bool = false,
        _: u25 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        OPOST: bool = false,
        OLCUC: bool = false,
        ONLCR: bool = false,
        OCRNL: bool = false,
        ONOCR: bool = false,
        ONLRET: bool = false,
        OFILL: bool = false,
        OFDEL: bool = false,
        NLDLY: u1 = 0,
        CRDLY: u2 = 0,
        TABDLY: u2 = 0,
        BSDLY: u1 = 0,
        VTDLY: u1 = 0,
        FFDLY: u1 = 0,
        PAGEOUT: bool = false,
        WRAP: bool = false,
        _: u14 = 0,
    },
    .haiku, .wasi, .emscripten => packed struct(u32) {
        OPOST: bool = false,
        OLCUC: bool = false,
        ONLCR: bool = false,
        OCRNL: bool = false,
        ONOCR: bool = false,
        ONLRET: bool = false,
        OFILL: bool = false,
        OFDEL: bool = false,
        NLDLY: u1 = 0,
        CRDLY: u2 = 0,
        TABDLY: u2 = 0,
        BSDLY: u1 = 0,
        VTDLY: u1 = 0,
        FFDLY: u1 = 0,
        _: u16 = 0,
    },
    else => void,
};

pub const CSIZE = switch (native_os) {
    .linux => linux.CSIZE,
    .haiku => enum(u1) { CS7, CS8 },
    else => enum(u2) { CS5, CS6, CS7, CS8 },
};

pub const tc_cflag_t = switch (native_os) {
    .linux => linux.tc_cflag_t,
    .macos, .ios, .tvos, .watchos, .visionos => packed struct(u64) {
        CIGNORE: bool = false,
        _1: u5 = 0,
        CSTOPB: bool = false,
        _7: u1 = 0,
        CSIZE: CSIZE = .CS5,
        _10: u1 = 0,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        CCTS_OFLOW: bool = false,
        CRTS_IFLOW: bool = false,
        CDTR_IFLOW: bool = false,
        CDSR_OFLOW: bool = false,
        CCAR_OFLOW: bool = false,
        _: u43 = 0,
    },
    .freebsd => packed struct(u32) {
        CIGNORE: bool = false,
        _1: u7 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        CCTS_OFLOW: bool = false,
        CRTS_IFLOW: bool = false,
        CDTR_IFLOW: bool = false,
        CDSR_OFLOW: bool = false,
        CCAR_OFLOW: bool = false,
        CNO_RTSDTR: bool = false,
        _: u10 = 0,
    },
    .netbsd => packed struct(u32) {
        CIGNORE: bool = false,
        _1: u7 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        CRTSCTS: bool = false,
        CDTRCTS: bool = false,
        _18: u2 = 0,
        MDMBUF: bool = false,
        _: u11 = 0,
    },
    .dragonfly => packed struct(u32) {
        CIGNORE: bool = false,
        _1: u7 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        CCTS_OFLOW: bool = false,
        CRTS_IFLOW: bool = false,
        CDTR_IFLOW: bool = false,
        CDSR_OFLOW: bool = false,
        CCAR_OFLOW: bool = false,
        _: u11 = 0,
    },
    .openbsd => packed struct(u32) {
        CIGNORE: bool = false,
        _1: u7 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        CRTSCTS: bool = false,
        _17: u3 = 0,
        MDMBUF: bool = false,
        _: u11 = 0,
    },
    .haiku => packed struct(u32) {
        _0: u5 = 0,
        CSIZE: CSIZE = .CS7,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        XLOBLK: bool = false,
        CTSFLOW: bool = false,
        RTSFLOW: bool = false,
        _: u17 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        _0: u4 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        RCV1EN: bool = false,
        XMT1EN: bool = false,
        LOBLK: bool = false,
        XCLUDE: bool = false,
        _16: u4 = 0,
        PAREXT: bool = false,
        CBAUDEXT: bool = false,
        CIBAUDEXT: bool = false,
        _23: u7 = 0,
        CRTSXOFF: bool = false,
        CRTSCTS: bool = false,
    },
    .wasi, .emscripten => packed struct(u32) {
        _0: u4 = 0,
        CSIZE: CSIZE = .CS5,
        CSTOPB: bool = false,
        CREAD: bool = false,
        PARENB: bool = false,
        PARODD: bool = false,
        HUPCL: bool = false,
        CLOCAL: bool = false,
        _: u20 = 0,
    },
    else => void,
};

pub const tc_lflag_t = switch (native_os) {
    .linux => linux.tc_lflag_t,
    .macos, .ios, .tvos, .watchos, .visionos => packed struct(u64) {
        ECHOKE: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHO: bool = false,
        ECHONL: bool = false,
        ECHOPRT: bool = false,
        ECHOCTL: bool = false,
        ISIG: bool = false,
        ICANON: bool = false,
        ALTWERASE: bool = false,
        IEXTEN: bool = false,
        EXTPROC: bool = false,
        _12: u10 = 0,
        TOSTOP: bool = false,
        FLUSHO: bool = false,
        _24: u1 = 0,
        NOKERNINFO: bool = false,
        _26: u3 = 0,
        PENDIN: bool = false,
        _30: u1 = 0,
        NOFLSH: bool = false,
        _: u32 = 0,
    },
    .netbsd, .freebsd, .dragonfly => packed struct(u32) {
        ECHOKE: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHO: bool = false,
        ECHONL: bool = false,
        ECHOPRT: bool = false,
        ECHOCTL: bool = false,
        ISIG: bool = false,
        ICANON: bool = false,
        ALTWERASE: bool = false,
        IEXTEN: bool = false,
        EXTPROC: bool = false,
        _12: u10 = 0,
        TOSTOP: bool = false,
        FLUSHO: bool = false,
        _24: u1 = 0,
        NOKERNINFO: bool = false,
        _26: u3 = 0,
        PENDIN: bool = false,
        _30: u1 = 0,
        NOFLSH: bool = false,
    },
    .openbsd => packed struct(u32) {
        ECHOKE: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHO: bool = false,
        ECHONL: bool = false,
        ECHOPRT: bool = false,
        ECHOCTL: bool = false,
        ISIG: bool = false,
        ICANON: bool = false,
        ALTWERASE: bool = false,
        IEXTEN: bool = false,
        EXTPROC: bool = false,
        _12: u10 = 0,
        TOSTOP: bool = false,
        FLUSHO: bool = false,
        XCASE: bool = false,
        NOKERNINFO: bool = false,
        _26: u3 = 0,
        PENDIN: bool = false,
        _30: u1 = 0,
        NOFLSH: bool = false,
    },
    .haiku => packed struct(u32) {
        ISIG: bool = false,
        ICANON: bool = false,
        XCASE: bool = false,
        ECHO: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHONL: bool = false,
        NOFLSH: bool = false,
        TOSTOP: bool = false,
        IEXTEN: bool = false,
        ECHOCTL: bool = false,
        ECHOPRT: bool = false,
        ECHOKE: bool = false,
        FLUSHO: bool = false,
        PENDIN: bool = false,
        _: u17 = 0,
    },
    .solaris, .illumos => packed struct(u32) {
        ISIG: bool = false,
        ICANON: bool = false,
        XCASE: bool = false,
        ECHO: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHONL: bool = false,
        NOFLSH: bool = false,
        TOSTOP: bool = false,
        ECHOCTL: bool = false,
        ECHOPRT: bool = false,
        ECHOKE: bool = false,
        DEFECHO: bool = false,
        FLUSHO: bool = false,
        PENDIN: bool = false,
        IEXTEN: bool = false,
        _: u16 = 0,
    },
    .wasi, .emscripten => packed struct(u32) {
        ISIG: bool = false,
        ICANON: bool = false,
        _2: u1 = 0,
        ECHO: bool = false,
        ECHOE: bool = false,
        ECHOK: bool = false,
        ECHONL: bool = false,
        NOFLSH: bool = false,
        TOSTOP: bool = false,
        _9: u6 = 0,
        IEXTEN: bool = false,
        _: u16 = 0,
    },
    else => void,
};

pub const speed_t = switch (native_os) {
    .linux => linux.speed_t,
    .macos, .ios, .tvos, .watchos, .visionos, .openbsd => enum(u64) {
        B0 = 0,
        B50 = 50,
        B75 = 75,
        B110 = 110,
        B134 = 134,
        B150 = 150,
        B200 = 200,
        B300 = 300,
        B600 = 600,
        B1200 = 1200,
        B1800 = 1800,
        B2400 = 2400,
        B4800 = 4800,
        B9600 = 9600,
        B19200 = 19200,
        B38400 = 38400,
        B7200 = 7200,
        B14400 = 14400,
        B28800 = 28800,
        B57600 = 57600,
        B76800 = 76800,
        B115200 = 115200,
        B230400 = 230400,
    },
    .freebsd, .netbsd => enum(c_uint) {
        B0 = 0,
        B50 = 50,
        B75 = 75,
        B110 = 110,
        B134 = 134,
        B150 = 150,
        B200 = 200,
        B300 = 300,
        B600 = 600,
        B1200 = 1200,
        B1800 = 1800,
        B2400 = 2400,
        B4800 = 4800,
        B9600 = 9600,
        B19200 = 19200,
        B38400 = 38400,
        B7200 = 7200,
        B14400 = 14400,
        B28800 = 28800,
        B57600 = 57600,
        B76800 = 76800,
        B115200 = 115200,
        B230400 = 230400,
        B460800 = 460800,
        B500000 = 500000,
        B921600 = 921600,
        B1000000 = 1000000,
        B1500000 = 1500000,
        B2000000 = 2000000,
        B2500000 = 2500000,
        B3000000 = 3000000,
        B3500000 = 3500000,
        B4000000 = 4000000,
    },
    .dragonfly => enum(c_uint) {
        B0 = 0,
        B50 = 50,
        B75 = 75,
        B110 = 110,
        B134 = 134,
        B150 = 150,
        B200 = 200,
        B300 = 300,
        B600 = 600,
        B1200 = 1200,
        B1800 = 1800,
        B2400 = 2400,
        B4800 = 4800,
        B9600 = 9600,
        B19200 = 19200,
        B38400 = 38400,
        B7200 = 7200,
        B14400 = 14400,
        B28800 = 28800,
        B57600 = 57600,
        B76800 = 76800,
        B115200 = 115200,
        B230400 = 230400,
        B460800 = 460800,
        B921600 = 921600,
    },
    .haiku => enum(u8) {
        B0 = 0x00,
        B50 = 0x01,
        B75 = 0x02,
        B110 = 0x03,
        B134 = 0x04,
        B150 = 0x05,
        B200 = 0x06,
        B300 = 0x07,
        B600 = 0x08,
        B1200 = 0x09,
        B1800 = 0x0A,
        B2400 = 0x0B,
        B4800 = 0x0C,
        B9600 = 0x0D,
        B19200 = 0x0E,
        B38400 = 0x0F,
        B57600 = 0x10,
        B115200 = 0x11,
        B230400 = 0x12,
        B31250 = 0x13,
    },
    .solaris, .illumos => enum(c_uint) {
        B0 = 0,
        B50 = 1,
        B75 = 2,
        B110 = 3,
        B134 = 4,
        B150 = 5,
        B200 = 6,
        B300 = 7,
        B600 = 8,
        B1200 = 9,
        B1800 = 10,
        B2400 = 11,
        B4800 = 12,
        B9600 = 13,
        B19200 = 14,
        B38400 = 15,
        B57600 = 16,
        B76800 = 17,
        B115200 = 18,
        B153600 = 19,
        B230400 = 20,
        B307200 = 21,
        B460800 = 22,
        B921600 = 23,
        B1000000 = 24,
        B1152000 = 25,
        B1500000 = 26,
        B2000000 = 27,
        B2500000 = 28,
        B3000000 = 29,
        B3500000 = 30,
        B4000000 = 31,
    },
    .emscripten, .wasi => enum(u32) {
        B0 = 0o0000000,
        B50 = 0o0000001,
        B75 = 0o0000002,
        B110 = 0o0000003,
        B134 = 0o0000004,
        B150 = 0o0000005,
        B200 = 0o0000006,
        B300 = 0o0000007,
        B600 = 0o0000010,
        B1200 = 0o0000011,
        B1800 = 0o0000012,
        B2400 = 0o0000013,
        B4800 = 0o0000014,
        B9600 = 0o0000015,
        B19200 = 0o0000016,
        B38400 = 0o0000017,

        B57600 = 0o0010001,
        B115200 = 0o0010002,
        B230400 = 0o0010003,
        B460800 = 0o0010004,
        B500000 = 0o0010005,
        B576000 = 0o0010006,
        B921600 = 0o0010007,
        B1000000 = 0o0010010,
        B1152000 = 0o0010011,
        B1500000 = 0o0010012,
        B2000000 = 0o0010013,
        B2500000 = 0o0010014,
        B3000000 = 0o0010015,
        B3500000 = 0o0010016,
        B4000000 = 0o0010017,
    },
    else => void,
};

pub const whence_t = if (native_os == .wasi) std.os.wasi.whence_t else c_int;

pub const sig_atomic_t = c_int;

/// maximum signal number + 1
pub const NSIG = switch (native_os) {
    .linux => linux.NSIG,
    .windows => 23,
    .haiku => 65,
    .netbsd, .freebsd => 32,
    .solaris, .illumos => 75,
    .openbsd => 33,
    else => {},
};

pub const MINSIGSTKSZ = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => 32768,
    .freebsd => switch (builtin.cpu.arch) {
        .x86, .x86_64 => 2048,
        .arm, .aarch64 => 4096,
        else => @compileError("unsupported arch"),
    },
    .solaris, .illumos => 2048,
    .haiku, .netbsd => 8192,
    .openbsd => 1 << openbsd.MAX_PAGE_SHIFT,
    else => {},
};
pub const SIGSTKSZ = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => 131072,
    .netbsd, .freebsd => MINSIGSTKSZ + 32768,
    .solaris, .illumos => 8192,
    .haiku => 16384,
    .openbsd => MINSIGSTKSZ + (1 << openbsd.MAX_PAGE_SHIFT) * 4,
    else => {},
};
pub const SS = switch (native_os) {
    .linux => linux.SS,
    .openbsd, .macos, .ios, .tvos, .watchos, .visionos, .netbsd, .freebsd => struct {
        pub const ONSTACK = 1;
        pub const DISABLE = 4;
    },
    .haiku, .solaris, .illumos => struct {
        pub const ONSTACK = 0x1;
        pub const DISABLE = 0x2;
    },
    else => void,
};

pub const EV = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        /// add event to kq (implies enable)
        pub const ADD = 0x0001;
        /// delete event from kq
        pub const DELETE = 0x0002;
        /// enable event
        pub const ENABLE = 0x0004;
        /// disable event (not reported)
        pub const DISABLE = 0x0008;
        /// only report one occurrence
        pub const ONESHOT = 0x0010;
        /// clear event state after reporting
        pub const CLEAR = 0x0020;
        /// force immediate event output
        /// ... with or without ERROR
        /// ... use KEVENT_FLAG_ERROR_EVENTS
        ///     on syscalls supporting flags
        pub const RECEIPT = 0x0040;
        /// disable event after reporting
        pub const DISPATCH = 0x0080;
        /// unique kevent per udata value
        pub const UDATA_SPECIFIC = 0x0100;
        /// ... in combination with DELETE
        /// will defer delete until udata-specific
        /// event enabled. EINPROGRESS will be
        /// returned to indicate the deferral
        pub const DISPATCH2 = DISPATCH | UDATA_SPECIFIC;
        /// report that source has vanished
        /// ... only valid with DISPATCH2
        pub const VANISHED = 0x0200;
        /// reserved by system
        pub const SYSFLAGS = 0xF000;
        /// filter-specific flag
        pub const FLAG0 = 0x1000;
        /// filter-specific flag
        pub const FLAG1 = 0x2000;
        /// EOF detected
        pub const EOF = 0x8000;
        /// error, data contains errno
        pub const ERROR = 0x4000;
        pub const POLL = FLAG0;
        pub const OOBAND = FLAG1;
    },
    .dragonfly => struct {
        pub const ADD = 1;
        pub const DELETE = 2;
        pub const ENABLE = 4;
        pub const DISABLE = 8;
        pub const ONESHOT = 16;
        pub const CLEAR = 32;
        pub const RECEIPT = 64;
        pub const DISPATCH = 128;
        pub const NODATA = 4096;
        pub const FLAG1 = 8192;
        pub const ERROR = 16384;
        pub const EOF = 32768;
        pub const SYSFLAGS = 61440;
    },
    .netbsd => struct {
        /// add event to kq (implies enable)
        pub const ADD = 0x0001;
        /// delete event from kq
        pub const DELETE = 0x0002;
        /// enable event
        pub const ENABLE = 0x0004;
        /// disable event (not reported)
        pub const DISABLE = 0x0008;
        /// only report one occurrence
        pub const ONESHOT = 0x0010;
        /// clear event state after reporting
        pub const CLEAR = 0x0020;
        /// force immediate event output
        /// ... with or without ERROR
        /// ... use KEVENT_FLAG_ERROR_EVENTS
        ///     on syscalls supporting flags
        pub const RECEIPT = 0x0040;
        /// disable event after reporting
        pub const DISPATCH = 0x0080;
    },
    .freebsd => struct {
        /// add event to kq (implies enable)
        pub const ADD = 0x0001;
        /// delete event from kq
        pub const DELETE = 0x0002;
        /// enable event
        pub const ENABLE = 0x0004;
        /// disable event (not reported)
        pub const DISABLE = 0x0008;
        /// only report one occurrence
        pub const ONESHOT = 0x0010;
        /// clear event state after reporting
        pub const CLEAR = 0x0020;
        /// error, event data contains errno
        pub const ERROR = 0x4000;
        /// force immediate event output
        /// ... with or without ERROR
        /// ... use KEVENT_FLAG_ERROR_EVENTS
        ///     on syscalls supporting flags
        pub const RECEIPT = 0x0040;
        /// disable event after reporting
        pub const DISPATCH = 0x0080;
    },
    .openbsd => struct {
        pub const ADD = 0x0001;
        pub const DELETE = 0x0002;
        pub const ENABLE = 0x0004;
        pub const DISABLE = 0x0008;
        pub const ONESHOT = 0x0010;
        pub const CLEAR = 0x0020;
        pub const RECEIPT = 0x0040;
        pub const DISPATCH = 0x0080;
        pub const FLAG1 = 0x2000;
        pub const ERROR = 0x4000;
        pub const EOF = 0x8000;
    },
    .haiku => struct {
        /// add event to kq (implies enable)
        pub const ADD = 0x0001;
        /// delete event from kq
        pub const DELETE = 0x0002;
        /// enable event
        pub const ENABLE = 0x0004;
        /// disable event (not reported)
        pub const DISABLE = 0x0008;
        /// only report one occurrence
        pub const ONESHOT = 0x0010;
        /// clear event state after reporting
        pub const CLEAR = 0x0020;
        /// force immediate event output
        /// ... with or without ERROR
        /// ... use KEVENT_FLAG_ERROR_EVENTS
        ///     on syscalls supporting flags
        pub const RECEIPT = 0x0040;
        /// disable event after reporting
        pub const DISPATCH = 0x0080;
    },
    else => void,
};

pub const EVFILT = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        pub const READ = -1;
        pub const WRITE = -2;
        /// attached to aio requests
        pub const AIO = -3;
        /// attached to vnodes
        pub const VNODE = -4;
        /// attached to struct proc
        pub const PROC = -5;
        /// attached to struct proc
        pub const SIGNAL = -6;
        /// timers
        pub const TIMER = -7;
        /// Mach portsets
        pub const MACHPORT = -8;
        /// Filesystem events
        pub const FS = -9;
        /// User events
        pub const USER = -10;
        /// Virtual memory events
        pub const VM = -12;
        /// Exception events
        pub const EXCEPT = -15;
        pub const SYSCOUNT = 17;
    },
    .haiku => struct {
        pub const READ = -1;
        pub const WRITE = -2;
        /// attached to aio requests
        pub const AIO = -3;
        /// attached to vnodes
        pub const VNODE = -4;
        /// attached to struct proc
        pub const PROC = -5;
        /// attached to struct proc
        pub const SIGNAL = -6;
        /// timers
        pub const TIMER = -7;
        /// Process descriptors
        pub const PROCDESC = -8;
        /// Filesystem events
        pub const FS = -9;
        pub const LIO = -10;
        /// User events
        pub const USER = -11;
        /// Sendfile events
        pub const SENDFILE = -12;
        pub const EMPTY = -13;
    },
    .dragonfly => struct {
        pub const FS = -10;
        pub const USER = -9;
        pub const EXCEPT = -8;
        pub const TIMER = -7;
        pub const SIGNAL = -6;
        pub const PROC = -5;
        pub const VNODE = -4;
        pub const AIO = -3;
        pub const WRITE = -2;
        pub const READ = -1;
        pub const SYSCOUNT = 10;
        pub const MARKER = 15;
    },
    .netbsd => struct {
        pub const READ = 0;
        pub const WRITE = 1;
        /// attached to aio requests
        pub const AIO = 2;
        /// attached to vnodes
        pub const VNODE = 3;
        /// attached to struct proc
        pub const PROC = 4;
        /// attached to struct proc
        pub const SIGNAL = 5;
        /// timers
        pub const TIMER = 6;
        /// Filesystem events
        pub const FS = 7;
        /// User events
        pub const USER = 1;
    },
    .freebsd => struct {
        pub const READ = -1;
        pub const WRITE = -2;
        /// attached to aio requests
        pub const AIO = -3;
        /// attached to vnodes
        pub const VNODE = -4;
        /// attached to struct proc
        pub const PROC = -5;
        /// attached to struct proc
        pub const SIGNAL = -6;
        /// timers
        pub const TIMER = -7;
        /// Process descriptors
        pub const PROCDESC = -8;
        /// Filesystem events
        pub const FS = -9;
        pub const LIO = -10;
        /// User events
        pub const USER = -11;
        /// Sendfile events
        pub const SENDFILE = -12;
        pub const EMPTY = -13;
    },
    .openbsd => struct {
        pub const READ = -1;
        pub const WRITE = -2;
        pub const AIO = -3;
        pub const VNODE = -4;
        pub const PROC = -5;
        pub const SIGNAL = -6;
        pub const TIMER = -7;
        pub const EXCEPT = -9;
    },
    else => void,
};

pub const NOTE = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => struct {
        /// On input, TRIGGER causes the event to be triggered for output.
        pub const TRIGGER = 0x01000000;
        /// ignore input fflags
        pub const FFNOP = 0x00000000;
        /// and fflags
        pub const FFAND = 0x40000000;
        /// or fflags
        pub const FFOR = 0x80000000;
        /// copy fflags
        pub const FFCOPY = 0xc0000000;
        /// mask for operations
        pub const FFCTRLMASK = 0xc0000000;
        pub const FFLAGSMASK = 0x00ffffff;
        /// low water mark
        pub const LOWAT = 0x00000001;
        /// OOB data
        pub const OOB = 0x00000002;
        /// vnode was removed
        pub const DELETE = 0x00000001;
        /// data contents changed
        pub const WRITE = 0x00000002;
        /// size increased
        pub const EXTEND = 0x00000004;
        /// attributes changed
        pub const ATTRIB = 0x00000008;
        /// link count changed
        pub const LINK = 0x00000010;
        /// vnode was renamed
        pub const RENAME = 0x00000020;
        /// vnode access was revoked
        pub const REVOKE = 0x00000040;
        /// No specific vnode event: to test for EVFILT_READ      activation
        pub const NONE = 0x00000080;
        /// vnode was unlocked by flock(2)
        pub const FUNLOCK = 0x00000100;
        /// process exited
        pub const EXIT = 0x80000000;
        /// process forked
        pub const FORK = 0x40000000;
        /// process exec'd
        pub const EXEC = 0x20000000;
        /// shared with EVFILT_SIGNAL
        pub const SIGNAL = 0x08000000;
        /// exit status to be returned, valid for child       process only
        pub const EXITSTATUS = 0x04000000;
        /// provide details on reasons for exit
        pub const EXIT_DETAIL = 0x02000000;
        /// mask for signal & exit status
        pub const PDATAMASK = 0x000fffff;
        pub const PCTRLMASK = 0xf0000000;
        pub const EXIT_DETAIL_MASK = 0x00070000;
        pub const EXIT_DECRYPTFAIL = 0x00010000;
        pub const EXIT_MEMORY = 0x00020000;
        pub const EXIT_CSERROR = 0x00040000;
        /// will react on memory          pressure
        pub const VM_PRESSURE = 0x80000000;
        /// will quit on memory       pressure, possibly after cleaning up dirty state
        pub const VM_PRESSURE_TERMINATE = 0x40000000;
        /// will quit immediately on      memory pressure
        pub const VM_PRESSURE_SUDDEN_TERMINATE = 0x20000000;
        /// there was an error
        pub const VM_ERROR = 0x10000000;
        /// data is seconds
        pub const SECONDS = 0x00000001;
        /// data is microseconds
        pub const USECONDS = 0x00000002;
        /// data is nanoseconds
        pub const NSECONDS = 0x00000004;
        /// absolute timeout
        pub const ABSOLUTE = 0x00000008;
        /// ext[1] holds leeway for power aware timers
        pub const LEEWAY = 0x00000010;
        /// system does minimal timer coalescing
        pub const CRITICAL = 0x00000020;
        /// system does maximum timer coalescing
        pub const BACKGROUND = 0x00000040;
        pub const MACH_CONTINUOUS_TIME = 0x00000080;
        /// data is mach absolute time units
        pub const MACHTIME = 0x00000100;
    },
    .dragonfly => struct {
        pub const FFNOP = 0;
        pub const TRACK = 1;
        pub const DELETE = 1;
        pub const LOWAT = 1;
        pub const TRACKERR = 2;
        pub const OOB = 2;
        pub const WRITE = 2;
        pub const EXTEND = 4;
        pub const CHILD = 4;
        pub const ATTRIB = 8;
        pub const LINK = 16;
        pub const RENAME = 32;
        pub const REVOKE = 64;
        pub const PDATAMASK = 1048575;
        pub const FFLAGSMASK = 16777215;
        pub const TRIGGER = 16777216;
        pub const EXEC = 536870912;
        pub const FFAND = 1073741824;
        pub const FORK = 1073741824;
        pub const EXIT = 2147483648;
        pub const FFOR = 2147483648;
        pub const FFCTRLMASK = 3221225472;
        pub const FFCOPY = 3221225472;
        pub const PCTRLMASK = 4026531840;
    },
    .netbsd => struct {
        /// On input, TRIGGER causes the event to be triggered for output.
        pub const TRIGGER = 0x08000000;
        /// low water mark
        pub const LOWAT = 0x00000001;
        /// vnode was removed
        pub const DELETE = 0x00000001;
        /// data contents changed
        pub const WRITE = 0x00000002;
        /// size increased
        pub const EXTEND = 0x00000004;
        /// attributes changed
        pub const ATTRIB = 0x00000008;
        /// link count changed
        pub const LINK = 0x00000010;
        /// vnode was renamed
        pub const RENAME = 0x00000020;
        /// vnode access was revoked
        pub const REVOKE = 0x00000040;
        /// process exited
        pub const EXIT = 0x80000000;
        /// process forked
        pub const FORK = 0x40000000;
        /// process exec'd
        pub const EXEC = 0x20000000;
        /// mask for signal & exit status
        pub const PDATAMASK = 0x000fffff;
        pub const PCTRLMASK = 0xf0000000;
    },
    .freebsd => struct {
        /// On input, TRIGGER causes the event to be triggered for output.
        pub const TRIGGER = 0x01000000;
        /// ignore input fflags
        pub const FFNOP = 0x00000000;
        /// and fflags
        pub const FFAND = 0x40000000;
        /// or fflags
        pub const FFOR = 0x80000000;
        /// copy fflags
        pub const FFCOPY = 0xc0000000;
        /// mask for operations
        pub const FFCTRLMASK = 0xc0000000;
        pub const FFLAGSMASK = 0x00ffffff;
        /// low water mark
        pub const LOWAT = 0x00000001;
        /// behave like poll()
        pub const FILE_POLL = 0x00000002;
        /// vnode was removed
        pub const DELETE = 0x00000001;
        /// data contents changed
        pub const WRITE = 0x00000002;
        /// size increased
        pub const EXTEND = 0x00000004;
        /// attributes changed
        pub const ATTRIB = 0x00000008;
        /// link count changed
        pub const LINK = 0x00000010;
        /// vnode was renamed
        pub const RENAME = 0x00000020;
        /// vnode access was revoked
        pub const REVOKE = 0x00000040;
        /// vnode was opened
        pub const OPEN = 0x00000080;
        /// file closed, fd did not allow write
        pub const CLOSE = 0x00000100;
        /// file closed, fd did allow write
        pub const CLOSE_WRITE = 0x00000200;
        /// file was read
        pub const READ = 0x00000400;
        /// process exited
        pub const EXIT = 0x80000000;
        /// process forked
        pub const FORK = 0x40000000;
        /// process exec'd
        pub const EXEC = 0x20000000;
        /// mask for signal & exit status
        pub const PDATAMASK = 0x000fffff;
        pub const PCTRLMASK = 0xf0000000;
        /// data is seconds
        pub const SECONDS = 0x00000001;
        /// data is milliseconds
        pub const MSECONDS = 0x00000002;
        /// data is microseconds
        pub const USECONDS = 0x00000004;
        /// data is nanoseconds
        pub const NSECONDS = 0x00000008;
        /// timeout is absolute
        pub const ABSTIME = 0x00000010;
    },
    .openbsd => struct {
        // data/hint flags for EVFILT.{READ|WRITE}
        pub const LOWAT = 0x0001;
        pub const EOF = 0x0002;
        // data/hint flags for EVFILT.EXCEPT and EVFILT.{READ|WRITE}
        pub const OOB = 0x0004;
        // data/hint flags for EVFILT.VNODE
        pub const DELETE = 0x0001;
        pub const WRITE = 0x0002;
        pub const EXTEND = 0x0004;
        pub const ATTRIB = 0x0008;
        pub const LINK = 0x0010;
        pub const RENAME = 0x0020;
        pub const REVOKE = 0x0040;
        pub const TRUNCATE = 0x0080;
        // data/hint flags for EVFILT.PROC
        pub const EXIT = 0x80000000;
        pub const FORK = 0x40000000;
        pub const EXEC = 0x20000000;
        pub const PDATAMASK = 0x000fffff;
        pub const PCTRLMASK = 0xf0000000;
        pub const TRACK = 0x00000001;
        pub const TRACKERR = 0x00000002;
        pub const CHILD = 0x00000004;
        // data/hint flags for EVFILT.DEVICE
        pub const CHANGE = 0x00000001;
    },
    else => void,
};

// Unix-like systems
pub const DIR = opaque {};
pub extern "c" fn opendir(pathname: [*:0]const u8) ?*DIR;
pub extern "c" fn fdopendir(fd: c_int) ?*DIR;
pub extern "c" fn rewinddir(dp: *DIR) void;
pub extern "c" fn closedir(dp: *DIR) c_int;
pub extern "c" fn telldir(dp: *DIR) c_long;
pub extern "c" fn seekdir(dp: *DIR, loc: c_long) void;

pub extern "c" fn sigwait(set: ?*sigset_t, sig: ?*c_int) c_int;

pub extern "c" fn alarm(seconds: c_uint) c_uint;

pub const close = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => darwin.@"close$NOCANCEL",
    else => private.close,
};

pub const clock_getres = switch (native_os) {
    .netbsd => private.__clock_getres50,
    else => private.clock_getres,
};

pub const clock_gettime = switch (native_os) {
    .netbsd => private.__clock_gettime50,
    else => private.clock_gettime,
};

pub const fstat = switch (native_os) {
    .macos => switch (native_arch) {
        .x86_64 => private.@"fstat$INODE64",
        else => private.fstat,
    },
    .netbsd => private.__fstat50,
    else => private.fstat,
};

pub const fstatat = switch (native_os) {
    .macos => switch (native_arch) {
        .x86_64 => private.@"fstatat$INODE64",
        else => private.fstatat,
    },
    else => private.fstatat,
};

pub extern "c" fn getpwnam(name: [*:0]const u8) ?*passwd;
pub extern "c" fn getpwuid(uid: uid_t) ?*passwd;
pub extern "c" fn getrlimit64(resource: rlimit_resource, rlim: *rlimit) c_int;
pub extern "c" fn lseek64(fd: fd_t, offset: i64, whence: c_int) i64;
pub extern "c" fn mmap64(addr: ?*align(page_size) anyopaque, len: usize, prot: c_uint, flags: c_uint, fd: fd_t, offset: i64) *anyopaque;
pub extern "c" fn open64(path: [*:0]const u8, oflag: O, ...) c_int;
pub extern "c" fn openat64(fd: c_int, path: [*:0]const u8, oflag: O, ...) c_int;
pub extern "c" fn pread64(fd: fd_t, buf: [*]u8, nbyte: usize, offset: i64) isize;
pub extern "c" fn preadv64(fd: c_int, iov: [*]const iovec, iovcnt: c_uint, offset: i64) isize;
pub extern "c" fn pwrite64(fd: fd_t, buf: [*]const u8, nbyte: usize, offset: i64) isize;
pub extern "c" fn pwritev64(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint, offset: i64) isize;
pub extern "c" fn sendfile64(out_fd: fd_t, in_fd: fd_t, offset: ?*i64, count: usize) isize;
pub extern "c" fn setrlimit64(resource: rlimit_resource, rlim: *const rlimit) c_int;

pub const arc4random_buf = switch (native_os) {
    .dragonfly, .netbsd, .freebsd, .solaris, .openbsd, .macos, .ios, .tvos, .watchos, .visionos => private.arc4random_buf,
    .linux => if (builtin.abi.isAndroid()) private.arc4random_buf else {},
    else => {},
};
pub const getentropy = switch (native_os) {
    .linux => if (builtin.abi.isAndroid() and versionCheck(.{ .major = 28, .minor = 0, .patch = 0 })) private.getentropy else {},
    .emscripten => private.getentropy,
    else => {},
};
pub const getrandom = switch (native_os) {
    .freebsd => private.getrandom,
    .linux => if (builtin.abi.isMusl() or
        (builtin.abi.isGnu() and versionCheck(.{ .major = 2, .minor = 25, .patch = 0 })) or
        (builtin.abi.isAndroid() and versionCheck(.{ .major = 28, .minor = 0, .patch = 0 })))
        private.getrandom
    else {},
    else => {},
};

pub extern "c" fn sched_getaffinity(pid: c_int, size: usize, set: *cpu_set_t) c_int;
pub extern "c" fn eventfd(initval: c_uint, flags: c_uint) c_int;

pub extern "c" fn epoll_ctl(epfd: fd_t, op: c_uint, fd: fd_t, event: ?*epoll_event) c_int;
pub extern "c" fn epoll_create1(flags: c_uint) c_int;
pub extern "c" fn epoll_wait(epfd: fd_t, events: [*]epoll_event, maxevents: c_uint, timeout: c_int) c_int;
pub extern "c" fn epoll_pwait(
    epfd: fd_t,
    events: [*]epoll_event,
    maxevents: c_int,
    timeout: c_int,
    sigmask: *const sigset_t,
) c_int;

pub extern "c" fn timerfd_create(clockid: timerfd_clockid_t, flags: c_int) c_int;
pub extern "c" fn timerfd_settime(
    fd: c_int,
    flags: c_int,
    new_value: *const itimerspec,
    old_value: ?*itimerspec,
) c_int;
pub extern "c" fn timerfd_gettime(fd: c_int, curr_value: *itimerspec) c_int;

pub extern "c" fn inotify_init1(flags: c_uint) c_int;
pub extern "c" fn inotify_add_watch(fd: fd_t, pathname: [*:0]const u8, mask: u32) c_int;
pub extern "c" fn inotify_rm_watch(fd: fd_t, wd: c_int) c_int;

pub extern "c" fn fstat64(fd: fd_t, buf: *Stat) c_int;
pub extern "c" fn fstatat64(dirfd: fd_t, noalias path: [*:0]const u8, noalias stat_buf: *Stat, flags: u32) c_int;
pub extern "c" fn fallocate64(fd: fd_t, mode: c_int, offset: off_t, len: off_t) c_int;
pub extern "c" fn fopen64(noalias filename: [*:0]const u8, noalias modes: [*:0]const u8) ?*FILE;
pub extern "c" fn ftruncate64(fd: c_int, length: off_t) c_int;
pub extern "c" fn fallocate(fd: fd_t, mode: c_int, offset: off_t, len: off_t) c_int;
pub const sendfile = switch (native_os) {
    .freebsd => freebsd.sendfile,
    .macos, .ios, .tvos, .watchos, .visionos => darwin.sendfile,
    .linux => private.sendfile,
    else => {},
};
/// See std.elf for constants for this
pub extern "c" fn getauxval(__type: c_ulong) c_ulong;

pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*anyopaque) c_int;

pub const sigaltstack = switch (native_os) {
    .netbsd => private.__sigaltstack14,
    else => private.sigaltstack,
};

pub extern "c" fn memfd_create(name: [*:0]const u8, flags: c_uint) c_int;
pub const pipe2 = switch (native_os) {
    .dragonfly, .emscripten, .netbsd, .freebsd, .solaris, .illumos, .openbsd, .linux => private.pipe2,
    else => {},
};
pub const copy_file_range = switch (native_os) {
    .linux => private.copy_file_range,
    .freebsd => freebsd.copy_file_range,
    else => {},
};

pub extern "c" fn signalfd(fd: fd_t, mask: *const sigset_t, flags: u32) c_int;

pub extern "c" fn prlimit(pid: pid_t, resource: rlimit_resource, new_limit: *const rlimit, old_limit: *rlimit) c_int;
pub extern "c" fn mincore(
    addr: *align(page_size) anyopaque,
    length: usize,
    vec: [*]u8,
) c_int;

pub extern "c" fn madvise(
    addr: *align(page_size) anyopaque,
    length: usize,
    advice: u32,
) c_int;

pub const getdirentries = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => private.__getdirentries64,
    else => private.getdirentries,
};

pub const getdents = switch (native_os) {
    .netbsd => private.__getdents30,
    else => private.getdents,
};

pub const getrusage = switch (native_os) {
    .netbsd => private.__getrusage50,
    else => private.getrusage,
};

pub const gettimeofday = switch (native_os) {
    .netbsd => private.__gettimeofday50,
    else => private.gettimeofday,
};

pub const msync = switch (native_os) {
    .netbsd => private.__msync13,
    else => private.msync,
};

pub const nanosleep = switch (native_os) {
    .netbsd => private.__nanosleep50,
    else => private.nanosleep,
};

pub const readdir = switch (native_os) {
    .macos => switch (native_arch) {
        .x86_64 => private.@"readdir$INODE64",
        else => private.readdir,
    },
    .windows => {},
    else => private.readdir,
};

pub const realpath = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => private.@"realpath$DARWIN_EXTSN",
    else => private.realpath,
};

pub const sched_yield = switch (native_os) {
    .netbsd => private.__libc_thr_yield,
    else => private.sched_yield,
};

pub const sigaction = switch (native_os) {
    .netbsd => private.__sigaction14,
    else => private.sigaction,
};

pub const sigfillset = switch (native_os) {
    .netbsd => private.__sigfillset14,
    else => private.sigfillset,
};

pub const sigprocmask = switch (native_os) {
    .netbsd => private.__sigprocmask14,
    else => private.sigprocmask,
};

pub const socket = switch (native_os) {
    .netbsd => private.__socket30,
    else => private.socket,
};

pub const stat = switch (native_os) {
    .macos => switch (native_arch) {
        .x86_64 => private.@"stat$INODE64",
        else => private.stat,
    },
    else => private.stat,
};

pub const _msize = switch (native_os) {
    .windows => private._msize,
    else => {},
};
pub const malloc_size = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => private.malloc_size,
    else => {},
};
pub const malloc_usable_size = switch (native_os) {
    .freebsd, .linux => private.malloc_usable_size,
    else => {},
};
pub const posix_memalign = switch (native_os) {
    .dragonfly, .netbsd, .freebsd, .solaris, .openbsd, .linux, .macos, .ios, .tvos, .watchos, .visionos => private.posix_memalign,
    else => {},
};
pub const sysconf = switch (native_os) {
    .solaris => solaris.sysconf,
    else => private.sysconf,
};

pub const sf_hdtr = switch (native_os) {
    .freebsd, .macos, .ios, .tvos, .watchos, .visionos => extern struct {
        headers: [*]const iovec_const,
        hdr_cnt: c_int,
        trailers: [*]const iovec_const,
        trl_cnt: c_int,
    },
    else => void,
};

pub const flock = switch (native_os) {
    .windows, .wasi => {},
    else => private.flock,
};

pub extern "c" var environ: [*:null]?[*:0]u8;

pub extern "c" fn fopen(noalias filename: [*:0]const u8, noalias modes: [*:0]const u8) ?*FILE;
pub extern "c" fn fclose(stream: *FILE) c_int;
pub extern "c" fn fwrite(noalias ptr: [*]const u8, size_of_type: usize, item_count: usize, noalias stream: *FILE) usize;
pub extern "c" fn fread(noalias ptr: [*]u8, size_of_type: usize, item_count: usize, noalias stream: *FILE) usize;

pub extern "c" fn printf(format: [*:0]const u8, ...) c_int;
pub extern "c" fn abort() noreturn;
pub extern "c" fn exit(code: c_int) noreturn;
pub extern "c" fn _exit(code: c_int) noreturn;
pub extern "c" fn isatty(fd: fd_t) c_int;
pub extern "c" fn lseek(fd: fd_t, offset: off_t, whence: whence_t) off_t;
pub extern "c" fn open(path: [*:0]const u8, oflag: O, ...) c_int;
pub extern "c" fn openat(fd: c_int, path: [*:0]const u8, oflag: O, ...) c_int;
pub extern "c" fn ftruncate(fd: c_int, length: off_t) c_int;
pub extern "c" fn raise(sig: c_int) c_int;
pub extern "c" fn read(fd: fd_t, buf: [*]u8, nbyte: usize) isize;
pub extern "c" fn readv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint) isize;
pub extern "c" fn pread(fd: fd_t, buf: [*]u8, nbyte: usize, offset: off_t) isize;
pub extern "c" fn preadv(fd: c_int, iov: [*]const iovec, iovcnt: c_uint, offset: off_t) isize;
pub extern "c" fn writev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint) isize;
pub extern "c" fn pwritev(fd: c_int, iov: [*]const iovec_const, iovcnt: c_uint, offset: off_t) isize;
pub extern "c" fn write(fd: fd_t, buf: [*]const u8, nbyte: usize) isize;
pub extern "c" fn pwrite(fd: fd_t, buf: [*]const u8, nbyte: usize, offset: off_t) isize;
pub extern "c" fn mmap(addr: ?*align(page_size) anyopaque, len: usize, prot: c_uint, flags: MAP, fd: fd_t, offset: off_t) *anyopaque;
pub extern "c" fn munmap(addr: *align(page_size) const anyopaque, len: usize) c_int;
pub extern "c" fn mremap(addr: ?*align(page_size) const anyopaque, old_len: usize, new_len: usize, flags: MREMAP, ...) *anyopaque;
pub extern "c" fn mprotect(addr: *align(page_size) anyopaque, len: usize, prot: c_uint) c_int;
pub extern "c" fn link(oldpath: [*:0]const u8, newpath: [*:0]const u8) c_int;
pub extern "c" fn linkat(oldfd: fd_t, oldpath: [*:0]const u8, newfd: fd_t, newpath: [*:0]const u8, flags: c_int) c_int;
pub extern "c" fn unlink(path: [*:0]const u8) c_int;
pub extern "c" fn unlinkat(dirfd: fd_t, path: [*:0]const u8, flags: c_uint) c_int;
pub extern "c" fn getcwd(buf: [*]u8, size: usize) ?[*]u8;
pub extern "c" fn waitpid(pid: pid_t, status: ?*c_int, options: c_int) pid_t;
pub extern "c" fn wait4(pid: pid_t, status: ?*c_int, options: c_int, ru: ?*rusage) pid_t;
pub const fork = switch (native_os) {
    .dragonfly,
    .freebsd,
    .ios,
    .linux,
    .macos,
    .netbsd,
    .openbsd,
    .solaris,
    .illumos,
    .tvos,
    .watchos,
    .visionos,
    .haiku,
    => private.fork,
    else => {},
};
pub extern "c" fn access(path: [*:0]const u8, mode: c_uint) c_int;
pub extern "c" fn faccessat(dirfd: fd_t, path: [*:0]const u8, mode: c_uint, flags: c_uint) c_int;
pub extern "c" fn pipe(fds: *[2]fd_t) c_int;
pub extern "c" fn mkdir(path: [*:0]const u8, mode: mode_t) c_int;
pub extern "c" fn mkdirat(dirfd: fd_t, path: [*:0]const u8, mode: mode_t) c_int;
pub extern "c" fn symlink(existing: [*:0]const u8, new: [*:0]const u8) c_int;
pub extern "c" fn symlinkat(oldpath: [*:0]const u8, newdirfd: fd_t, newpath: [*:0]const u8) c_int;
pub extern "c" fn rename(old: [*:0]const u8, new: [*:0]const u8) c_int;
pub extern "c" fn renameat(olddirfd: fd_t, old: [*:0]const u8, newdirfd: fd_t, new: [*:0]const u8) c_int;
pub extern "c" fn chdir(path: [*:0]const u8) c_int;
pub extern "c" fn fchdir(fd: fd_t) c_int;
pub extern "c" fn execve(path: [*:0]const u8, argv: [*:null]const ?[*:0]const u8, envp: [*:null]const ?[*:0]const u8) c_int;
pub extern "c" fn dup(fd: fd_t) c_int;
pub extern "c" fn dup2(old_fd: fd_t, new_fd: fd_t) c_int;
pub extern "c" fn dup3(old: c_int, new: c_int, flags: c_uint) c_int;
pub extern "c" fn readlink(noalias path: [*:0]const u8, noalias buf: [*]u8, bufsize: usize) isize;
pub extern "c" fn readlinkat(dirfd: fd_t, noalias path: [*:0]const u8, noalias buf: [*]u8, bufsize: usize) isize;
pub extern "c" fn chmod(path: [*:0]const u8, mode: mode_t) c_int;
pub extern "c" fn fchmod(fd: fd_t, mode: mode_t) c_int;
pub extern "c" fn fchmodat(fd: fd_t, path: [*:0]const u8, mode: mode_t, flags: c_uint) c_int;
pub extern "c" fn fchown(fd: fd_t, owner: uid_t, group: gid_t) c_int;
pub extern "c" fn umask(mode: mode_t) mode_t;

pub extern "c" fn rmdir(path: [*:0]const u8) c_int;
pub extern "c" fn getenv(name: [*:0]const u8) ?[*:0]u8;
pub extern "c" fn sysctl(name: [*]const c_int, namelen: c_uint, oldp: ?*anyopaque, oldlenp: ?*usize, newp: ?*anyopaque, newlen: usize) c_int;
pub extern "c" fn sysctlbyname(name: [*:0]const u8, oldp: ?*anyopaque, oldlenp: ?*usize, newp: ?*anyopaque, newlen: usize) c_int;
pub extern "c" fn sysctlnametomib(name: [*:0]const u8, mibp: ?*c_int, sizep: ?*usize) c_int;
pub extern "c" fn tcgetattr(fd: fd_t, termios_p: *termios) c_int;
pub extern "c" fn tcsetattr(fd: fd_t, optional_action: TCSA, termios_p: *const termios) c_int;
pub extern "c" fn fcntl(fd: fd_t, cmd: c_int, ...) c_int;
pub extern "c" fn ioctl(fd: fd_t, request: c_int, ...) c_int;
pub extern "c" fn uname(buf: *utsname) c_int;

pub extern "c" fn gethostname(name: [*]u8, len: usize) c_int;
pub extern "c" fn shutdown(socket: fd_t, how: c_int) c_int;
pub extern "c" fn bind(socket: fd_t, address: ?*const sockaddr, address_len: socklen_t) c_int;
pub extern "c" fn socketpair(domain: c_uint, sock_type: c_uint, protocol: c_uint, sv: *[2]fd_t) c_int;
pub extern "c" fn listen(sockfd: fd_t, backlog: c_uint) c_int;
pub extern "c" fn getsockname(sockfd: fd_t, noalias addr: *sockaddr, noalias addrlen: *socklen_t) c_int;
pub extern "c" fn getpeername(sockfd: fd_t, noalias addr: *sockaddr, noalias addrlen: *socklen_t) c_int;
pub extern "c" fn connect(sockfd: fd_t, sock_addr: *const sockaddr, addrlen: socklen_t) c_int;
pub extern "c" fn accept(sockfd: fd_t, noalias addr: ?*sockaddr, noalias addrlen: ?*socklen_t) c_int;
pub extern "c" fn accept4(sockfd: fd_t, noalias addr: ?*sockaddr, noalias addrlen: ?*socklen_t, flags: c_uint) c_int;
pub extern "c" fn getsockopt(sockfd: fd_t, level: i32, optname: u32, noalias optval: ?*anyopaque, noalias optlen: *socklen_t) c_int;
pub extern "c" fn setsockopt(sockfd: fd_t, level: i32, optname: u32, optval: ?*const anyopaque, optlen: socklen_t) c_int;
pub extern "c" fn send(sockfd: fd_t, buf: *const anyopaque, len: usize, flags: u32) isize;
pub extern "c" fn sendto(
    sockfd: fd_t,
    buf: *const anyopaque,
    len: usize,
    flags: u32,
    dest_addr: ?*const sockaddr,
    addrlen: socklen_t,
) isize;
pub extern "c" fn sendmsg(sockfd: fd_t, msg: *const msghdr_const, flags: u32) isize;

pub extern "c" fn recv(
    sockfd: fd_t,
    arg1: ?*anyopaque,
    arg2: usize,
    arg3: c_int,
) if (native_os == .windows) c_int else isize;
pub extern "c" fn recvfrom(
    sockfd: fd_t,
    noalias buf: *anyopaque,
    len: usize,
    flags: u32,
    noalias src_addr: ?*sockaddr,
    noalias addrlen: ?*socklen_t,
) if (native_os == .windows) c_int else isize;
pub extern "c" fn recvmsg(sockfd: fd_t, msg: *msghdr, flags: u32) isize;

pub extern "c" fn kill(pid: pid_t, sig: c_int) c_int;

pub extern "c" fn setuid(uid: uid_t) c_int;
pub extern "c" fn setgid(gid: gid_t) c_int;
pub extern "c" fn seteuid(euid: uid_t) c_int;
pub extern "c" fn setegid(egid: gid_t) c_int;
pub extern "c" fn setreuid(ruid: uid_t, euid: uid_t) c_int;
pub extern "c" fn setregid(rgid: gid_t, egid: gid_t) c_int;
pub extern "c" fn setresuid(ruid: uid_t, euid: uid_t, suid: uid_t) c_int;
pub extern "c" fn setresgid(rgid: gid_t, egid: gid_t, sgid: gid_t) c_int;
pub extern "c" fn setpgid(pid: pid_t, pgid: pid_t) c_int;

pub extern "c" fn malloc(usize) ?*anyopaque;
pub extern "c" fn calloc(usize, usize) ?*anyopaque;
pub extern "c" fn realloc(?*anyopaque, usize) ?*anyopaque;
pub extern "c" fn free(?*anyopaque) void;

pub extern "c" fn futimes(fd: fd_t, times: ?*[2]timeval) c_int;
pub extern "c" fn utimes(path: [*:0]const u8, times: ?*[2]timeval) c_int;

pub extern "c" fn utimensat(dirfd: fd_t, pathname: [*:0]const u8, times: ?*[2]timespec, flags: u32) c_int;
pub extern "c" fn futimens(fd: fd_t, times: ?*const [2]timespec) c_int;

pub extern "c" fn pthread_create(
    noalias newthread: *pthread_t,
    noalias attr: ?*const pthread_attr_t,
    start_routine: *const fn (?*anyopaque) callconv(.c) ?*anyopaque,
    noalias arg: ?*anyopaque,
) E;
pub extern "c" fn pthread_attr_init(attr: *pthread_attr_t) E;
pub extern "c" fn pthread_attr_setstack(attr: *pthread_attr_t, stackaddr: *anyopaque, stacksize: usize) E;
pub extern "c" fn pthread_attr_setstacksize(attr: *pthread_attr_t, stacksize: usize) E;
pub extern "c" fn pthread_attr_setguardsize(attr: *pthread_attr_t, guardsize: usize) E;
pub extern "c" fn pthread_attr_destroy(attr: *pthread_attr_t) E;
pub extern "c" fn pthread_self() pthread_t;
pub extern "c" fn pthread_join(thread: pthread_t, arg_return: ?*?*anyopaque) E;
pub extern "c" fn pthread_detach(thread: pthread_t) E;
pub extern "c" fn pthread_atfork(
    prepare: ?*const fn () callconv(.c) void,
    parent: ?*const fn () callconv(.c) void,
    child: ?*const fn () callconv(.c) void,
) c_int;
pub extern "c" fn pthread_key_create(
    key: *pthread_key_t,
    destructor: ?*const fn (value: *anyopaque) callconv(.c) void,
) E;
pub extern "c" fn pthread_key_delete(key: pthread_key_t) E;
pub extern "c" fn pthread_getspecific(key: pthread_key_t) ?*anyopaque;
pub extern "c" fn pthread_setspecific(key: pthread_key_t, value: ?*anyopaque) c_int;
pub extern "c" fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *sigset_t) c_int;
pub const pthread_setname_np = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => darwin.pthread_setname_np,
    .solaris, .illumos => solaris.pthread_setname_np,
    .netbsd => netbsd.pthread_setname_np,
    else => private.pthread_setname_np,
};

pub extern "c" fn pthread_getname_np(thread: pthread_t, name: [*:0]u8, len: usize) c_int;
pub const pthread_threadid_np = switch (native_os) {
    .macos, .ios, .tvos, .watchos, .visionos => private.pthread_threadid_np,
    else => {},
};

pub extern "c" fn sem_init(sem: *sem_t, pshared: c_int, value: c_uint) c_int;
pub extern "c" fn sem_destroy(sem: *sem_t) c_int;
pub extern "c" fn sem_open(name: [*:0]const u8, flag: c_int, mode: mode_t, value: c_uint) *sem_t;
pub extern "c" fn sem_close(sem: *sem_t) c_int;
pub extern "c" fn sem_post(sem: *sem_t) c_int;
pub extern "c" fn sem_wait(sem: *sem_t) c_int;
pub extern "c" fn sem_trywait(sem: *sem_t) c_int;
pub extern "c" fn sem_timedwait(sem: *sem_t, abs_timeout: *const timespec) c_int;
pub extern "c" fn sem_getvalue(sem: *sem_t, sval: *c_int) c_int;

pub extern "c" fn shm_open(name: [*:0]const u8, flag: c_int, mode: mode_t) c_int;
pub extern "c" fn shm_unlink(name: [*:0]const u8) c_int;

pub extern "c" fn kqueue() c_int;
pub extern "c" fn kevent(
    kq: c_int,
    changelist: [*]const Kevent,
    nchanges: c_int,
    eventlist: [*]Kevent,
    nevents: c_int,
    timeout: ?*const timespec,
) c_int;

pub extern "c" fn port_create() port_t;
pub extern "c" fn port_associate(
    port: port_t,
    source: u32,
    object: usize,
    events: u32,
    user_var: ?*anyopaque,
) c_int;
pub extern "c" fn port_dissociate(port: port_t, source: u32, object: usize) c_int;
pub extern "c" fn port_send(port: port_t, events: u32, user_var: ?*anyopaque) c_int;
pub extern "c" fn port_sendn(
    ports: [*]port_t,
    errors: []u32,
    num_ports: u32,
    events: u32,
    user_var: ?*anyopaque,
) c_int;
pub extern "c" fn port_get(port: port_t, event: *port_event, timeout: ?*timespec) c_int;
pub extern "c" fn port_getn(
    port: port_t,
    event_list: []port_event,
    max_events: u32,
    events_retrieved: *u32,
    timeout: ?*timespec,
) c_int;
pub extern "c" fn port_alert(port: port_t, flags: u32, events: u32, user_var: ?*anyopaque) c_int;

pub extern "c" fn getaddrinfo(
    noalias node: ?[*:0]const u8,
    noalias service: ?[*:0]const u8,
    noalias hints: ?*const addrinfo,
    /// On Linux, `res` will not be modified on error and `freeaddrinfo` will
    /// potentially crash if you pass it an undefined pointer
    noalias res: *?*addrinfo,
) EAI;

pub extern "c" fn freeaddrinfo(res: *addrinfo) void;

pub extern "c" fn getnameinfo(
    noalias addr: *const sockaddr,
    addrlen: socklen_t,
    noalias host: ?[*]u8,
    hostlen: socklen_t,
    noalias serv: ?[*]u8,
    servlen: socklen_t,
    flags: NI,
) EAI;

pub extern "c" fn gai_strerror(errcode: EAI) [*:0]const u8;

pub extern "c" fn poll(fds: [*]pollfd, nfds: nfds_t, timeout: c_int) c_int;
pub extern "c" fn ppoll(fds: [*]pollfd, nfds: nfds_t, timeout: ?*const timespec, sigmask: ?*const sigset_t) c_int;

pub extern "c" fn dn_expand(
    msg: [*:0]const u8,
    eomorig: [*:0]const u8,
    comp_dn: [*:0]const u8,
    exp_dn: [*:0]u8,
    length: c_int,
) c_int;

pub const PTHREAD_MUTEX_INITIALIZER = pthread_mutex_t{};
pub extern "c" fn pthread_mutex_lock(mutex: *pthread_mutex_t) E;
pub extern "c" fn pthread_mutex_unlock(mutex: *pthread_mutex_t) E;
pub extern "c" fn pthread_mutex_trylock(mutex: *pthread_mutex_t) E;
pub extern "c" fn pthread_mutex_destroy(mutex: *pthread_mutex_t) E;

pub const PTHREAD_COND_INITIALIZER = pthread_cond_t{};
pub extern "c" fn pthread_cond_wait(noalias cond: *pthread_cond_t, noalias mutex: *pthread_mutex_t) E;
pub extern "c" fn pthread_cond_timedwait(noalias cond: *pthread_cond_t, noalias mutex: *pthread_mutex_t, noalias abstime: *const timespec) E;
pub extern "c" fn pthread_cond_signal(cond: *pthread_cond_t) E;
pub extern "c" fn pthread_cond_broadcast(cond: *pthread_cond_t) E;
pub extern "c" fn pthread_cond_destroy(cond: *pthread_cond_t) E;

pub extern "c" fn pthread_rwlock_destroy(rwl: *pthread_rwlock_t) callconv(.c) E;
pub extern "c" fn pthread_rwlock_rdlock(rwl: *pthread_rwlock_t) callconv(.c) E;
pub extern "c" fn pthread_rwlock_wrlock(rwl: *pthread_rwlock_t) callconv(.c) E;
pub extern "c" fn pthread_rwlock_tryrdlock(rwl: *pthread_rwlock_t) callconv(.c) E;
pub extern "c" fn pthread_rwlock_trywrlock(rwl: *pthread_rwlock_t) callconv(.c) E;
pub extern "c" fn pthread_rwlock_unlock(rwl: *pthread_rwlock_t) callconv(.c) E;

pub const pthread_t = *opaque {};
pub const FILE = opaque {};

pub extern "c" fn dlopen(path: ?[*:0]const u8, mode: RTLD) ?*anyopaque;
pub extern "c" fn dlclose(handle: *anyopaque) c_int;
pub extern "c" fn dlsym(handle: ?*anyopaque, symbol: [*:0]const u8) ?*anyopaque;
pub extern "c" fn dlerror() ?[*:0]u8;

pub extern "c" fn sync() void;
pub extern "c" fn syncfs(fd: c_int) c_int;
pub extern "c" fn fsync(fd: c_int) c_int;
pub extern "c" fn fdatasync(fd: c_int) c_int;

pub extern "c" fn prctl(option: c_int, ...) c_int;

pub extern "c" fn getrlimit(resource: rlimit_resource, rlim: *rlimit) c_int;
pub extern "c" fn setrlimit(resource: rlimit_resource, rlim: *const rlimit) c_int;

pub extern "c" fn fmemopen(noalias buf: ?*anyopaque, size: usize, noalias mode: [*:0]const u8) ?*FILE;

pub extern "c" fn syslog(priority: c_int, message: [*:0]const u8, ...) void;
pub extern "c" fn openlog(ident: [*:0]const u8, logopt: c_int, facility: c_int) void;
pub extern "c" fn closelog() void;
pub extern "c" fn setlogmask(maskpri: c_int) c_int;

pub extern "c" fn if_nametoindex([*:0]const u8) c_int;

pub extern "c" fn getpid() pid_t;
pub extern "c" fn getppid() pid_t;

/// These are implementation defined but share identical values in at least musl and glibc:
/// - https://git.musl-libc.org/cgit/musl/tree/include/locale.h?id=ab31e9d6a0fa7c5c408856c89df2dfb12c344039#n18
/// - https://sourceware.org/git/?p=glibc.git;a=blob;f=locale/bits/locale.h;h=0fcbb66114be5fef0577dc9047256eb508c45919;hb=c90cfce849d010474e8cccf3e5bff49a2c8b141f#l26
pub const LC = enum(c_int) {
    CTYPE = 0,
    NUMERIC = 1,
    TIME = 2,
    COLLATE = 3,
    MONETARY = 4,
    MESSAGES = 5,
    ALL = 6,
    PAPER = 7,
    NAME = 8,
    ADDRESS = 9,
    TELEPHONE = 10,
    MEASUREMENT = 11,
    IDENTIFICATION = 12,
    _,
};

pub extern "c" fn setlocale(category: LC, locale: ?[*:0]const u8) ?[*:0]const u8;

pub const getcontext = if (builtin.target.abi.isAndroid() or builtin.target.os.tag == .openbsd)
{} // android bionic and openbsd libc does not implement getcontext
    else if (native_os == .linux and builtin.target.abi.isMusl())
        linux.getcontext
    else
        private.getcontext;

pub const max_align_t = if (native_abi == .msvc or native_abi == .itanium)
    f64
else if (native_os.isDarwin())
    c_longdouble
else
    extern struct {
        a: c_longlong,
        b: c_longdouble,
    };

pub extern "c" fn pthread_getthreadid_np() c_int;
pub extern "c" fn pthread_set_name_np(thread: pthread_t, name: [*:0]const u8) void;
pub extern "c" fn pthread_get_name_np(thread: pthread_t, name: [*:0]u8, len: usize) void;

// OS-specific bits. These are protected from being used on the wrong OS by
// comptime assertions inside each OS-specific file.

pub const AF_SUN = solaris.AF_SUN;
pub const AT_SUN = solaris.AT_SUN;
pub const FILE_EVENT = solaris.FILE_EVENT;
pub const GETCONTEXT = solaris.GETCONTEXT;
pub const GETUSTACK = solaris.GETUSTACK;
pub const PORT_ALERT = solaris.PORT_ALERT;
pub const PORT_SOURCE = solaris.PORT_SOURCE;
pub const POSIX_FADV = solaris.POSIX_FADV;
pub const SCM = solaris.SCM;
pub const SETCONTEXT = solaris.SETCONTEXT;
pub const SETUSTACK = solaris.GETUSTACK;
pub const SFD = solaris.SFD;
pub const cmsghdr = solaris.cmsghdr;
pub const ctid_t = solaris.ctid_t;
pub const file_obj = solaris.file_obj;
pub const fpregset_t = solaris.fpregset_t;
pub const id_t = solaris.id_t;
pub const lif_ifinfo_req = solaris.lif_ifinfo_req;
pub const lif_nd_req = solaris.lif_nd_req;
pub const lifreq = solaris.lifreq;
pub const major_t = solaris.major_t;
pub const minor_t = solaris.minor_t;
pub const poolid_t = solaris.poolid_t;
pub const port_notify = solaris.port_notify;
pub const priority = solaris.priority;
pub const procfs = solaris.procfs;
pub const projid_t = solaris.projid_t;
pub const signalfd_siginfo = solaris.signalfd_siginfo;
pub const taskid_t = solaris.taskid_t;
pub const zoneid_t = solaris.zoneid_t;

pub const DirEnt = haiku.DirEnt;
pub const _get_next_area_info = haiku._get_next_area_info;
pub const _get_next_image_info = haiku._get_next_image_info;
pub const _get_team_info = haiku._get_team_info;
pub const _kern_get_current_team = haiku._kern_get_current_team;
pub const _kern_open_dir = haiku._kern_open_dir;
pub const _kern_read_dir = haiku._kern_read_dir;
pub const _kern_read_stat = haiku._kern_read_stat;
pub const _kern_rewind_dir = haiku._kern_rewind_dir;
pub const area_id = haiku.area_id;
pub const area_info = haiku.area_info;
pub const directory_which = haiku.directory_which;
pub const find_directory = haiku.find_directory;
pub const find_thread = haiku.find_thread;
pub const get_system_info = haiku.get_system_info;
pub const image_info = haiku.image_info;
pub const port_id = haiku.port_id;
pub const sem_id = haiku.sem_id;
pub const status_t = haiku.status_t;
pub const system_info = haiku.system_info;
pub const team_id = haiku.team_id;
pub const team_info = haiku.team_info;
pub const thread_id = haiku.thread_id;

pub const AUTH = openbsd.AUTH;
pub const BI = openbsd.BI;
pub const FUTEX = openbsd.FUTEX;
pub const HW = openbsd.HW;
pub const PTHREAD_STACK_MIN = openbsd.PTHREAD_STACK_MIN;
pub const TCFLUSH = openbsd.TCFLUSH;
pub const TCIO = openbsd.TCIO;
pub const auth_approval = openbsd.auth_approval;
pub const auth_call = openbsd.auth_call;
pub const auth_cat = openbsd.auth_cat;
pub const auth_challenge = openbsd.auth_challenge;
pub const auth_check_change = openbsd.auth_check_change;
pub const auth_check_expire = openbsd.auth_check_expire;
pub const auth_checknologin = openbsd.auth_checknologin;
pub const auth_clean = openbsd.auth_clean;
pub const auth_close = openbsd.auth_close;
pub const auth_clrenv = openbsd.auth_clrenv;
pub const auth_clroption = openbsd.auth_clroption;
pub const auth_clroptions = openbsd.auth_clroptions;
pub const auth_getitem = openbsd.auth_getitem;
pub const auth_getpwd = openbsd.auth_getpwd;
pub const auth_getstate = openbsd.auth_getstate;
pub const auth_getvalue = openbsd.auth_getvalue;
pub const auth_item_t = openbsd.auth_item_t;
pub const auth_mkvalue = openbsd.auth_mkvalue;
pub const auth_open = openbsd.auth_open;
pub const auth_session_t = openbsd.auth_session_t;
pub const auth_setdata = openbsd.auth_setdata;
pub const auth_setenv = openbsd.auth_setenv;
pub const auth_setitem = openbsd.auth_setitem;
pub const auth_setoption = openbsd.auth_setoption;
pub const auth_setpwd = openbsd.auth_setpwd;
pub const auth_setstate = openbsd.auth_setstate;
pub const auth_userchallenge = openbsd.auth_userchallenge;
pub const auth_usercheck = openbsd.auth_usercheck;
pub const auth_userokay = openbsd.auth_userokay;
pub const auth_userresponse = openbsd.auth_userresponse;
pub const auth_verify = openbsd.auth_verify;
pub const bcrypt = openbsd.bcrypt;
pub const bcrypt_checkpass = openbsd.bcrypt_checkpass;
pub const bcrypt_gensalt = openbsd.bcrypt_gensalt;
pub const bcrypt_newhash = openbsd.bcrypt_newhash;
pub const endpwent = openbsd.endpwent;
pub const futex = openbsd.futex;
pub const getpwent = openbsd.getpwent;
pub const getpwnam_r = openbsd.getpwnam_r;
pub const getpwnam_shadow = openbsd.getpwnam_shadow;
pub const getpwuid_r = openbsd.getpwuid_r;
pub const getpwuid_shadow = openbsd.getpwuid_shadow;
pub const getthrid = openbsd.getthrid;
pub const login_cap_t = openbsd.login_cap_t;
pub const login_close = openbsd.login_close;
pub const login_getcapbool = openbsd.login_getcapbool;
pub const login_getcapnum = openbsd.login_getcapnum;
pub const login_getcapsize = openbsd.login_getcapsize;
pub const login_getcapstr = openbsd.login_getcapstr;
pub const login_getcaptime = openbsd.login_getcaptime;
pub const login_getclass = openbsd.login_getclass;
pub const login_getstyle = openbsd.login_getstyle;
pub const pledge = openbsd.pledge;
pub const pthread_spinlock_t = openbsd.pthread_spinlock_t;
pub const pw_dup = openbsd.pw_dup;
pub const setclasscontext = openbsd.setclasscontext;
pub const setpassent = openbsd.setpassent;
pub const setpwent = openbsd.setpwent;
pub const setusercontext = openbsd.setusercontext;
pub const uid_from_user = openbsd.uid_from_user;
pub const unveil = openbsd.unveil;
pub const user_from_uid = openbsd.user_from_uid;

pub const CAP_RIGHTS_VERSION = freebsd.CAP_RIGHTS_VERSION;
pub const KINFO_FILE_SIZE = freebsd.KINFO_FILE_SIZE;
pub const MFD = freebsd.MFD;
pub const UMTX_ABSTIME = freebsd.UMTX_ABSTIME;
pub const UMTX_OP = freebsd.UMTX_OP;
pub const _umtx_op = freebsd._umtx_op;
pub const _umtx_time = freebsd._umtx_time;
pub const cap_rights = freebsd.cap_rights;
pub const fflags_t = freebsd.fflags_t;
pub const fsblkcnt_t = freebsd.fsblkcnt_t;
pub const fsfilcnt_t = freebsd.fsfilcnt_t;
pub const kinfo_file = freebsd.kinfo_file;
pub const kinfo_getfile = freebsd.kinfo_getfile;

pub const COPYFILE = darwin.COPYFILE;
pub const CPUFAMILY = darwin.CPUFAMILY;
pub const DB_RECORDTYPE = darwin.DB_RECORDTYPE;
pub const EXC = darwin.EXC;
pub const EXCEPTION = darwin.EXCEPTION;
pub const MACH_MSG_TYPE = darwin.MACH_MSG_TYPE;
pub const MACH_PORT_RIGHT = darwin.MACH_PORT_RIGHT;
pub const MACH_TASK_BASIC_INFO = darwin.MACH_TASK_BASIC_INFO;
pub const MACH_TASK_BASIC_INFO_COUNT = darwin.MACH_TASK_BASIC_INFO_COUNT;
pub const MATTR = darwin.MATTR;
pub const NSVersionOfRunTimeLibrary = darwin.NSVersionOfRunTimeLibrary;
pub const OPEN_MAX = darwin.OPEN_MAX;
pub const POSIX_SPAWN = darwin.POSIX_SPAWN;
pub const TASK_NULL = darwin.TASK_NULL;
pub const TASK_VM_INFO = darwin.TASK_VM_INFO;
pub const TASK_VM_INFO_COUNT = darwin.TASK_VM_INFO_COUNT;
pub const THREAD_BASIC_INFO = darwin.THREAD_BASIC_INFO;
pub const THREAD_BASIC_INFO_COUNT = darwin.THREAD_BASIC_INFO_COUNT;
pub const THREAD_IDENTIFIER_INFO_COUNT = darwin.THREAD_IDENTIFIER_INFO_COUNT;
pub const THREAD_NULL = darwin.THREAD_NULL;
pub const THREAD_STATE_NONE = darwin.THREAD_STATE_NONE;
pub const UL = darwin.UL;
pub const VM = darwin.VM;
pub const _NSGetExecutablePath = darwin._NSGetExecutablePath;
pub const __getdirentries64 = darwin.__getdirentries64;
pub const __ulock_wait = darwin.__ulock_wait;
pub const __ulock_wait2 = darwin.__ulock_wait2;
pub const __ulock_wake = darwin.__ulock_wake;
pub const _dyld_get_image_header = darwin._dyld_get_image_header;
pub const _dyld_get_image_name = darwin._dyld_get_image_name;
pub const _dyld_get_image_vmaddr_slide = darwin._dyld_get_image_vmaddr_slide;
pub const _dyld_image_count = darwin._dyld_image_count;
pub const _host_page_size = darwin._host_page_size;
pub const clock_get_time = darwin.clock_get_time;
pub const @"close$NOCANCEL" = darwin.@"close$NOCANCEL";
pub const dispatch_release = darwin.dispatch_release;
pub const dispatch_semaphore_create = darwin.dispatch_semaphore_create;
pub const dispatch_semaphore_signal = darwin.dispatch_semaphore_signal;
pub const dispatch_semaphore_wait = darwin.dispatch_semaphore_wait;
pub const dispatch_time = darwin.dispatch_time;
pub const fcopyfile = darwin.fcopyfile;
pub const host_t = darwin.host_t;
pub const ipc_space_t = darwin.ipc_space_t;
pub const ipc_space_port_t = darwin.ipc_space_port_t;
pub const kern_return_t = darwin.kern_return_t;
pub const vm_size_t = darwin.vm_size_t;
pub const kevent64 = darwin.kevent64;
pub const kevent64_s = darwin.kevent64_s;
pub const mach_absolute_time = darwin.mach_absolute_time;
pub const mach_continuous_time = darwin.mach_continuous_time;
pub const mach_hdr = darwin.mach_hdr;
pub const mach_host_self = darwin.mach_host_self;
pub const mach_msg = darwin.mach_msg;
pub const mach_msg_type_number_t = darwin.mach_msg_type_number_t;
pub const mach_port_allocate = darwin.mach_port_allocate;
pub const mach_port_array_t = darwin.mach_port_array_t;
pub const mach_port_deallocate = darwin.mach_port_deallocate;
pub const mach_port_insert_right = darwin.mach_port_insert_right;
pub const mach_port_name_t = darwin.mach_port_name_t;
pub const mach_port_t = darwin.mach_port_t;
pub const mach_task_basic_info = darwin.mach_task_basic_info;
pub const mach_task_self = darwin.mach_task_self;
pub const mach_timebase_info = darwin.mach_timebase_info;
pub const mach_timebase_info_data = darwin.mach_timebase_info_data;
pub const mach_vm_address_t = darwin.mach_vm_address_t;
pub const mach_vm_protect = darwin.mach_vm_protect;
pub const mach_vm_read = darwin.mach_vm_read;
pub const mach_vm_region = darwin.mach_vm_region;
pub const mach_vm_region_recurse = darwin.mach_vm_region_recurse;
pub const mach_vm_size_t = darwin.mach_vm_size_t;
pub const mach_vm_write = darwin.mach_vm_write;
pub const natural_t = darwin.natural_t;
pub const os_log_create = darwin.os_log_create;
pub const os_log_type_enabled = darwin.os_log_type_enabled;
pub const os_signpost_enabled = darwin.os_signpost_enabled;
pub const os_signpost_id_generate = darwin.os_signpost_id_generate;
pub const os_signpost_id_make_with_pointer = darwin.os_signpost_id_make_with_pointer;
pub const os_signpost_interval_begin = darwin.os_signpost_interval_begin;
pub const os_signpost_interval_end = darwin.os_signpost_interval_end;
pub const os_unfair_lock = darwin.os_unfair_lock;
pub const os_unfair_lock_assert_not_owner = darwin.os_unfair_lock_assert_not_owner;
pub const os_unfair_lock_assert_owner = darwin.os_unfair_lock_assert_owner;
pub const os_unfair_lock_lock = darwin.os_unfair_lock_lock;
pub const os_unfair_lock_trylock = darwin.os_unfair_lock_trylock;
pub const os_unfair_lock_unlock = darwin.os_unfair_lock_unlock;
pub const pid_for_task = darwin.pid_for_task;
pub const posix_spawn = darwin.posix_spawn;
pub const posix_spawn_file_actions_addchdir_np = darwin.posix_spawn_file_actions_addchdir_np;
pub const posix_spawn_file_actions_addclose = darwin.posix_spawn_file_actions_addclose;
pub const posix_spawn_file_actions_adddup2 = darwin.posix_spawn_file_actions_adddup2;
pub const posix_spawn_file_actions_addfchdir_np = darwin.posix_spawn_file_actions_addfchdir_np;
pub const posix_spawn_file_actions_addinherit_np = darwin.posix_spawn_file_actions_addinherit_np;
pub const posix_spawn_file_actions_addopen = darwin.posix_spawn_file_actions_addopen;
pub const posix_spawn_file_actions_destroy = darwin.posix_spawn_file_actions_destroy;
pub const posix_spawn_file_actions_init = darwin.posix_spawn_file_actions_init;
pub const posix_spawn_file_actions_t = darwin.posix_spawn_file_actions_t;
pub const posix_spawnattr_destroy = darwin.posix_spawnattr_destroy;
pub const posix_spawnattr_getflags = darwin.posix_spawnattr_getflags;
pub const posix_spawnattr_init = darwin.posix_spawnattr_init;
pub const posix_spawnattr_setflags = darwin.posix_spawnattr_setflags;
pub const posix_spawnattr_t = darwin.posix_spawnattr_t;
pub const posix_spawnp = darwin.posix_spawnp;
pub const pthread_attr_get_qos_class_np = darwin.pthread_attr_get_qos_class_np;
pub const pthread_attr_set_qos_class_np = darwin.pthread_attr_set_qos_class_np;
pub const pthread_get_qos_class_np = darwin.pthread_get_qos_class_np;
pub const pthread_set_qos_class_self_np = darwin.pthread_set_qos_class_self_np;
pub const ptrace = darwin.ptrace;
pub const sigaddset = darwin.sigaddset;
pub const task_for_pid = darwin.task_for_pid;
pub const task_get_exception_ports = darwin.task_get_exception_ports;
pub const task_info = darwin.task_info;
pub const task_info_t = darwin.task_info_t;
pub const task_resume = darwin.task_resume;
pub const task_set_exception_ports = darwin.task_set_exception_ports;
pub const task_suspend = darwin.task_suspend;
pub const task_threads = darwin.task_threads;
pub const task_vm_info_data_t = darwin.task_vm_info_data_t;
pub const thread_basic_info = darwin.thread_basic_info;
pub const thread_get_state = darwin.thread_get_state;
pub const thread_identifier_info = darwin.thread_identifier_info;
pub const thread_info = darwin.thread_info;
pub const thread_info_t = darwin.thread_info_t;
pub const thread_resume = darwin.thread_resume;
pub const thread_set_state = darwin.thread_set_state;
pub const vm_deallocate = darwin.vm_deallocate;
pub const vm_machine_attribute = darwin.vm_machine_attribute;
pub const vm_machine_attribute_val_t = darwin.vm_machine_attribute_val_t;
pub const vm_map_t = darwin.vm_map_t;
pub const vm_offset_t = darwin.vm_offset_t;
pub const vm_prot_t = darwin.vm_prot_t;
pub const vm_region_basic_info_64 = darwin.vm_region_basic_info_64;
pub const vm_region_extended_info = darwin.vm_region_extended_info;
pub const vm_region_info_t = darwin.vm_region_info_t;
pub const vm_region_recurse_info_t = darwin.vm_region_recurse_info_t;
pub const vm_region_submap_info_64 = darwin.vm_region_submap_info_64;
pub const vm_region_submap_short_info_64 = darwin.vm_region_submap_short_info_64;
pub const vm_region_top_info = darwin.vm_region_top_info;

pub const caddr_t = darwin.caddr_t;
pub const exception_behavior_array_t = darwin.exception_behavior_array_t;
pub const exception_behavior_t = darwin.exception_behavior_t;
pub const exception_data_t = darwin.exception_data_t;
pub const exception_data_type_t = darwin.exception_data_type_t;
pub const exception_flavor_array_t = darwin.exception_flavor_array_t;
pub const exception_handler_array_t = darwin.exception_handler_array_t;
pub const exception_handler_t = darwin.exception_handler_t;
pub const exception_mask_array_t = darwin.exception_mask_array_t;
pub const exception_mask_t = darwin.exception_mask_t;
pub const exception_port_array_t = darwin.exception_port_array_t;
pub const exception_port_t = darwin.exception_port_t;
pub const mach_exception_data_t = darwin.mach_exception_data_t;
pub const mach_exception_data_type_t = darwin.mach_exception_data_type_t;
pub const mach_msg_bits_t = darwin.mach_msg_bits_t;
pub const mach_msg_id_t = darwin.mach_msg_id_t;
pub const mach_msg_option_t = darwin.mach_msg_option_t;
pub const mach_msg_size_t = darwin.mach_msg_size_t;
pub const mach_msg_timeout_t = darwin.mach_msg_timeout_t;
pub const mach_msg_type_name_t = darwin.mach_msg_type_name_t;
pub const mach_port_right_t = darwin.mach_port_right_t;
pub const memory_object_offset_t = darwin.memory_object_offset_t;
pub const policy_t = darwin.policy_t;
pub const task_policy_flavor_t = darwin.task_policy_flavor_t;
pub const task_policy_t = darwin.task_policy_t;
pub const task_t = darwin.task_t;
pub const thread_act_t = darwin.thread_act_t;
pub const thread_flavor_t = darwin.thread_flavor_t;
pub const thread_port_t = darwin.thread_port_t;
pub const thread_state_flavor_t = darwin.thread_state_flavor_t;
pub const thread_state_t = darwin.thread_state_t;
pub const thread_t = darwin.thread_t;
pub const time_value_t = darwin.time_value_t;
pub const vm32_object_id_t = darwin.vm32_object_id_t;
pub const vm_behavior_t = darwin.vm_behavior_t;
pub const vm_inherit_t = darwin.vm_inherit_t;
pub const vm_map_read_t = darwin.vm_map_read_t;
pub const vm_object_id_t = darwin.vm_object_id_t;
pub const vm_region_flavor_t = darwin.vm_region_flavor_t;

pub const _ksiginfo = netbsd._ksiginfo;
pub const _lwp_self = netbsd._lwp_self;
pub const lwpid_t = netbsd.lwpid_t;

pub const lwp_gettid = dragonfly.lwp_gettid;
pub const umtx_sleep = dragonfly.umtx_sleep;
pub const umtx_wakeup = dragonfly.umtx_wakeup;

/// External definitions shared by two or more operating systems.
const private = struct {
    extern "c" fn close(fd: fd_t) c_int;
    extern "c" fn clock_getres(clk_id: clockid_t, tp: *timespec) c_int;
    extern "c" fn clock_gettime(clk_id: clockid_t, tp: *timespec) c_int;
    extern "c" fn copy_file_range(fd_in: fd_t, off_in: ?*i64, fd_out: fd_t, off_out: ?*i64, len: usize, flags: c_uint) isize;
    extern "c" fn flock(fd: fd_t, operation: c_int) c_int;
    extern "c" fn fork() c_int;
    extern "c" fn fstat(fd: fd_t, buf: *Stat) c_int;
    extern "c" fn fstatat(dirfd: fd_t, path: [*:0]const u8, buf: *Stat, flag: u32) c_int;
    extern "c" fn getdirentries(fd: fd_t, buf_ptr: [*]u8, nbytes: usize, basep: *i64) isize;
    extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) switch (native_os) {
        .freebsd => isize,
        .solaris, .illumos => usize,
        else => c_int,
    };
    extern "c" fn getrusage(who: c_int, usage: *rusage) c_int;
    extern "c" fn gettimeofday(noalias tv: ?*timeval, noalias tz: ?*timezone) c_int;
    extern "c" fn msync(addr: *align(page_size) const anyopaque, len: usize, flags: c_int) c_int;
    extern "c" fn nanosleep(rqtp: *const timespec, rmtp: ?*timespec) c_int;
    extern "c" fn pipe2(fds: *[2]fd_t, flags: O) c_int;
    extern "c" fn readdir(dir: *DIR) ?*dirent;
    extern "c" fn realpath(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8;
    extern "c" fn sched_yield() c_int;
    extern "c" fn sendfile(out_fd: fd_t, in_fd: fd_t, offset: ?*off_t, count: usize) isize;
    extern "c" fn sigaction(sig: c_int, noalias act: ?*const Sigaction, noalias oact: ?*Sigaction) c_int;
    extern "c" fn sigfillset(set: ?*sigset_t) void;
    extern "c" fn sigprocmask(how: c_int, noalias set: ?*const sigset_t, noalias oset: ?*sigset_t) c_int;
    extern "c" fn socket(domain: c_uint, sock_type: c_uint, protocol: c_uint) c_int;
    extern "c" fn stat(noalias path: [*:0]const u8, noalias buf: *Stat) c_int;
    extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int;
    extern "c" fn sysconf(sc: c_int) c_long;

    extern "c" fn pthread_setname_np(thread: pthread_t, name: [*:0]const u8) c_int;
    extern "c" fn getcontext(ucp: *ucontext_t) c_int;

    extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize;
    extern "c" fn getentropy(buffer: [*]u8, size: usize) c_int;
    extern "c" fn arc4random_buf(buf: [*]u8, len: usize) void;

    extern "c" fn _msize(memblock: ?*anyopaque) usize;
    extern "c" fn malloc_size(?*const anyopaque) usize;
    extern "c" fn malloc_usable_size(?*const anyopaque) usize;
    extern "c" fn posix_memalign(memptr: *?*anyopaque, alignment: usize, size: usize) c_int;

    /// macos modernized symbols.
    /// x86_64 links to $INODE64 suffix for 64-bit support.
    /// Note these are not necessary on aarch64.
    extern "c" fn @"fstat$INODE64"(fd: fd_t, buf: *Stat) c_int;
    extern "c" fn @"fstatat$INODE64"(dirfd: fd_t, path: [*:0]const u8, buf: *Stat, flag: u32) c_int;
    extern "c" fn @"readdir$INODE64"(dir: *DIR) ?*dirent;
    extern "c" fn @"stat$INODE64"(noalias path: [*:0]const u8, noalias buf: *Stat) c_int;

    /// macos modernized symbols.
    extern "c" fn @"realpath$DARWIN_EXTSN"(noalias file_name: [*:0]const u8, noalias resolved_name: [*]u8) ?[*:0]u8;
    extern "c" fn __getdirentries64(fd: fd_t, buf_ptr: [*]u8, buf_len: usize, basep: *i64) isize;

    extern "c" fn pthread_threadid_np(thread: ?pthread_t, thread_id: *u64) c_int;

    /// netbsd modernized symbols.
    extern "c" fn __clock_getres50(clk_id: clockid_t, tp: *timespec) c_int;
    extern "c" fn __clock_gettime50(clk_id: clockid_t, tp: *timespec) c_int;
    extern "c" fn __fstat50(fd: fd_t, buf: *Stat) c_int;
    extern "c" fn __getrusage50(who: c_int, usage: *rusage) c_int;
    extern "c" fn __gettimeofday50(noalias tv: ?*timeval, noalias tz: ?*timezone) c_int;
    extern "c" fn __libc_thr_yield() c_int;
    extern "c" fn __msync13(addr: *align(page_size) const anyopaque, len: usize, flags: c_int) c_int;
    extern "c" fn __nanosleep50(rqtp: *const timespec, rmtp: ?*timespec) c_int;
    extern "c" fn __sigaction14(sig: c_int, noalias act: ?*const Sigaction, noalias oact: ?*Sigaction) c_int;
    extern "c" fn __sigfillset14(set: ?*sigset_t) void;
    extern "c" fn __sigprocmask14(how: c_int, noalias set: ?*const sigset_t, noalias oset: ?*sigset_t) c_int;
    extern "c" fn __socket30(domain: c_uint, sock_type: c_uint, protocol: c_uint) c_int;
    extern "c" fn __stat50(path: [*:0]const u8, buf: *Stat) c_int;
    extern "c" fn __getdents30(fd: c_int, buf_ptr: [*]u8, nbytes: usize) c_int;
    extern "c" fn __sigaltstack14(ss: ?*stack_t, old_ss: ?*stack_t) c_int;

    // Don't forget to add another clown when an OS picks yet another unique
    // symbol name for errno location!
    // 🤡🤡🤡🤡🤡🤡

    extern "c" fn ___errno() *c_int;
    extern "c" fn __errno() *c_int;
    extern "c" fn __errno_location() *c_int;
    extern "c" fn __error() *c_int;
    extern "c" fn _errno() *c_int;

    extern threadlocal var errno: c_int;

    fn errnoFromThreadLocal() *c_int {
        return &errno;
    }
};