zig/lib/std / os/emscripten.zig

This is also the error code used for WOULDBLOCK.

const std = @import("std");
const builtin = @import("builtin");
const wasi = std.os.wasi;
const iovec = std.posix.iovec;
const iovec_const = std.posix.iovec_const;
const c = std.c;

FILE

This is also the code used for NOTSUP.


pub const FILE = c.FILE;

PF

IPv4 socket address


var __stack_chk_guard: usize = 0;
fn __stack_chk_fail() callconv(.C) void {
    std.debug.print("stack smashing detected: terminated\n", .{});
    emscripten_force_exit(127);

empty_sigset

IPv6 socket address

}

LOCAL

UNIX domain socket address


comptime {
    if (builtin.os.tag == .emscripten) {
        if (builtin.mode == .Debug or builtin.mode == .ReleaseSafe) {
            // Emscripten does not provide these symbols, so we must export our own
            @export(__stack_chk_guard, .{ .name = "__stack_chk_guard", .linkage = .strong });
            @export(__stack_chk_fail, .{ .name = "__stack_chk_fail", .linkage = .strong });
        }
    }

empty_sigset

Packet socket address

}

FILE

Netlink socket address


pub const PF = struct {
    pub const UNSPEC = 0;
    pub const LOCAL = 1;
    pub const UNIX = LOCAL;
    pub const FILE = LOCAL;

INET

port ID

    pub const INET = 2;

AX25

multicast groups mask

    pub const AX25 = 3;

IPX

Address structure for vSockets

    pub const IPX = 4;

APPLETALK

The total size of this structure should be exactly the same as that of struct sockaddr.

    pub const APPLETALK = 5;

NETROM

    pub const NETROM = 6;

BRIDGE

    pub const BRIDGE = 7;

ATMPVC

    pub const ATMPVC = 8;

X25

    pub const X25 = 9;

INET6

    pub const INET6 = 10;

ROSE

    pub const ROSE = 11;

DECnet

    pub const DECnet = 12;

NETBEUI

    pub const NETBEUI = 13;

SECURITY

    pub const SECURITY = 14;

KEY

    pub const KEY = 15;

NETLINK

    pub const NETLINK = 16;

ROUTE

    pub const ROUTE = PF.NETLINK;

PACKET

    pub const PACKET = 17;

ASH

    pub const ASH = 18;

ECONET

    pub const ECONET = 19;

ATMSVC

    pub const ATMSVC = 20;

RDS

    pub const RDS = 21;

SNA

    pub const SNA = 22;

IRDA

    pub const IRDA = 23;

PPPOX

    pub const PPPOX = 24;

WANPIPE

    pub const WANPIPE = 25;

LLC

    pub const LLC = 26;

IB

    pub const IB = 27;

MPLS

    pub const MPLS = 28;

CAN

    pub const CAN = 29;

TIPC

    pub const TIPC = 30;

BLUETOOTH

    pub const BLUETOOTH = 31;

IUCV

    pub const IUCV = 32;

RXRPC

    pub const RXRPC = 33;

ISDN

    pub const ISDN = 34;

PHONET

    pub const PHONET = 35;

IEEE802154

    pub const IEEE802154 = 36;

CAIF

    pub const CAIF = 37;

ALG

    pub const ALG = 38;

NFC

    pub const NFC = 39;

VSOCK

    pub const VSOCK = 40;

KCM

    pub const KCM = 41;

QIPCRTR

    pub const QIPCRTR = 42;

SMC

    pub const SMC = 43;

XDP

    pub const XDP = 44;

MAX

    pub const MAX = 45;

struct__em_promise

};

UNSPEC


pub const AF = struct {
    pub const UNSPEC = PF.UNSPEC;

LOCAL

    pub const LOCAL = PF.LOCAL;

UNIX

    pub const UNIX = AF.LOCAL;

FILE

    pub const FILE = AF.LOCAL;

INET

    pub const INET = PF.INET;

AX25

    pub const AX25 = PF.AX25;

IPX

    pub const IPX = PF.IPX;

APPLETALK

    pub const APPLETALK = PF.APPLETALK;

NETROM

    pub const NETROM = PF.NETROM;

BRIDGE

    pub const BRIDGE = PF.BRIDGE;

ATMPVC

    pub const ATMPVC = PF.ATMPVC;

X25

    pub const X25 = PF.X25;

INET6

    pub const INET6 = PF.INET6;

ROSE

    pub const ROSE = PF.ROSE;

DECnet

    pub const DECnet = PF.DECnet;

NETBEUI

    pub const NETBEUI = PF.NETBEUI;

SECURITY

    pub const SECURITY = PF.SECURITY;

KEY

    pub const KEY = PF.KEY;

NETLINK

    pub const NETLINK = PF.NETLINK;

ROUTE

    pub const ROUTE = PF.ROUTE;

PACKET

    pub const PACKET = PF.PACKET;

ASH

    pub const ASH = PF.ASH;

ECONET

    pub const ECONET = PF.ECONET;

ATMSVC

    pub const ATMSVC = PF.ATMSVC;

RDS

    pub const RDS = PF.RDS;

SNA

    pub const SNA = PF.SNA;

IRDA

    pub const IRDA = PF.IRDA;

PPPOX

    pub const PPPOX = PF.PPPOX;

WANPIPE

    pub const WANPIPE = PF.WANPIPE;

LLC

    pub const LLC = PF.LLC;

IB

    pub const IB = PF.IB;

MPLS

    pub const MPLS = PF.MPLS;

CAN

    pub const CAN = PF.CAN;

TIPC

    pub const TIPC = PF.TIPC;

BLUETOOTH

    pub const BLUETOOTH = PF.BLUETOOTH;

IUCV

    pub const IUCV = PF.IUCV;

RXRPC

    pub const RXRPC = PF.RXRPC;

ISDN

    pub const ISDN = PF.ISDN;

PHONET

    pub const PHONET = PF.PHONET;

IEEE802154

    pub const IEEE802154 = PF.IEEE802154;

CAIF

    pub const CAIF = PF.CAIF;

ALG

    pub const ALG = PF.ALG;

NFC

    pub const NFC = PF.NFC;

VSOCK

    pub const VSOCK = PF.VSOCK;

KCM

    pub const KCM = PF.KCM;

QIPCRTR

    pub const QIPCRTR = PF.QIPCRTR;

SMC

    pub const SMC = PF.SMC;

XDP

    pub const XDP = PF.XDP;

MAX

    pub const MAX = PF.MAX;

struct__em_promise

};

REALTIME


pub const CLOCK = struct {
    pub const REALTIME = 0;

MONOTONIC

    pub const MONOTONIC = 1;

PROCESS_CPUTIME_ID

    pub const PROCESS_CPUTIME_ID = 2;

THREAD_CPUTIME_ID

    pub const THREAD_CPUTIME_ID = 3;

MONOTONIC_RAW

    pub const MONOTONIC_RAW = 4;

REALTIME_COARSE

    pub const REALTIME_COARSE = 5;

MONOTONIC_COARSE

    pub const MONOTONIC_COARSE = 6;

BOOTTIME

    pub const BOOTTIME = 7;

REALTIME_ALARM

    pub const REALTIME_ALARM = 8;

BOOTTIME_ALARM

    pub const BOOTTIME_ALARM = 9;

SGI_CYCLE

    pub const SGI_CYCLE = 10;

TAI

    pub const TAI = 11;

struct__em_promise

};

cpu_set_t


pub const CPU_SETSIZE = 128;
pub const cpu_set_t = [CPU_SETSIZE / @sizeOf(usize)]usize;

cpu_count_t

pub const cpu_count_t = std.meta.Int(.unsigned, std.math.log2(CPU_SETSIZE * 8));

CPU_COUNT()


pub fn CPU_COUNT(set: cpu_set_t) cpu_count_t {
    var sum: cpu_count_t = 0;
    for (set) |x| {
        sum += @popCount(x);
    }
    return sum;

empty_sigset

}

F


pub const E = enum(u16) {
    SUCCESS = @intFromEnum(wasi.errno_t.SUCCESS),
    @"2BIG" = @intFromEnum(wasi.errno_t.@"2BIG"),
    ACCES = @intFromEnum(wasi.errno_t.ACCES),
    ADDRINUSE = @intFromEnum(wasi.errno_t.ADDRINUSE),
    ADDRNOTAVAIL = @intFromEnum(wasi.errno_t.ADDRNOTAVAIL),
    AFNOSUPPORT = @intFromEnum(wasi.errno_t.AFNOSUPPORT),
    /// This is also the error code used for `WOULDBLOCK`.
    AGAIN = @intFromEnum(wasi.errno_t.AGAIN),
    ALREADY = @intFromEnum(wasi.errno_t.ALREADY),
    BADF = @intFromEnum(wasi.errno_t.BADF),
    BADMSG = @intFromEnum(wasi.errno_t.BADMSG),
    BUSY = @intFromEnum(wasi.errno_t.BUSY),
    CANCELED = @intFromEnum(wasi.errno_t.CANCELED),
    CHILD = @intFromEnum(wasi.errno_t.CHILD),
    CONNABORTED = @intFromEnum(wasi.errno_t.CONNABORTED),
    CONNREFUSED = @intFromEnum(wasi.errno_t.CONNREFUSED),
    CONNRESET = @intFromEnum(wasi.errno_t.CONNRESET),
    DEADLK = @intFromEnum(wasi.errno_t.DEADLK),
    DESTADDRREQ = @intFromEnum(wasi.errno_t.DESTADDRREQ),
    DOM = @intFromEnum(wasi.errno_t.DOM),
    DQUOT = @intFromEnum(wasi.errno_t.DQUOT),
    EXIST = @intFromEnum(wasi.errno_t.EXIST),
    FAULT = @intFromEnum(wasi.errno_t.FAULT),
    FBIG = @intFromEnum(wasi.errno_t.FBIG),
    HOSTUNREACH = @intFromEnum(wasi.errno_t.HOSTUNREACH),
    IDRM = @intFromEnum(wasi.errno_t.IDRM),
    ILSEQ = @intFromEnum(wasi.errno_t.ILSEQ),
    INPROGRESS = @intFromEnum(wasi.errno_t.INPROGRESS),
    INTR = @intFromEnum(wasi.errno_t.INTR),
    INVAL = @intFromEnum(wasi.errno_t.INVAL),
    IO = @intFromEnum(wasi.errno_t.IO),
    ISCONN = @intFromEnum(wasi.errno_t.ISCONN),
    ISDIR = @intFromEnum(wasi.errno_t.ISDIR),
    LOOP = @intFromEnum(wasi.errno_t.LOOP),
    MFILE = @intFromEnum(wasi.errno_t.MFILE),
    MLINK = @intFromEnum(wasi.errno_t.MLINK),
    MSGSIZE = @intFromEnum(wasi.errno_t.MSGSIZE),
    MULTIHOP = @intFromEnum(wasi.errno_t.MULTIHOP),
    NAMETOOLONG = @intFromEnum(wasi.errno_t.NAMETOOLONG),
    NETDOWN = @intFromEnum(wasi.errno_t.NETDOWN),
    NETRESET = @intFromEnum(wasi.errno_t.NETRESET),
    NETUNREACH = @intFromEnum(wasi.errno_t.NETUNREACH),
    NFILE = @intFromEnum(wasi.errno_t.NFILE),
    NOBUFS = @intFromEnum(wasi.errno_t.NOBUFS),
    NODEV = @intFromEnum(wasi.errno_t.NODEV),
    NOENT = @intFromEnum(wasi.errno_t.NOENT),
    NOEXEC = @intFromEnum(wasi.errno_t.NOEXEC),
    NOLCK = @intFromEnum(wasi.errno_t.NOLCK),
    NOLINK = @intFromEnum(wasi.errno_t.NOLINK),
    NOMEM = @intFromEnum(wasi.errno_t.NOMEM),
    NOMSG = @intFromEnum(wasi.errno_t.NOMSG),
    NOPROTOOPT = @intFromEnum(wasi.errno_t.NOPROTOOPT),
    NOSPC = @intFromEnum(wasi.errno_t.NOSPC),
    NOSYS = @intFromEnum(wasi.errno_t.NOSYS),
    NOTCONN = @intFromEnum(wasi.errno_t.NOTCONN),
    NOTDIR = @intFromEnum(wasi.errno_t.NOTDIR),
    NOTEMPTY = @intFromEnum(wasi.errno_t.NOTEMPTY),
    NOTRECOVERABLE = @intFromEnum(wasi.errno_t.NOTRECOVERABLE),
    NOTSOCK = @intFromEnum(wasi.errno_t.NOTSOCK),
    /// This is also the code used for `NOTSUP`.
    OPNOTSUPP = @intFromEnum(wasi.errno_t.OPNOTSUPP),
    NOTTY = @intFromEnum(wasi.errno_t.NOTTY),
    NXIO = @intFromEnum(wasi.errno_t.NXIO),
    OVERFLOW = @intFromEnum(wasi.errno_t.OVERFLOW),
    OWNERDEAD = @intFromEnum(wasi.errno_t.OWNERDEAD),
    PERM = @intFromEnum(wasi.errno_t.PERM),
    PIPE = @intFromEnum(wasi.errno_t.PIPE),
    PROTO = @intFromEnum(wasi.errno_t.PROTO),
    PROTONOSUPPORT = @intFromEnum(wasi.errno_t.PROTONOSUPPORT),
    PROTOTYPE = @intFromEnum(wasi.errno_t.PROTOTYPE),
    RANGE = @intFromEnum(wasi.errno_t.RANGE),
    ROFS = @intFromEnum(wasi.errno_t.ROFS),
    SPIPE = @intFromEnum(wasi.errno_t.SPIPE),
    SRCH = @intFromEnum(wasi.errno_t.SRCH),
    STALE = @intFromEnum(wasi.errno_t.STALE),
    TIMEDOUT = @intFromEnum(wasi.errno_t.TIMEDOUT),
    TXTBSY = @intFromEnum(wasi.errno_t.TXTBSY),
    XDEV = @intFromEnum(wasi.errno_t.XDEV),
    NOTCAPABLE = @intFromEnum(wasi.errno_t.NOTCAPABLE),

DUPFD


    ENOSTR = 100,
    EBFONT = 101,
    EBADSLT = 102,
    EBADRQC = 103,
    ENOANO = 104,
    ENOTBLK = 105,
    ECHRNG = 106,
    EL3HLT = 107,
    EL3RST = 108,
    ELNRNG = 109,
    EUNATCH = 110,
    ENOCSI = 111,
    EL2HLT = 112,
    EBADE = 113,
    EBADR = 114,
    EXFULL = 115,
    ENODATA = 116,
    ETIME = 117,
    ENOSR = 118,
    ENONET = 119,
    ENOPKG = 120,
    EREMOTE = 121,
    EADV = 122,
    ESRMNT = 123,
    ECOMM = 124,
    EDOTDOT = 125,
    ENOTUNIQ = 126,
    EBADFD = 127,
    EREMCHG = 128,
    ELIBACC = 129,
    ELIBBAD = 130,
    ELIBSCN = 131,
    ELIBMAX = 132,
    ELIBEXEC = 133,
    ERESTART = 134,
    ESTRPIPE = 135,
    EUSERS = 136,
    ESOCKTNOSUPPORT = 137,
    EOPNOTSUPP = 138,
    EPFNOSUPPORT = 139,
    ESHUTDOWN = 140,
    ETOOMANYREFS = 141,
    EHOSTDOWN = 142,
    EUCLEAN = 143,
    ENOTNAM = 144,
    ENAVAIL = 145,
    EISNAM = 146,
    EREMOTEIO = 147,
    ENOMEDIUM = 148,
    EMEDIUMTYPE = 149,
    ENOKEY = 150,
    EKEYEXPIRED = 151,
    EKEYREVOKED = 152,
    EKEYREJECTED = 153,
    ERFKILL = 154,
    EHWPOISON = 155,
    EL2NSYNC = 156,
    _,

struct__em_promise

};

SETFD


pub const F = struct {
    pub const DUPFD = 0;
    pub const GETFD = 1;
    pub const SETFD = 2;

GETFL

    pub const GETFL = 3;

SETFL

    pub const SETFL = 4;

SETOWN

    pub const SETOWN = 8;

GETOWN

    pub const GETOWN = 9;

SETSIG

    pub const SETSIG = 10;

GETSIG

    pub const GETSIG = 11;

GETLK

    pub const GETLK = 12;

SETLK

    pub const SETLK = 13;

SETLKW

    pub const SETLKW = 14;

SETOWN_EX

    pub const SETOWN_EX = 15;

GETOWN_EX

    pub const GETOWN_EX = 16;

GETOWNER_UIDS

    pub const GETOWNER_UIDS = 17;

RDLCK


    pub const RDLCK = 0;

WRLCK

    pub const WRLCK = 1;

UNLCK

    pub const UNLCK = 2;

struct__em_promise

};

F_OK


pub const FD_CLOEXEC = 1;

X_OK


pub const F_OK = 0;
pub const X_OK = 1;

W_OK

pub const W_OK = 2;

R_OK

pub const R_OK = 4;

W


pub const W = struct {

NOHANG

    pub const NOHANG = 1;

UNTRACED

    pub const UNTRACED = 2;

STOPPED

    pub const STOPPED = 2;

EXITED

    pub const EXITED = 4;

CONTINUED

    pub const CONTINUED = 8;

NOWAIT

    pub const NOWAIT = 0x1000000;

EXITSTATUS()


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

TERMSIG()

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

STOPSIG()

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

IFEXITED()

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

IFSTOPPED()

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

IFSIGNALED()

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

struct__em_promise

};

IFNAMESIZE


pub const Flock = extern struct {
    type: i16,
    whence: i16,
    start: off_t,
    len: off_t,
    pid: pid_t,

struct__em_promise

};

PATH_MAX


pub const IFNAMESIZE = 16;

IOV_MAX


pub const NAME_MAX = 255;
pub const PATH_MAX = 4096;
pub const IOV_MAX = 1024;

IPPORT_RESERVED


pub const IPPORT_RESERVED = 1024;

IPPROTO


pub const IPPROTO = struct {

IP

    pub const IP = 0;

HOPOPTS

    pub const HOPOPTS = 0;

ICMP

    pub const ICMP = 1;

IGMP

    pub const IGMP = 2;

IPIP

    pub const IPIP = 4;

TCP

    pub const TCP = 6;

EGP

    pub const EGP = 8;

PUP

    pub const PUP = 12;

UDP

    pub const UDP = 17;

IDP

    pub const IDP = 22;

TP

    pub const TP = 29;

DCCP

    pub const DCCP = 33;

IPV6

    pub const IPV6 = 41;

ROUTING

    pub const ROUTING = 43;

FRAGMENT

    pub const FRAGMENT = 44;

RSVP

    pub const RSVP = 46;

GRE

    pub const GRE = 47;

ESP

    pub const ESP = 50;

AH

    pub const AH = 51;

ICMPV6

    pub const ICMPV6 = 58;

NONE

    pub const NONE = 59;

DSTOPTS

    pub const DSTOPTS = 60;

MTP

    pub const MTP = 92;

BEETPH

    pub const BEETPH = 94;

ENCAP

    pub const ENCAP = 98;

PIM

    pub const PIM = 103;

COMP

    pub const COMP = 108;

SCTP

    pub const SCTP = 132;

MH

    pub const MH = 135;

UDPLITE

    pub const UDPLITE = 136;

MPLS

    pub const MPLS = 137;

RAW

    pub const RAW = 255;

MAX

    pub const MAX = 256;

struct__em_promise

};

SH


pub const LOCK = struct {
    pub const SH = 1;

EX

    pub const EX = 2;

NB

    pub const NB = 4;

UN

    pub const UN = 8;

struct__em_promise

};

NORMAL


pub const MADV = struct {
    pub const NORMAL = 0;

RANDOM

    pub const RANDOM = 1;

SEQUENTIAL

    pub const SEQUENTIAL = 2;

WILLNEED

    pub const WILLNEED = 3;

DONTNEED

    pub const DONTNEED = 4;

FREE

    pub const FREE = 8;

REMOVE

    pub const REMOVE = 9;

DONTFORK

    pub const DONTFORK = 10;

DOFORK

    pub const DOFORK = 11;

MERGEABLE

    pub const MERGEABLE = 12;

UNMERGEABLE

    pub const UNMERGEABLE = 13;

HUGEPAGE

    pub const HUGEPAGE = 14;

NOHUGEPAGE

    pub const NOHUGEPAGE = 15;

DONTDUMP

    pub const DONTDUMP = 16;

DODUMP

    pub const DODUMP = 17;

WIPEONFORK

    pub const WIPEONFORK = 18;

KEEPONFORK

    pub const KEEPONFORK = 19;

COLD

    pub const COLD = 20;

PAGEOUT

    pub const PAGEOUT = 21;

HWPOISON

    pub const HWPOISON = 100;

SOFT_OFFLINE

    pub const SOFT_OFFLINE = 101;

struct__em_promise

};

ASYNC


pub const MSF = struct {
    pub const ASYNC = 1;

INVALIDATE

    pub const INVALIDATE = 2;

SYNC

    pub const SYNC = 4;

struct__em_promise

};

OOB


pub const MSG = struct {
    pub const OOB = 0x0001;

PEEK

    pub const PEEK = 0x0002;

DONTROUTE

    pub const DONTROUTE = 0x0004;

CTRUNC

    pub const CTRUNC = 0x0008;

PROXY

    pub const PROXY = 0x0010;

TRUNC

    pub const TRUNC = 0x0020;

DONTWAIT

    pub const DONTWAIT = 0x0040;

EOR

    pub const EOR = 0x0080;

WAITALL

    pub const WAITALL = 0x0100;

FIN

    pub const FIN = 0x0200;

SYN

    pub const SYN = 0x0400;

CONFIRM

    pub const CONFIRM = 0x0800;

RST

    pub const RST = 0x1000;

ERRQUEUE

    pub const ERRQUEUE = 0x2000;

NOSIGNAL

    pub const NOSIGNAL = 0x4000;

MORE

    pub const MORE = 0x8000;

WAITFORONE

    pub const WAITFORONE = 0x10000;

BATCH

    pub const BATCH = 0x40000;

ZEROCOPY

    pub const ZEROCOPY = 0x4000000;

FASTOPEN

    pub const FASTOPEN = 0x20000000;

CMSG_CLOEXEC

    pub const CMSG_CLOEXEC = 0x40000000;

struct__em_promise

};

IN


pub const POLL = struct {
    pub const IN = 0x001;

PRI

    pub const PRI = 0x002;

OUT

    pub const OUT = 0x004;

ERR

    pub const ERR = 0x008;

HUP

    pub const HUP = 0x010;

NVAL

    pub const NVAL = 0x020;

RDNORM

    pub const RDNORM = 0x040;

RDBAND

    pub const RDBAND = 0x080;

struct__em_promise

};

NONE


pub const PROT = struct {
    pub const NONE = 0x0;

READ

    pub const READ = 0x1;

WRITE

    pub const WRITE = 0x2;

EXEC

    pub const EXEC = 0x4;

GROWSDOWN

    pub const GROWSDOWN = 0x01000000;

GROWSUP

    pub const GROWSUP = 0x02000000;

struct__em_promise

};

RLIM


pub const rlim_t = u64;

INFINITY


pub const RLIM = struct {
    pub const INFINITY = ~@as(rlim_t, 0);

SAVED_MAX


    pub const SAVED_MAX = INFINITY;

SAVED_CUR

    pub const SAVED_CUR = INFINITY;

struct__em_promise

};

rlimit_resource


pub const rlimit = extern struct {
    cur: rlim_t,
    max: rlim_t,

struct__em_promise

};

SELF


pub const rlimit_resource = enum(c_int) {
    CPU,
    FSIZE,
    DATA,
    STACK,
    CORE,
    RSS,
    NPROC,
    NOFILE,
    MEMLOCK,
    AS,
    LOCKS,
    SIGPENDING,
    MSGQUEUE,
    NICE,
    RTPRIO,
    RTTIME,
    _,

struct__em_promise

};

THREAD


pub const rusage = 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,
    __reserved: [16]isize = [1]isize{0} ** 16,

timeval


    pub const SELF = 0;
    pub const CHILDREN = -1;
    pub const THREAD = 1;

struct__em_promise

};

GS


pub const timeval = extern struct {
    tv_sec: i64,
    tv_usec: i32,

struct__em_promise

};

ES


pub const REG = struct {
    pub const GS = 0;
    pub const FS = 1;
    pub const ES = 2;

DS

    pub const DS = 3;

EDI

    pub const EDI = 4;

ESI

    pub const ESI = 5;

EBP

    pub const EBP = 6;

ESP

    pub const ESP = 7;

EBX

    pub const EBX = 8;

EDX

    pub const EDX = 9;

ECX

    pub const ECX = 10;

EAX

    pub const EAX = 11;

TRAPNO

    pub const TRAPNO = 12;

ERR

    pub const ERR = 13;

EIP

    pub const EIP = 14;

CS

    pub const CS = 15;

EFL

    pub const EFL = 16;

UESP

    pub const UESP = 17;

SS

    pub const SS = 18;

struct__em_promise

};

IFMT


pub const S = struct {
    pub const IFMT = 0o170000;

IFDIR


    pub const IFDIR = 0o040000;

IFCHR

    pub const IFCHR = 0o020000;

IFBLK

    pub const IFBLK = 0o060000;

IFREG

    pub const IFREG = 0o100000;

IFIFO

    pub const IFIFO = 0o010000;

IFLNK

    pub const IFLNK = 0o120000;

IFSOCK

    pub const IFSOCK = 0o140000;

ISUID


    pub const ISUID = 0o4000;

ISGID

    pub const ISGID = 0o2000;

ISVTX

    pub const ISVTX = 0o1000;

IRUSR

    pub const IRUSR = 0o400;

IWUSR

    pub const IWUSR = 0o200;

IXUSR

    pub const IXUSR = 0o100;

IRWXU

    pub const IRWXU = 0o700;

IRGRP

    pub const IRGRP = 0o040;

IWGRP

    pub const IWGRP = 0o020;

IXGRP

    pub const IXGRP = 0o010;

IRWXG

    pub const IRWXG = 0o070;

IROTH

    pub const IROTH = 0o004;

IWOTH

    pub const IWOTH = 0o002;

IXOTH

    pub const IXOTH = 0o001;

IRWXO

    pub const IRWXO = 0o007;

ISREG()


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

ISDIR()


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

ISCHR()


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

ISBLK()


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

ISFIFO()


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

ISLNK()


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

ISSOCK()


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

struct__em_promise

};

NOCLDSTOP


pub const SA = struct {
    pub const NOCLDSTOP = 1;

NOCLDWAIT

    pub const NOCLDWAIT = 2;

SIGINFO

    pub const SIGINFO = 4;

RESTART

    pub const RESTART = 0x10000000;

RESETHAND

    pub const RESETHAND = 0x80000000;

ONSTACK

    pub const ONSTACK = 0x08000000;

NODEFER

    pub const NODEFER = 0x40000000;

RESTORER

    pub const RESTORER = 0x04000000;

struct__em_promise

};

SET


pub const SEEK = struct {
    pub const SET = 0;

CUR

    pub const CUR = 1;

END

    pub const END = 2;

struct__em_promise

};

RD


pub const SHUT = struct {
    pub const RD = 0;

WR

    pub const WR = 1;

RDWR

    pub const RDWR = 2;

struct__em_promise

};

BLOCK


pub const SIG = struct {
    pub const BLOCK = 0;

UNBLOCK

    pub const UNBLOCK = 1;

SETMASK

    pub const SETMASK = 2;

HUP


    pub const HUP = 1;

INT

    pub const INT = 2;

QUIT

    pub const QUIT = 3;

ILL

    pub const ILL = 4;

TRAP

    pub const TRAP = 5;

ABRT

    pub const ABRT = 6;

IOT

    pub const IOT = ABRT;

BUS

    pub const BUS = 7;

FPE

    pub const FPE = 8;

KILL

    pub const KILL = 9;

USR1

    pub const USR1 = 10;

SEGV

    pub const SEGV = 11;

USR2

    pub const USR2 = 12;

PIPE

    pub const PIPE = 13;

ALRM

    pub const ALRM = 14;

TERM

    pub const TERM = 15;

STKFLT

    pub const STKFLT = 16;

CHLD

    pub const CHLD = 17;

CONT

    pub const CONT = 18;

STOP

    pub const STOP = 19;

TSTP

    pub const TSTP = 20;

TTIN

    pub const TTIN = 21;

TTOU

    pub const TTOU = 22;

URG

    pub const URG = 23;

XCPU

    pub const XCPU = 24;

XFSZ

    pub const XFSZ = 25;

VTALRM

    pub const VTALRM = 26;

PROF

    pub const PROF = 27;

WINCH

    pub const WINCH = 28;

IO

    pub const IO = 29;

POLL

    pub const POLL = 29;

PWR

    pub const PWR = 30;

SYS

    pub const SYS = 31;

UNUSED

    pub const UNUSED = SIG.SYS;

ERR:


    pub const ERR: ?Sigaction.handler_fn = @ptrFromInt(std.math.maxInt(usize));

DFL:

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

IGN:

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

struct__em_promise

};

handler_fn


pub const Sigaction = extern struct {
    pub const handler_fn = *align(1) const fn (i32) callconv(.C) void;

sigaction_fn

    pub const sigaction_fn = *const fn (i32, *const siginfo_t, ?*anyopaque) callconv(.C) void;

sigset_t


    handler: extern union {
        handler: ?handler_fn,
        sigaction: ?sigaction_fn,
    },
    mask: sigset_t,
    flags: c_uint,
    restorer: ?*const fn () callconv(.C) void = null,

struct__em_promise

};

siginfo_t


pub const sigset_t = [1024 / 32]u32;
pub const empty_sigset = [_]u32{0} ** @typeInfo(sigset_t).Array.len;
pub const siginfo_t = extern struct {
    signo: i32,
    errno: i32,
    code: i32,
    fields: siginfo_fields_union,

struct__em_promise

};
const siginfo_fields_union = extern union {
    pad: [128 - 2 * @sizeOf(c_int) - @sizeOf(c_long)]u8,
    common: extern struct {
        first: extern union {
            piduid: extern struct {
                pid: pid_t,
                uid: uid_t,
            },
            timer: extern struct {
                timerid: i32,
                overrun: i32,
            },
        },
        second: extern union {
            value: sigval,
            sigchld: extern struct {
                status: i32,
                utime: clock_t,
                stime: clock_t,
            },
        },
    },
    sigfault: extern struct {
        addr: *allowzero anyopaque,
        addr_lsb: i16,
        first: extern union {
            addr_bnd: extern struct {
                lower: *anyopaque,
                upper: *anyopaque,
            },
            pkey: u32,
        },
    },
    sigpoll: extern struct {
        band: isize,
        fd: i32,
    },
    sigsys: extern struct {
        call_addr: *anyopaque,
        syscall: i32,
        native_arch: u32,
    },

struct__em_promise

};
pub const sigval = extern union {
    int: i32,
    ptr: *anyopaque,

struct__em_promise

};

DEBUG


pub const SIOCGIFINDEX = 0x8933;

REUSEADDR


pub const SO = struct {
    pub const DEBUG = 1;
    pub const REUSEADDR = 2;

TYPE

    pub const TYPE = 3;

ERROR

    pub const ERROR = 4;

DONTROUTE

    pub const DONTROUTE = 5;

BROADCAST

    pub const BROADCAST = 6;

SNDBUF

    pub const SNDBUF = 7;

RCVBUF

    pub const RCVBUF = 8;

KEEPALIVE

    pub const KEEPALIVE = 9;

OOBINLINE

    pub const OOBINLINE = 10;

NO_CHECK

    pub const NO_CHECK = 11;

PRIORITY

    pub const PRIORITY = 12;

LINGER

    pub const LINGER = 13;

BSDCOMPAT

    pub const BSDCOMPAT = 14;

REUSEPORT

    pub const REUSEPORT = 15;

PASSCRED

    pub const PASSCRED = 16;

PEERCRED

    pub const PEERCRED = 17;

RCVLOWAT

    pub const RCVLOWAT = 18;

SNDLOWAT

    pub const SNDLOWAT = 19;

RCVTIMEO

    pub const RCVTIMEO = 20;

SNDTIMEO

    pub const SNDTIMEO = 21;

ACCEPTCONN

    pub const ACCEPTCONN = 30;

PEERSEC

    pub const PEERSEC = 31;

SNDBUFFORCE

    pub const SNDBUFFORCE = 32;

RCVBUFFORCE

    pub const RCVBUFFORCE = 33;

PROTOCOL

    pub const PROTOCOL = 38;

DOMAIN

    pub const DOMAIN = 39;

SECURITY_AUTHENTICATION

    pub const SECURITY_AUTHENTICATION = 22;

SECURITY_ENCRYPTION_TRANSPORT

    pub const SECURITY_ENCRYPTION_TRANSPORT = 23;

SECURITY_ENCRYPTION_NETWORK

    pub const SECURITY_ENCRYPTION_NETWORK = 24;

BINDTODEVICE

    pub const BINDTODEVICE = 25;

ATTACH_FILTER

    pub const ATTACH_FILTER = 26;

DETACH_FILTER

    pub const DETACH_FILTER = 27;

GET_FILTER

    pub const GET_FILTER = ATTACH_FILTER;

PEERNAME

    pub const PEERNAME = 28;

TIMESTAMP_OLD

    pub const TIMESTAMP_OLD = 29;

PASSSEC

    pub const PASSSEC = 34;

TIMESTAMPNS_OLD

    pub const TIMESTAMPNS_OLD = 35;

MARK

    pub const MARK = 36;

TIMESTAMPING_OLD

    pub const TIMESTAMPING_OLD = 37;

RXQ_OVFL

    pub const RXQ_OVFL = 40;

WIFI_STATUS

    pub const WIFI_STATUS = 41;

PEEK_OFF

    pub const PEEK_OFF = 42;

NOFCS

    pub const NOFCS = 43;

LOCK_FILTER

    pub const LOCK_FILTER = 44;

SELECT_ERR_QUEUE

    pub const SELECT_ERR_QUEUE = 45;

BUSY_POLL

    pub const BUSY_POLL = 46;

MAX_PACING_RATE

    pub const MAX_PACING_RATE = 47;

BPF_EXTENSIONS

    pub const BPF_EXTENSIONS = 48;

INCOMING_CPU

    pub const INCOMING_CPU = 49;

ATTACH_BPF

    pub const ATTACH_BPF = 50;

DETACH_BPF

    pub const DETACH_BPF = DETACH_FILTER;

ATTACH_REUSEPORT_CBPF

    pub const ATTACH_REUSEPORT_CBPF = 51;

ATTACH_REUSEPORT_EBPF

    pub const ATTACH_REUSEPORT_EBPF = 52;

CNX_ADVICE

    pub const CNX_ADVICE = 53;

MEMINFO

    pub const MEMINFO = 55;

INCOMING_NAPI_ID

    pub const INCOMING_NAPI_ID = 56;

COOKIE

    pub const COOKIE = 57;

PEERGROUPS

    pub const PEERGROUPS = 59;

ZEROCOPY

    pub const ZEROCOPY = 60;

TXTIME

    pub const TXTIME = 61;

BINDTOIFINDEX

    pub const BINDTOIFINDEX = 62;

TIMESTAMP_NEW

    pub const TIMESTAMP_NEW = 63;

TIMESTAMPNS_NEW

    pub const TIMESTAMPNS_NEW = 64;

TIMESTAMPING_NEW

    pub const TIMESTAMPING_NEW = 65;

RCVTIMEO_NEW

    pub const RCVTIMEO_NEW = 66;

SNDTIMEO_NEW

    pub const SNDTIMEO_NEW = 67;

DETACH_REUSEPORT_BPF

    pub const DETACH_REUSEPORT_BPF = 68;

struct__em_promise

};

STREAM


pub const SOCK = struct {
    pub const STREAM = 1;

DGRAM

    pub const DGRAM = 2;

RAW

    pub const RAW = 3;

RDM

    pub const RDM = 4;

SEQPACKET

    pub const SEQPACKET = 5;

DCCP

    pub const DCCP = 6;

PACKET

    pub const PACKET = 10;

CLOEXEC

    pub const CLOEXEC = 0o2000000;

NONBLOCK

    pub const NONBLOCK = 0o4000;

struct__em_promise

};

SOCKET


pub const SOL = struct {
    pub const SOCKET = 1;

IP


    pub const IP = 0;

IPV6

    pub const IPV6 = 41;

ICMPV6

    pub const ICMPV6 = 58;

RAW


    pub const RAW = 255;

DECNET

    pub const DECNET = 261;

X25

    pub const X25 = 262;

PACKET

    pub const PACKET = 263;

ATM

    pub const ATM = 264;

AAL

    pub const AAL = 265;

IRDA

    pub const IRDA = 266;

NETBEUI

    pub const NETBEUI = 267;

LLC

    pub const LLC = 268;

DCCP

    pub const DCCP = 269;

NETLINK

    pub const NETLINK = 270;

TIPC

    pub const TIPC = 271;

RXRPC

    pub const RXRPC = 272;

PPPOL2TP

    pub const PPPOL2TP = 273;

BLUETOOTH

    pub const BLUETOOTH = 274;

PNPIPE

    pub const PNPIPE = 275;

RDS

    pub const RDS = 276;

IUCV

    pub const IUCV = 277;

CAIF

    pub const CAIF = 278;

ALG

    pub const ALG = 279;

NFC

    pub const NFC = 280;

KCM

    pub const KCM = 281;

TLS

    pub const TLS = 282;

XDP

    pub const XDP = 283;

struct__em_promise

};

STDOUT_FILENO


pub const STDIN_FILENO = 0;
pub const STDOUT_FILENO = 1;

STDERR_FILENO

pub const STDERR_FILENO = 2;

TCP


pub const TCP = struct {

NODELAY

    pub const NODELAY = 1;

MAXSEG

    pub const MAXSEG = 2;

CORK

    pub const CORK = 3;

KEEPIDLE

    pub const KEEPIDLE = 4;

KEEPINTVL

    pub const KEEPINTVL = 5;

KEEPCNT

    pub const KEEPCNT = 6;

SYNCNT

    pub const SYNCNT = 7;

LINGER2

    pub const LINGER2 = 8;

DEFER_ACCEPT

    pub const DEFER_ACCEPT = 9;

WINDOW_CLAMP

    pub const WINDOW_CLAMP = 10;

INFO

    pub const INFO = 11;

QUICKACK

    pub const QUICKACK = 12;

CONGESTION

    pub const CONGESTION = 13;

MD5SIG

    pub const MD5SIG = 14;

THIN_LINEAR_TIMEOUTS

    pub const THIN_LINEAR_TIMEOUTS = 16;

THIN_DUPACK

    pub const THIN_DUPACK = 17;

USER_TIMEOUT

    pub const USER_TIMEOUT = 18;

REPAIR

    pub const REPAIR = 19;

REPAIR_QUEUE

    pub const REPAIR_QUEUE = 20;

QUEUE_SEQ

    pub const QUEUE_SEQ = 21;

REPAIR_OPTIONS

    pub const REPAIR_OPTIONS = 22;

FASTOPEN

    pub const FASTOPEN = 23;

TIMESTAMP

    pub const TIMESTAMP = 24;

NOTSENT_LOWAT

    pub const NOTSENT_LOWAT = 25;

CC_INFO

    pub const CC_INFO = 26;

SAVE_SYN

    pub const SAVE_SYN = 27;

SAVED_SYN

    pub const SAVED_SYN = 28;

REPAIR_WINDOW

    pub const REPAIR_WINDOW = 29;

FASTOPEN_CONNECT

    pub const FASTOPEN_CONNECT = 30;

ULP

    pub const ULP = 31;

MD5SIG_EXT

    pub const MD5SIG_EXT = 32;

FASTOPEN_KEY

    pub const FASTOPEN_KEY = 33;

FASTOPEN_NO_COOKIE

    pub const FASTOPEN_NO_COOKIE = 34;

ZEROCOPY_RECEIVE

    pub const ZEROCOPY_RECEIVE = 35;

INQ

    pub const INQ = 36;

CM_INQ

    pub const CM_INQ = INQ;

TX_DELAY

    pub const TX_DELAY = 37;

REPAIR_ON


    pub const REPAIR_ON = 1;

REPAIR_OFF

    pub const REPAIR_OFF = 0;

REPAIR_OFF_NO_WP

    pub const REPAIR_OFF_NO_WP = -1;

struct__em_promise

};

addrinfo


pub const TCSA = enum(c_uint) {
    NOW,
    DRAIN,
    FLUSH,
    _,

struct__em_promise

};

sa_family_t


pub const addrinfo = extern struct {
    flags: i32,
    family: i32,
    socktype: i32,
    protocol: i32,
    addrlen: socklen_t,
    addr: ?*sockaddr,
    canonname: ?[*:0]u8,
    next: ?*addrinfo,

struct__em_promise

};

sockaddr


pub const in_port_t = u16;
pub const sa_family_t = u16;
pub const socklen_t = u32;

SS_MAXSIZE


pub const sockaddr = extern struct {
    family: sa_family_t,
    data: [14]u8,

storage


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

in


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

in6


    /// IPv4 socket address
    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 },
    };

un


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

ll


    /// UNIX domain socket address
    pub const un = extern struct {
        family: sa_family_t = AF.UNIX,
        path: [108]u8,
    };

nl


    /// Packet socket address
    pub const ll = extern struct {
        family: sa_family_t = AF.PACKET,
        protocol: u16,
        ifindex: i32,
        hatype: u16,
        pkttype: u8,
        halen: u8,
        addr: [8]u8,
    };

xdp


    /// Netlink socket address
    pub const nl = extern struct {
        family: sa_family_t = AF.NETLINK,
        __pad1: c_ushort = 0,

vm


        /// port ID
        pid: u32,

blksize_t


        /// multicast groups mask
        groups: u32,
    };

nlink_t


    pub const xdp = extern struct {
        family: u16 = AF.XDP,
        flags: u16,
        ifindex: u32,
        queue_id: u32,
        shared_umem_fd: u32,
    };

time_t


    /// Address structure for vSockets
    pub const vm = extern struct {
        family: sa_family_t = AF.VSOCK,
        reserved1: u16 = 0,
        port: u32,
        cid: u32,
        flags: u8,

mode_t


        /// The total size of this structure should be exactly the same as that of struct sockaddr.
        zero: [3]u8 = [_]u8{0} ** 3,
        comptime {
            std.debug.assert(@sizeOf(vm) == @sizeOf(sockaddr));
        }
    };

struct__em_promise

};

ino_t


pub const blksize_t = i32;
pub const nlink_t = u32;
pub const time_t = i64;
pub const mode_t = u32;
pub const off_t = i64;
pub const ino_t = u64;

dev_t

pub const dev_t = u32;

blkcnt_t

pub const blkcnt_t = i32;

pid_t


pub const pid_t = i32;

fd_t

pub const fd_t = i32;

uid_t

pub const uid_t = u32;

gid_t

pub const gid_t = u32;

clock_t

pub const clock_t = i32;

dl_phdr_info


pub const dl_phdr_info = extern struct {
    dlpi_addr: usize,
    dlpi_name: ?[*:0]const u8,
    dlpi_phdr: [*]std.elf.Phdr,
    dlpi_phnum: u16,

struct__em_promise

};

msghdr


pub const mcontext_t = extern struct {
    gregs: [19]usize,
    fpregs: [*]u8,
    oldmask: usize,
    cr2: usize,

struct__em_promise

};

nfds_t


pub const msghdr = extern struct {
    name: ?*sockaddr,
    namelen: socklen_t,
    iov: [*]iovec,
    iovlen: i32,
    control: ?*anyopaque,
    controllen: socklen_t,
    flags: i32,

struct__em_promise

};

stack_t


pub const msghdr_const = extern struct {
    name: ?*const sockaddr,
    namelen: socklen_t,
    iov: [*]const iovec_const,
    iovlen: i32,
    control: ?*const anyopaque,
    controllen: socklen_t,
    flags: i32,

struct__em_promise

};

timezone


pub const nfds_t = usize;
pub const pollfd = extern struct {
    fd: fd_t,
    events: i16,
    revents: i16,

struct__em_promise

};

utsname


pub const stack_t = extern struct {
    sp: [*]u8,
    flags: i32,
    size: usize,

struct__em_promise

};

atime()


pub const timespec = extern struct {
    tv_sec: time_t,
    tv_nsec: isize,

struct__em_promise

};

ctime()


pub const timezone = extern struct {
    tz_minuteswest: i32,
    tz_dsttime: i32,

struct__em_promise

};

SETTIMEOUT


pub const ucontext_t = extern struct {
    flags: usize,
    link: ?*ucontext_t,
    stack: stack_t,
    mcontext: mcontext_t,
    sigmask: sigset_t,
    regspace: [28]usize,

struct__em_promise

};

SETIMMEDIATE


pub const utsname = extern struct {
    sysname: [64:0]u8,
    nodename: [64:0]u8,
    release: [64:0]u8,
    version: [64:0]u8,
    machine: [64:0]u8,
    domainname: [64:0]u8,

struct__em_promise

};

CONSOLE


pub const Stat = extern struct {
    dev: dev_t,
    mode: mode_t,
    nlink: nlink_t,
    uid: uid_t,
    gid: gid_t,
    rdev: dev_t,
    size: off_t,
    blksize: blksize_t,
    blocks: blkcnt_t,
    atim: timespec,
    mtim: timespec,
    ctim: timespec,
    ino: ino_t,

WARN


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

ERROR


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

C_STACK


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

struct__em_promise

};

DEMANGLE


pub const TIMING = struct {
    pub const SETTIMEOUT = 0;
    pub const RAF = 1;
    pub const SETIMMEDIATE = 2;

struct__em_promise

};

FUNC_PARAMS


pub const LOG = struct {
    pub const CONSOLE = 1;
    pub const WARN = 2;
    pub const ERROR = 4;
    pub const C_STACK = 8;
    pub const JS_STACK = 16;
    pub const DEMANGLE = 32;
    pub const NO_PATHS = 64;
    pub const FUNC_PARAMS = 128;

DEBUG

    pub const DEBUG = 256;

INFO

    pub const INFO = 512;

struct__em_promise

};

em_arg_callback_func


pub const em_callback_func = ?*const fn () callconv(.C) void;
pub const em_arg_callback_func = ?*const fn (?*anyopaque) callconv(.C) void;

em_str_callback_func

pub const em_str_callback_func = ?*const fn ([*:0]const u8) callconv(.C) void;

em_async_wget_onload_func


pub extern "c" fn emscripten_async_wget(url: [*:0]const u8, file: [*:0]const u8, onload: em_str_callback_func, onerror: em_str_callback_func) void;

em_async_wget2_onload_func


pub const em_async_wget_onload_func = ?*const fn (?*anyopaque, ?*anyopaque, c_int) callconv(.C) void;
pub extern "c" fn emscripten_async_wget_data(url: [*:0]const u8, arg: ?*anyopaque, onload: em_async_wget_onload_func, onerror: em_arg_callback_func) void;

em_async_wget2_onstatus_func


pub const em_async_wget2_onload_func = ?*const fn (c_uint, ?*anyopaque, [*:0]const u8) callconv(.C) void;
pub const em_async_wget2_onstatus_func = ?*const fn (c_uint, ?*anyopaque, c_int) callconv(.C) void;

em_async_wget2_data_onload_func


pub extern "c" fn emscripten_async_wget2(url: [*:0]const u8, file: [*:0]const u8, requesttype: [*:0]const u8, param: [*:0]const u8, arg: ?*anyopaque, onload: em_async_wget2_onload_func, onerror: em_async_wget2_onstatus_func, onprogress: em_async_wget2_onstatus_func) c_int;

em_async_wget2_data_onerror_func


pub const em_async_wget2_data_onload_func = ?*const fn (c_uint, ?*anyopaque, ?*anyopaque, c_uint) callconv(.C) void;
pub const em_async_wget2_data_onerror_func = ?*const fn (c_uint, ?*anyopaque, c_int, [*:0]const u8) callconv(.C) void;

em_async_wget2_data_onprogress_func

pub const em_async_wget2_data_onprogress_func = ?*const fn (c_uint, ?*anyopaque, c_int, c_int) callconv(.C) void;

em_socket_callback


pub extern "c" fn emscripten_async_wget2_data(url: [*:0]const u8, requesttype: [*:0]const u8, param: [*:0]const u8, arg: ?*anyopaque, free: c_int, onload: em_async_wget2_data_onload_func, onerror: em_async_wget2_data_onerror_func, onprogress: em_async_wget2_data_onprogress_func) c_int;
pub extern "c" fn emscripten_async_wget2_abort(handle: c_int) void;
pub extern "c" fn emscripten_wget(url: [*:0]const u8, file: [*:0]const u8) c_int;
pub extern "c" fn emscripten_wget_data(url: [*:0]const u8, pbuffer: *(?*anyopaque), pnum: *c_int, perror: *c_int) void;
pub extern "c" fn emscripten_run_script(script: [*:0]const u8) void;
pub extern "c" fn emscripten_run_script_int(script: [*:0]const u8) c_int;
pub extern "c" fn emscripten_run_script_string(script: [*:0]const u8) [*:0]u8;
pub extern "c" fn emscripten_async_run_script(script: [*:0]const u8, millis: c_int) void;
pub extern "c" fn emscripten_async_load_script(script: [*:0]const u8, onload: em_callback_func, onerror: em_callback_func) void;
pub extern "c" fn emscripten_set_main_loop(func: em_callback_func, fps: c_int, simulate_infinite_loop: c_int) void;
pub extern "c" fn emscripten_set_main_loop_timing(mode: c_int, value: c_int) c_int;
pub extern "c" fn emscripten_get_main_loop_timing(mode: *c_int, value: *c_int) void;
pub extern "c" fn emscripten_set_main_loop_arg(func: em_arg_callback_func, arg: ?*anyopaque, fps: c_int, simulate_infinite_loop: c_int) void;
pub extern "c" fn emscripten_pause_main_loop() void;
pub extern "c" fn emscripten_resume_main_loop() void;
pub extern "c" fn emscripten_cancel_main_loop() void;

em_socket_error_callback


pub const em_socket_callback = ?*const fn (c_int, ?*anyopaque) callconv(.C) void;
pub const em_socket_error_callback = ?*const fn (c_int, c_int, [*:0]const u8, ?*anyopaque) callconv(.C) void;

em_idb_onload_func


pub extern "c" fn emscripten_set_socket_error_callback(userData: ?*anyopaque, callback: em_socket_error_callback) void;
pub extern "c" fn emscripten_set_socket_open_callback(userData: ?*anyopaque, callback: em_socket_callback) void;
pub extern "c" fn emscripten_set_socket_listen_callback(userData: ?*anyopaque, callback: em_socket_callback) void;
pub extern "c" fn emscripten_set_socket_connection_callback(userData: ?*anyopaque, callback: em_socket_callback) void;
pub extern "c" fn emscripten_set_socket_message_callback(userData: ?*anyopaque, callback: em_socket_callback) void;
pub extern "c" fn emscripten_set_socket_close_callback(userData: ?*anyopaque, callback: em_socket_callback) void;
pub extern "c" fn _emscripten_push_main_loop_blocker(func: em_arg_callback_func, arg: ?*anyopaque, name: [*:0]const u8) void;
pub extern "c" fn _emscripten_push_uncounted_main_loop_blocker(func: em_arg_callback_func, arg: ?*anyopaque, name: [*:0]const u8) void;
pub extern "c" fn emscripten_set_main_loop_expected_blockers(num: c_int) void;
pub extern "c" fn emscripten_async_call(func: em_arg_callback_func, arg: ?*anyopaque, millis: c_int) void;
pub extern "c" fn emscripten_exit_with_live_runtime() noreturn;
pub extern "c" fn emscripten_force_exit(status: c_int) noreturn;
pub extern "c" fn emscripten_get_device_pixel_ratio() f64;
pub extern "c" fn emscripten_get_window_title() [*:0]u8;
pub extern "c" fn emscripten_set_window_title([*:0]const u8) void;
pub extern "c" fn emscripten_get_screen_size(width: *c_int, height: *c_int) void;
pub extern "c" fn emscripten_hide_mouse() void;
pub extern "c" fn emscripten_set_canvas_size(width: c_int, height: c_int) void;
pub extern "c" fn emscripten_get_canvas_size(width: *c_int, height: *c_int, isFullscreen: *c_int) void;
pub extern "c" fn emscripten_get_now() f64;
pub extern "c" fn emscripten_random() f32;
pub const em_idb_onload_func = ?*const fn (?*anyopaque, ?*anyopaque, c_int) callconv(.C) void;
pub extern "c" fn emscripten_idb_async_load(db_name: [*:0]const u8, file_id: [*:0]const u8, arg: ?*anyopaque, onload: em_idb_onload_func, onerror: em_arg_callback_func) void;
pub extern "c" fn emscripten_idb_async_store(db_name: [*:0]const u8, file_id: [*:0]const u8, ptr: ?*anyopaque, num: c_int, arg: ?*anyopaque, onstore: em_arg_callback_func, onerror: em_arg_callback_func) void;
pub extern "c" fn emscripten_idb_async_delete(db_name: [*:0]const u8, file_id: [*:0]const u8, arg: ?*anyopaque, ondelete: em_arg_callback_func, onerror: em_arg_callback_func) void;

em_idb_exists_func

pub const em_idb_exists_func = ?*const fn (?*anyopaque, c_int) callconv(.C) void;
pub extern "c" fn emscripten_idb_async_exists(db_name: [*:0]const u8, file_id: [*:0]const u8, arg: ?*anyopaque, oncheck: em_idb_exists_func, onerror: em_arg_callback_func) void;
pub extern "c" fn emscripten_idb_load(db_name: [*:0]const u8, file_id: [*:0]const u8, pbuffer: *?*anyopaque, pnum: *c_int, perror: *c_int) void;
pub extern "c" fn emscripten_idb_store(db_name: [*:0]const u8, file_id: [*:0]const u8, buffer: *anyopaque, num: c_int, perror: *c_int) void;
pub extern "c" fn emscripten_idb_delete(db_name: [*:0]const u8, file_id: [*:0]const u8, perror: *c_int) void;
pub extern "c" fn emscripten_idb_exists(db_name: [*:0]const u8, file_id: [*:0]const u8, pexists: *c_int, perror: *c_int) void;
pub extern "c" fn emscripten_idb_load_blob(db_name: [*:0]const u8, file_id: [*:0]const u8, pblob: *c_int, perror: *c_int) void;
pub extern "c" fn emscripten_idb_store_blob(db_name: [*:0]const u8, file_id: [*:0]const u8, buffer: *anyopaque, num: c_int, perror: *c_int) void;
pub extern "c" fn emscripten_idb_read_from_blob(blob: c_int, start: c_int, num: c_int, buffer: ?*anyopaque) void;
pub extern "c" fn emscripten_idb_free_blob(blob: c_int) void;
pub extern "c" fn emscripten_run_preload_plugins(file: [*:0]const u8, onload: em_str_callback_func, onerror: em_str_callback_func) c_int;

em_run_preload_plugins_data_onload_func

pub const em_run_preload_plugins_data_onload_func = ?*const fn (?*anyopaque, [*:0]const u8) callconv(.C) void;
pub extern "c" fn emscripten_run_preload_plugins_data(data: [*]u8, size: c_int, suffix: [*:0]const u8, arg: ?*anyopaque, onload: em_run_preload_plugins_data_onload_func, onerror: em_arg_callback_func) void;
pub extern "c" fn emscripten_lazy_load_code() void;

worker_handle

pub const worker_handle = c_int;
pub extern "c" fn emscripten_create_worker(url: [*:0]const u8) worker_handle;
pub extern "c" fn emscripten_destroy_worker(worker: worker_handle) void;

em_worker_callback_func

pub const em_worker_callback_func = ?*const fn ([*]u8, c_int, ?*anyopaque) callconv(.C) void;
pub extern "c" fn emscripten_call_worker(worker: worker_handle, funcname: [*:0]const u8, data: [*]u8, size: c_int, callback: em_worker_callback_func, arg: ?*anyopaque) void;
pub extern "c" fn emscripten_worker_respond(data: [*]u8, size: c_int) void;
pub extern "c" fn emscripten_worker_respond_provisionally(data: [*]u8, size: c_int) void;
pub extern "c" fn emscripten_get_worker_queue_size(worker: worker_handle) c_int;
pub extern "c" fn emscripten_get_compiler_setting(name: [*:0]const u8) c_long;
pub extern "c" fn emscripten_has_asyncify() c_int;
pub extern "c" fn emscripten_debugger() void;

em_scan_func


pub extern "c" fn emscripten_get_preloaded_image_data(path: [*:0]const u8, w: *c_int, h: *c_int) ?[*]u8;
pub extern "c" fn emscripten_get_preloaded_image_data_from_FILE(file: *FILE, w: *c_int, h: *c_int) ?[*]u8;
pub extern "c" fn emscripten_log(flags: c_int, format: [*:0]const u8, ...) void;
pub extern "c" fn emscripten_get_callstack(flags: c_int, out: ?[*]u8, maxbytes: c_int) c_int;
pub extern "c" fn emscripten_print_double(x: f64, to: ?[*]u8, max: c_int) c_int;
pub const em_scan_func = ?*const fn (?*anyopaque, ?*anyopaque) callconv(.C) void;
pub extern "c" fn emscripten_scan_registers(func: em_scan_func) void;
pub extern "c" fn emscripten_scan_stack(func: em_scan_func) void;

em_dlopen_callback

pub const em_dlopen_callback = ?*const fn (?*anyopaque, ?*anyopaque) callconv(.C) void;
pub extern "c" fn emscripten_dlopen(filename: [*:0]const u8, flags: c_int, user_data: ?*anyopaque, onsuccess: em_dlopen_callback, onerror: em_arg_callback_func) void;
pub extern "c" fn emscripten_dlopen_promise(filename: [*:0]const u8, flags: c_int) em_promise_t;
pub extern "c" fn emscripten_throw_number(number: f64) void;
pub extern "c" fn emscripten_throw_string(utf8String: [*:0]const u8) void;
pub extern "c" fn emscripten_sleep(ms: c_uint) void;

PROMISE


pub const PROMISE = struct {

FULFILL

    pub const FULFILL = 0;

MATCH

    pub const MATCH = 1;

MATCH_RELEASE

    pub const MATCH_RELEASE = 2;

REJECT

    pub const REJECT = 3;

struct__em_promise

};

em_promise_t


pub const struct__em_promise = opaque {};
pub const em_promise_t = ?*struct__em_promise;

enum_em_promise_result_t

pub const enum_em_promise_result_t = c_uint;

em_promise_result_t

pub const em_promise_result_t = enum_em_promise_result_t;

em_promise_callback_t

pub const em_promise_callback_t = ?*const fn (?*?*anyopaque, ?*anyopaque, ?*anyopaque) callconv(.C) em_promise_result_t;

struct_em_settled_result_t


pub extern "c" fn emscripten_promise_create() em_promise_t;
pub extern "c" fn emscripten_promise_destroy(promise: em_promise_t) void;
pub extern "c" fn emscripten_promise_resolve(promise: em_promise_t, result: em_promise_result_t, value: ?*anyopaque) void;
pub extern "c" fn emscripten_promise_then(promise: em_promise_t, on_fulfilled: em_promise_callback_t, on_rejected: em_promise_callback_t, data: ?*anyopaque) em_promise_t;
pub extern "c" fn emscripten_promise_all(promises: [*]em_promise_t, results: ?[*]?*anyopaque, num_promises: usize) em_promise_t;

em_settled_result_t


pub const struct_em_settled_result_t = extern struct {
    result: em_promise_result_t,
    value: ?*anyopaque,
};
pub const em_settled_result_t = struct_em_settled_result_t;