From 4ebcf64864eeec6c2086826242f53eedc69275ad Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sat, 21 Sep 2019 23:00:36 +0200 Subject: Initial support for mipsel architecture¬ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/std/os/bits/linux.zig | 95 ++++++++++++++++++++++++++--------------------- 1 file changed, 52 insertions(+), 43 deletions(-) (limited to 'lib/std/os/bits/linux.zig') diff --git a/lib/std/os/bits/linux.zig b/lib/std/os/bits/linux.zig index 939d203e8d..ed4d704447 100644 --- a/lib/std/os/bits/linux.zig +++ b/lib/std/os/bits/linux.zig @@ -9,9 +9,12 @@ pub usingnamespace switch (builtin.arch) { .aarch64 => @import("linux/arm64.zig"), .arm => @import("linux/arm-eabi.zig"), .riscv64 => @import("linux/riscv64.zig"), + .mipsel => @import("linux/mipsel.zig"), else => struct {}, }; +const is_mips = builtin.arch == .mipsel; + pub const pid_t = i32; pub const fd_t = i32; pub const uid_t = i32; @@ -96,21 +99,21 @@ pub const MAP_TYPE = 0x0f; pub const MAP_FIXED = 0x10; /// don't use a file -pub const MAP_ANONYMOUS = 0x20; +pub const MAP_ANONYMOUS = if (is_mips) 0x800 else 0x20; // MAP_ 0x0100 - 0x4000 flags are per architecture /// populate (prefault) pagetables -pub const MAP_POPULATE = 0x8000; +pub const MAP_POPULATE = if (is_mips) 0x10000 else 0x8000; /// do not block on IO -pub const MAP_NONBLOCK = 0x10000; +pub const MAP_NONBLOCK = if (is_mips) 0x20000 else 0x10000; /// give out an address that is best suited for process/thread stacks -pub const MAP_STACK = 0x20000; +pub const MAP_STACK = if (is_mips) 0x40000 else 0x20000; /// create a huge page mapping -pub const MAP_HUGETLB = 0x40000; +pub const MAP_HUGETLB = if (is_mips) 0x80000 else 0x40000; /// perform synchronous page faults for the mapping pub const MAP_SYNC = 0x80000; @@ -247,15 +250,15 @@ pub const SHUT_RD = 0; pub const SHUT_WR = 1; pub const SHUT_RDWR = 2; -pub const SOCK_STREAM = 1; -pub const SOCK_DGRAM = 2; +pub const SOCK_STREAM = if (is_mips) 2 else 1; +pub const SOCK_DGRAM = if (is_mips) 1 else 2; pub const SOCK_RAW = 3; pub const SOCK_RDM = 4; pub const SOCK_SEQPACKET = 5; pub const SOCK_DCCP = 6; pub const SOCK_PACKET = 10; pub const SOCK_CLOEXEC = 0o2000000; -pub const SOCK_NONBLOCK = 0o4000; +pub const SOCK_NONBLOCK = if (is_mips) 0o200 else 0o4000; pub const PF_UNSPEC = 0; pub const PF_LOCAL = 1; @@ -355,32 +358,38 @@ pub const AF_QIPCRTR = PF_QIPCRTR; pub const AF_SMC = PF_SMC; pub const AF_MAX = PF_MAX; -pub const SO_DEBUG = 1; -pub const SO_REUSEADDR = 2; -pub const SO_TYPE = 3; -pub const SO_ERROR = 4; -pub const SO_DONTROUTE = 5; -pub const SO_BROADCAST = 6; -pub const SO_SNDBUF = 7; -pub const SO_RCVBUF = 8; -pub const SO_KEEPALIVE = 9; -pub const SO_OOBINLINE = 10; -pub const SO_NO_CHECK = 11; -pub const SO_PRIORITY = 12; -pub const SO_LINGER = 13; -pub const SO_BSDCOMPAT = 14; -pub const SO_REUSEPORT = 15; -pub const SO_PASSCRED = 16; -pub const SO_PEERCRED = 17; -pub const SO_RCVLOWAT = 18; -pub const SO_SNDLOWAT = 19; -pub const SO_RCVTIMEO = 20; -pub const SO_SNDTIMEO = 21; -pub const SO_ACCEPTCONN = 30; -pub const SO_SNDBUFFORCE = 32; -pub const SO_RCVBUFFORCE = 33; -pub const SO_PROTOCOL = 38; -pub const SO_DOMAIN = 39; +pub usingnamespace if (!@hasDecl(@This(), "SO_DEBUG")) + struct { + const SO_DEBUG = 1; + const SO_REUSEADDR = 2; + const SO_TYPE = 3; + const SO_ERROR = 4; + const SO_DONTROUTE = 5; + const SO_BROADCAST = 6; + const SO_SNDBUF = 7; + const SO_RCVBUF = 8; + const SO_KEEPALIVE = 9; + const SO_OOBINLINE = 10; + const SO_NO_CHECK = 11; + const SO_PRIORITY = 12; + const SO_LINGER = 13; + const SO_BSDCOMPAT = 14; + const SO_REUSEPORT = 15; + const SO_PASSCRED = 16; + const SO_PEERCRED = 17; + const SO_RCVLOWAT = 18; + const SO_SNDLOWAT = 19; + const SO_RCVTIMEO = 20; + const SO_SNDTIMEO = 21; + const SO_ACCEPTCONN = 30; + const SO_PEERSEC = 31; + const SO_SNDBUFFORCE = 32; + const SO_RCVBUFFORCE = 33; + const SO_PROTOCOL = 38; + const SO_DOMAIN = 39; + } +else + struct {}; pub const SO_SECURITY_AUTHENTICATION = 22; pub const SO_SECURITY_ENCRYPTION_TRANSPORT = 23; @@ -394,11 +403,11 @@ pub const SO_GET_FILTER = SO_ATTACH_FILTER; pub const SO_PEERNAME = 28; pub const SO_TIMESTAMP_OLD = 29; -pub const SO_PEERSEC = 31; pub const SO_PASSSEC = 34; pub const SO_TIMESTAMPNS_OLD = 35; pub const SO_MARK = 36; pub const SO_TIMESTAMPING_OLD = 37; + pub const SO_RXQ_OVFL = 40; pub const SO_WIFI_STATUS = 41; pub const SCM_WIFI_STATUS = SO_WIFI_STATUS; @@ -432,7 +441,7 @@ pub const SO_RCVTIMEO_NEW = 66; pub const SO_SNDTIMEO_NEW = 67; pub const SO_DETACH_REUSEPORT_BPF = 68; -pub const SOL_SOCKET = 1; +pub const SOL_SOCKET = if (is_mips) 65535 else 1; pub const SOL_IP = 0; pub const SOL_IPV6 = 41; @@ -496,7 +505,7 @@ pub const DT_LNK = 10; pub const DT_SOCK = 12; pub const DT_WHT = 14; -pub const TCGETS = 0x5401; +pub const TCGETS = if (is_mips) 0x540D else 0x5401; pub const TCSETS = 0x5402; pub const TCSETSW = 0x5403; pub const TCSETSF = 0x5404; @@ -512,17 +521,17 @@ pub const TIOCNXCL = 0x540D; pub const TIOCSCTTY = 0x540E; pub const TIOCGPGRP = 0x540F; pub const TIOCSPGRP = 0x5410; -pub const TIOCOUTQ = 0x5411; +pub const TIOCOUTQ = if (is_mips) 0x7472 else 0x5411; pub const TIOCSTI = 0x5412; -pub const TIOCGWINSZ = 0x5413; -pub const TIOCSWINSZ = 0x5414; +pub const TIOCGWINSZ = if (is_mips) 0x40087468 else 0x5413; +pub const TIOCSWINSZ = if (is_mips) 0x40087467 else 0x5414; pub const TIOCMGET = 0x5415; pub const TIOCMBIS = 0x5416; pub const TIOCMBIC = 0x5417; pub const TIOCMSET = 0x5418; pub const TIOCGSOFTCAR = 0x5419; pub const TIOCSSOFTCAR = 0x541A; -pub const FIONREAD = 0x541B; +pub const FIONREAD = if (is_mips) 0x467F else 0x541B; pub const TIOCINQ = FIONREAD; pub const TIOCLINUX = 0x541C; pub const TIOCCONS = 0x541D; @@ -563,8 +572,8 @@ pub const EPOLLPRI = 0x002; pub const EPOLLOUT = 0x004; pub const EPOLLRDNORM = 0x040; pub const EPOLLRDBAND = 0x080; -pub const EPOLLWRNORM = 0x100; -pub const EPOLLWRBAND = 0x200; +pub const EPOLLWRNORM = if (is_mips) 0x004 else 0x100; +pub const EPOLLWRBAND = if (is_mips) 0x100 else 0x200; pub const EPOLLMSG = 0x400; pub const EPOLLERR = 0x008; pub const EPOLLHUP = 0x010; -- cgit v1.2.3 From a9be62f0858749ae479d05167392c7cf965da3ce Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Thu, 26 Sep 2019 11:49:49 +0200 Subject: Fix wrong IOCTL value --- lib/std/os/bits/linux.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/std/os/bits/linux.zig') diff --git a/lib/std/os/bits/linux.zig b/lib/std/os/bits/linux.zig index ed4d704447..7cf6658a48 100644 --- a/lib/std/os/bits/linux.zig +++ b/lib/std/os/bits/linux.zig @@ -524,7 +524,7 @@ pub const TIOCSPGRP = 0x5410; pub const TIOCOUTQ = if (is_mips) 0x7472 else 0x5411; pub const TIOCSTI = 0x5412; pub const TIOCGWINSZ = if (is_mips) 0x40087468 else 0x5413; -pub const TIOCSWINSZ = if (is_mips) 0x40087467 else 0x5414; +pub const TIOCSWINSZ = if (is_mips) 0x80087467 else 0x5414; pub const TIOCMGET = 0x5415; pub const TIOCMBIS = 0x5416; pub const TIOCMBIC = 0x5417; -- cgit v1.2.3 From a94372231ca3c4daab3cf2bc54d2de135ecdd5e8 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Thu, 26 Sep 2019 18:07:39 +0200 Subject: Errno changes for MIPS --- lib/std/os/bits/linux.zig | 6 +- lib/std/os/bits/linux/errno-generic.zig | 428 ++++++++++++++++++++++++++++++++ lib/std/os/bits/linux/errno-mips.zig | 134 ++++++++++ lib/std/os/bits/linux/errno.zig | 428 -------------------------------- lib/std/os/zen.zig | 2 +- 5 files changed, 568 insertions(+), 430 deletions(-) create mode 100644 lib/std/os/bits/linux/errno-generic.zig create mode 100644 lib/std/os/bits/linux/errno-mips.zig delete mode 100644 lib/std/os/bits/linux/errno.zig (limited to 'lib/std/os/bits/linux.zig') diff --git a/lib/std/os/bits/linux.zig b/lib/std/os/bits/linux.zig index 7cf6658a48..2cc55e1469 100644 --- a/lib/std/os/bits/linux.zig +++ b/lib/std/os/bits/linux.zig @@ -3,7 +3,11 @@ const std = @import("../../std.zig"); const maxInt = std.math.maxInt; usingnamespace @import("../bits.zig"); -pub usingnamespace @import("linux/errno.zig"); +pub usingnamespace switch (builtin.arch) { + .mips, .mipsel => @import("linux/errno-mips.zig"), + else => @import("linux/errno-generic.zig"), +}; + pub usingnamespace switch (builtin.arch) { .x86_64 => @import("linux/x86_64.zig"), .aarch64 => @import("linux/arm64.zig"), diff --git a/lib/std/os/bits/linux/errno-generic.zig b/lib/std/os/bits/linux/errno-generic.zig new file mode 100644 index 0000000000..741f76fdee --- /dev/null +++ b/lib/std/os/bits/linux/errno-generic.zig @@ -0,0 +1,428 @@ +/// Operation not permitted +pub const EPERM = 1; + +/// No such file or directory +pub const ENOENT = 2; + +/// No such process +pub const ESRCH = 3; + +/// Interrupted system call +pub const EINTR = 4; + +/// I/O error +pub const EIO = 5; + +/// No such device or address +pub const ENXIO = 6; + +/// Arg list too long +pub const E2BIG = 7; + +/// Exec format error +pub const ENOEXEC = 8; + +/// Bad file number +pub const EBADF = 9; + +/// No child processes +pub const ECHILD = 10; + +/// Try again +pub const EAGAIN = 11; + +/// Out of memory +pub const ENOMEM = 12; + +/// Permission denied +pub const EACCES = 13; + +/// Bad address +pub const EFAULT = 14; + +/// Block device required +pub const ENOTBLK = 15; + +/// Device or resource busy +pub const EBUSY = 16; + +/// File exists +pub const EEXIST = 17; + +/// Cross-device link +pub const EXDEV = 18; + +/// No such device +pub const ENODEV = 19; + +/// Not a directory +pub const ENOTDIR = 20; + +/// Is a directory +pub const EISDIR = 21; + +/// Invalid argument +pub const EINVAL = 22; + +/// File table overflow +pub const ENFILE = 23; + +/// Too many open files +pub const EMFILE = 24; + +/// Not a typewriter +pub const ENOTTY = 25; + +/// Text file busy +pub const ETXTBSY = 26; + +/// File too large +pub const EFBIG = 27; + +/// No space left on device +pub const ENOSPC = 28; + +/// Illegal seek +pub const ESPIPE = 29; + +/// Read-only file system +pub const EROFS = 30; + +/// Too many links +pub const EMLINK = 31; + +/// Broken pipe +pub const EPIPE = 32; + +/// Math argument out of domain of func +pub const EDOM = 33; + +/// Math result not representable +pub const ERANGE = 34; + +/// Resource deadlock would occur +pub const EDEADLK = 35; + +/// File name too long +pub const ENAMETOOLONG = 36; + +/// No record locks available +pub const ENOLCK = 37; + +/// Function not implemented +pub const ENOSYS = 38; + +/// Directory not empty +pub const ENOTEMPTY = 39; + +/// Too many symbolic links encountered +pub const ELOOP = 40; + +/// Operation would block +pub const EWOULDBLOCK = EAGAIN; + +/// No message of desired type +pub const ENOMSG = 42; + +/// Identifier removed +pub const EIDRM = 43; + +/// Channel number out of range +pub const ECHRNG = 44; + +/// Level 2 not synchronized +pub const EL2NSYNC = 45; + +/// Level 3 halted +pub const EL3HLT = 46; + +/// Level 3 reset +pub const EL3RST = 47; + +/// Link number out of range +pub const ELNRNG = 48; + +/// Protocol driver not attached +pub const EUNATCH = 49; + +/// No CSI structure available +pub const ENOCSI = 50; + +/// Level 2 halted +pub const EL2HLT = 51; + +/// Invalid exchange +pub const EBADE = 52; + +/// Invalid request descriptor +pub const EBADR = 53; + +/// Exchange full +pub const EXFULL = 54; + +/// No anode +pub const ENOANO = 55; + +/// Invalid request code +pub const EBADRQC = 56; + +/// Invalid slot +pub const EBADSLT = 57; + +/// Bad font file format +pub const EBFONT = 59; + +/// Device not a stream +pub const ENOSTR = 60; + +/// No data available +pub const ENODATA = 61; + +/// Timer expired +pub const ETIME = 62; + +/// Out of streams resources +pub const ENOSR = 63; + +/// Machine is not on the network +pub const ENONET = 64; + +/// Package not installed +pub const ENOPKG = 65; + +/// Object is remote +pub const EREMOTE = 66; + +/// Link has been severed +pub const ENOLINK = 67; + +/// Advertise error +pub const EADV = 68; + +/// Srmount error +pub const ESRMNT = 69; + +/// Communication error on send +pub const ECOMM = 70; + +/// Protocol error +pub const EPROTO = 71; + +/// Multihop attempted +pub const EMULTIHOP = 72; + +/// RFS specific error +pub const EDOTDOT = 73; + +/// Not a data message +pub const EBADMSG = 74; + +/// Value too large for defined data type +pub const EOVERFLOW = 75; + +/// Name not unique on network +pub const ENOTUNIQ = 76; + +/// File descriptor in bad state +pub const EBADFD = 77; + +/// Remote address changed +pub const EREMCHG = 78; + +/// Can not access a needed shared library +pub const ELIBACC = 79; + +/// Accessing a corrupted shared library +pub const ELIBBAD = 80; + +/// .lib section in a.out corrupted +pub const ELIBSCN = 81; + +/// Attempting to link in too many shared libraries +pub const ELIBMAX = 82; + +/// Cannot exec a shared library directly +pub const ELIBEXEC = 83; + +/// Illegal byte sequence +pub const EILSEQ = 84; + +/// Interrupted system call should be restarted +pub const ERESTART = 85; + +/// Streams pipe error +pub const ESTRPIPE = 86; + +/// Too many users +pub const EUSERS = 87; + +/// Socket operation on non-socket +pub const ENOTSOCK = 88; + +/// Destination address required +pub const EDESTADDRREQ = 89; + +/// Message too long +pub const EMSGSIZE = 90; + +/// Protocol wrong type for socket +pub const EPROTOTYPE = 91; + +/// Protocol not available +pub const ENOPROTOOPT = 92; + +/// Protocol not supported +pub const EPROTONOSUPPORT = 93; + +/// Socket type not supported +pub const ESOCKTNOSUPPORT = 94; + +/// Operation not supported on transport endpoint +pub const EOPNOTSUPP = 95; +pub const ENOTSUP = EOPNOTSUPP; + +/// Protocol family not supported +pub const EPFNOSUPPORT = 96; + +/// Address family not supported by protocol +pub const EAFNOSUPPORT = 97; + +/// Address already in use +pub const EADDRINUSE = 98; + +/// Cannot assign requested address +pub const EADDRNOTAVAIL = 99; + +/// Network is down +pub const ENETDOWN = 100; + +/// Network is unreachable +pub const ENETUNREACH = 101; + +/// Network dropped connection because of reset +pub const ENETRESET = 102; + +/// Software caused connection abort +pub const ECONNABORTED = 103; + +/// Connection reset by peer +pub const ECONNRESET = 104; + +/// No buffer space available +pub const ENOBUFS = 105; + +/// Transport endpoint is already connected +pub const EISCONN = 106; + +/// Transport endpoint is not connected +pub const ENOTCONN = 107; + +/// Cannot send after transport endpoint shutdown +pub const ESHUTDOWN = 108; + +/// Too many references: cannot splice +pub const ETOOMANYREFS = 109; + +/// Connection timed out +pub const ETIMEDOUT = 110; + +/// Connection refused +pub const ECONNREFUSED = 111; + +/// Host is down +pub const EHOSTDOWN = 112; + +/// No route to host +pub const EHOSTUNREACH = 113; + +/// Operation already in progress +pub const EALREADY = 114; + +/// Operation now in progress +pub const EINPROGRESS = 115; + +/// Stale NFS file handle +pub const ESTALE = 116; + +/// Structure needs cleaning +pub const EUCLEAN = 117; + +/// Not a XENIX named type file +pub const ENOTNAM = 118; + +/// No XENIX semaphores available +pub const ENAVAIL = 119; + +/// Is a named type file +pub const EISNAM = 120; + +/// Remote I/O error +pub const EREMOTEIO = 121; + +/// Quota exceeded +pub const EDQUOT = 122; + +/// No medium found +pub const ENOMEDIUM = 123; + +/// Wrong medium type +pub const EMEDIUMTYPE = 124; + +// nameserver query return codes + +/// DNS server returned answer with no data +pub const ENSROK = 0; + +/// DNS server returned answer with no data +pub const ENSRNODATA = 160; + +/// DNS server claims query was misformatted +pub const ENSRFORMERR = 161; + +/// DNS server returned general failure +pub const ENSRSERVFAIL = 162; + +/// Domain name not found +pub const ENSRNOTFOUND = 163; + +/// DNS server does not implement requested operation +pub const ENSRNOTIMP = 164; + +/// DNS server refused query +pub const ENSRREFUSED = 165; + +/// Misformatted DNS query +pub const ENSRBADQUERY = 166; + +/// Misformatted domain name +pub const ENSRBADNAME = 167; + +/// Unsupported address family +pub const ENSRBADFAMILY = 168; + +/// Misformatted DNS reply +pub const ENSRBADRESP = 169; + +/// Could not contact DNS servers +pub const ENSRCONNREFUSED = 170; + +/// Timeout while contacting DNS servers +pub const ENSRTIMEOUT = 171; + +/// End of file +pub const ENSROF = 172; + +/// Error reading file +pub const ENSRFILE = 173; + +/// Out of memory +pub const ENSRNOMEM = 174; + +/// Application terminated lookup +pub const ENSRDESTRUCTION = 175; + +/// Domain name is too long +pub const ENSRQUERYDOMAINTOOLONG = 176; + +/// Domain name is too long +pub const ENSRCNAMELOOP = 177; diff --git a/lib/std/os/bits/linux/errno-mips.zig b/lib/std/os/bits/linux/errno-mips.zig new file mode 100644 index 0000000000..81cbde4af4 --- /dev/null +++ b/lib/std/os/bits/linux/errno-mips.zig @@ -0,0 +1,134 @@ +pub const EPERM = 1; +pub const ENOENT = 2; +pub const ESRCH = 3; +pub const EINTR = 4; +pub const EIO = 5; +pub const ENXIO = 6; +pub const E2BIG = 7; +pub const ENOEXEC = 8; +pub const EBADF = 9; +pub const ECHILD = 10; +pub const EAGAIN = 11; +pub const ENOMEM = 12; +pub const EACCES = 13; +pub const EFAULT = 14; +pub const ENOTBLK = 15; +pub const EBUSY = 16; +pub const EEXIST = 17; +pub const EXDEV = 18; +pub const ENODEV = 19; +pub const ENOTDIR = 20; +pub const EISDIR = 21; +pub const EINVAL = 22; +pub const ENFILE = 23; +pub const EMFILE = 24; +pub const ENOTTY = 25; +pub const ETXTBSY = 26; +pub const EFBIG = 27; +pub const ENOSPC = 28; +pub const ESPIPE = 29; +pub const EROFS = 30; +pub const EMLINK = 31; +pub const EPIPE = 32; +pub const EDOM = 33; +pub const ERANGE = 34; +pub const ENOMSG = 35; +pub const EIDRM = 36; +pub const ECHRNG = 37; +pub const EL2NSYNC = 38; +pub const EL3HLT = 39; +pub const EL3RST = 40; +pub const ELNRNG = 41; +pub const EUNATCH = 42; +pub const ENOCSI = 43; +pub const EL2HLT = 44; +pub const EDEADLK = 45; +pub const ENOLCK = 46; +pub const EBADE = 50; +pub const EBADR = 51; +pub const EXFULL = 52; +pub const ENOANO = 53; +pub const EBADRQC = 54; +pub const EBADSLT = 55; +pub const EDEADLOCK = 56; +pub const EBFONT = 59; +pub const ENOSTR = 60; +pub const ENODATA = 61; +pub const ETIME = 62; +pub const ENOSR = 63; +pub const ENONET = 64; +pub const ENOPKG = 65; +pub const EREMOTE = 66; +pub const ENOLINK = 67; +pub const EADV = 68; +pub const ESRMNT = 69; +pub const ECOMM = 70; +pub const EPROTO = 71; +pub const EDOTDOT = 73; +pub const EMULTIHOP = 74; +pub const EBADMSG = 77; +pub const ENAMETOOLONG = 78; +pub const EOVERFLOW = 79; +pub const ENOTUNIQ = 80; +pub const EBADFD = 81; +pub const EREMCHG = 82; +pub const ELIBACC = 83; +pub const ELIBBAD = 84; +pub const ELIBSCN = 85; +pub const ELIBMAX = 86; +pub const ELIBEXEC = 87; +pub const EILSEQ = 88; +pub const ENOSYS = 89; +pub const ELOOP = 90; +pub const ERESTART = 91; +pub const ESTRPIPE = 92; +pub const ENOTEMPTY = 93; +pub const EUSERS = 94; +pub const ENOTSOCK = 95; +pub const EDESTADDRREQ = 96; +pub const EMSGSIZE = 97; +pub const EPROTOTYPE = 98; +pub const ENOPROTOOPT = 99; +pub const EPROTONOSUPPORT = 120; +pub const ESOCKTNOSUPPORT = 121; +pub const EOPNOTSUPP = 122; +pub const ENOTSUP = EOPNOTSUPP; +pub const EPFNOSUPPORT = 123; +pub const EAFNOSUPPORT = 124; +pub const EADDRINUSE = 125; +pub const EADDRNOTAVAIL = 126; +pub const ENETDOWN = 127; +pub const ENETUNREACH = 128; +pub const ENETRESET = 129; +pub const ECONNABORTED = 130; +pub const ECONNRESET = 131; +pub const ENOBUFS = 132; +pub const EISCONN = 133; +pub const ENOTCONN = 134; +pub const EUCLEAN = 135; +pub const ENOTNAM = 137; +pub const ENAVAIL = 138; +pub const EISNAM = 139; +pub const EREMOTEIO = 140; +pub const ESHUTDOWN = 143; +pub const ETOOMANYREFS = 144; +pub const ETIMEDOUT = 145; +pub const ECONNREFUSED = 146; +pub const EHOSTDOWN = 147; +pub const EHOSTUNREACH = 148; +pub const EWOULDBLOCK = EAGAIN; +pub const EALREADY = 149; +pub const EINPROGRESS = 150; +pub const ESTALE = 151; +pub const ECANCELED = 158; +pub const ENOMEDIUM = 159; +pub const EMEDIUMTYPE = 160; +pub const ENOKEY = 161; +pub const EKEYEXPIRED = 162; +pub const EKEYREVOKED = 163; +pub const EKEYREJECTED = 164; +pub const EOWNERDEAD = 165; +pub const ENOTRECOVERABLE = 166; +pub const ERFKILL = 167; +pub const EHWPOISON = 168; +pub const EDQUOT = 1133; diff --git a/lib/std/os/bits/linux/errno.zig b/lib/std/os/bits/linux/errno.zig deleted file mode 100644 index 741f76fdee..0000000000 --- a/lib/std/os/bits/linux/errno.zig +++ /dev/null @@ -1,428 +0,0 @@ -/// Operation not permitted -pub const EPERM = 1; - -/// No such file or directory -pub const ENOENT = 2; - -/// No such process -pub const ESRCH = 3; - -/// Interrupted system call -pub const EINTR = 4; - -/// I/O error -pub const EIO = 5; - -/// No such device or address -pub const ENXIO = 6; - -/// Arg list too long -pub const E2BIG = 7; - -/// Exec format error -pub const ENOEXEC = 8; - -/// Bad file number -pub const EBADF = 9; - -/// No child processes -pub const ECHILD = 10; - -/// Try again -pub const EAGAIN = 11; - -/// Out of memory -pub const ENOMEM = 12; - -/// Permission denied -pub const EACCES = 13; - -/// Bad address -pub const EFAULT = 14; - -/// Block device required -pub const ENOTBLK = 15; - -/// Device or resource busy -pub const EBUSY = 16; - -/// File exists -pub const EEXIST = 17; - -/// Cross-device link -pub const EXDEV = 18; - -/// No such device -pub const ENODEV = 19; - -/// Not a directory -pub const ENOTDIR = 20; - -/// Is a directory -pub const EISDIR = 21; - -/// Invalid argument -pub const EINVAL = 22; - -/// File table overflow -pub const ENFILE = 23; - -/// Too many open files -pub const EMFILE = 24; - -/// Not a typewriter -pub const ENOTTY = 25; - -/// Text file busy -pub const ETXTBSY = 26; - -/// File too large -pub const EFBIG = 27; - -/// No space left on device -pub const ENOSPC = 28; - -/// Illegal seek -pub const ESPIPE = 29; - -/// Read-only file system -pub const EROFS = 30; - -/// Too many links -pub const EMLINK = 31; - -/// Broken pipe -pub const EPIPE = 32; - -/// Math argument out of domain of func -pub const EDOM = 33; - -/// Math result not representable -pub const ERANGE = 34; - -/// Resource deadlock would occur -pub const EDEADLK = 35; - -/// File name too long -pub const ENAMETOOLONG = 36; - -/// No record locks available -pub const ENOLCK = 37; - -/// Function not implemented -pub const ENOSYS = 38; - -/// Directory not empty -pub const ENOTEMPTY = 39; - -/// Too many symbolic links encountered -pub const ELOOP = 40; - -/// Operation would block -pub const EWOULDBLOCK = EAGAIN; - -/// No message of desired type -pub const ENOMSG = 42; - -/// Identifier removed -pub const EIDRM = 43; - -/// Channel number out of range -pub const ECHRNG = 44; - -/// Level 2 not synchronized -pub const EL2NSYNC = 45; - -/// Level 3 halted -pub const EL3HLT = 46; - -/// Level 3 reset -pub const EL3RST = 47; - -/// Link number out of range -pub const ELNRNG = 48; - -/// Protocol driver not attached -pub const EUNATCH = 49; - -/// No CSI structure available -pub const ENOCSI = 50; - -/// Level 2 halted -pub const EL2HLT = 51; - -/// Invalid exchange -pub const EBADE = 52; - -/// Invalid request descriptor -pub const EBADR = 53; - -/// Exchange full -pub const EXFULL = 54; - -/// No anode -pub const ENOANO = 55; - -/// Invalid request code -pub const EBADRQC = 56; - -/// Invalid slot -pub const EBADSLT = 57; - -/// Bad font file format -pub const EBFONT = 59; - -/// Device not a stream -pub const ENOSTR = 60; - -/// No data available -pub const ENODATA = 61; - -/// Timer expired -pub const ETIME = 62; - -/// Out of streams resources -pub const ENOSR = 63; - -/// Machine is not on the network -pub const ENONET = 64; - -/// Package not installed -pub const ENOPKG = 65; - -/// Object is remote -pub const EREMOTE = 66; - -/// Link has been severed -pub const ENOLINK = 67; - -/// Advertise error -pub const EADV = 68; - -/// Srmount error -pub const ESRMNT = 69; - -/// Communication error on send -pub const ECOMM = 70; - -/// Protocol error -pub const EPROTO = 71; - -/// Multihop attempted -pub const EMULTIHOP = 72; - -/// RFS specific error -pub const EDOTDOT = 73; - -/// Not a data message -pub const EBADMSG = 74; - -/// Value too large for defined data type -pub const EOVERFLOW = 75; - -/// Name not unique on network -pub const ENOTUNIQ = 76; - -/// File descriptor in bad state -pub const EBADFD = 77; - -/// Remote address changed -pub const EREMCHG = 78; - -/// Can not access a needed shared library -pub const ELIBACC = 79; - -/// Accessing a corrupted shared library -pub const ELIBBAD = 80; - -/// .lib section in a.out corrupted -pub const ELIBSCN = 81; - -/// Attempting to link in too many shared libraries -pub const ELIBMAX = 82; - -/// Cannot exec a shared library directly -pub const ELIBEXEC = 83; - -/// Illegal byte sequence -pub const EILSEQ = 84; - -/// Interrupted system call should be restarted -pub const ERESTART = 85; - -/// Streams pipe error -pub const ESTRPIPE = 86; - -/// Too many users -pub const EUSERS = 87; - -/// Socket operation on non-socket -pub const ENOTSOCK = 88; - -/// Destination address required -pub const EDESTADDRREQ = 89; - -/// Message too long -pub const EMSGSIZE = 90; - -/// Protocol wrong type for socket -pub const EPROTOTYPE = 91; - -/// Protocol not available -pub const ENOPROTOOPT = 92; - -/// Protocol not supported -pub const EPROTONOSUPPORT = 93; - -/// Socket type not supported -pub const ESOCKTNOSUPPORT = 94; - -/// Operation not supported on transport endpoint -pub const EOPNOTSUPP = 95; -pub const ENOTSUP = EOPNOTSUPP; - -/// Protocol family not supported -pub const EPFNOSUPPORT = 96; - -/// Address family not supported by protocol -pub const EAFNOSUPPORT = 97; - -/// Address already in use -pub const EADDRINUSE = 98; - -/// Cannot assign requested address -pub const EADDRNOTAVAIL = 99; - -/// Network is down -pub const ENETDOWN = 100; - -/// Network is unreachable -pub const ENETUNREACH = 101; - -/// Network dropped connection because of reset -pub const ENETRESET = 102; - -/// Software caused connection abort -pub const ECONNABORTED = 103; - -/// Connection reset by peer -pub const ECONNRESET = 104; - -/// No buffer space available -pub const ENOBUFS = 105; - -/// Transport endpoint is already connected -pub const EISCONN = 106; - -/// Transport endpoint is not connected -pub const ENOTCONN = 107; - -/// Cannot send after transport endpoint shutdown -pub const ESHUTDOWN = 108; - -/// Too many references: cannot splice -pub const ETOOMANYREFS = 109; - -/// Connection timed out -pub const ETIMEDOUT = 110; - -/// Connection refused -pub const ECONNREFUSED = 111; - -/// Host is down -pub const EHOSTDOWN = 112; - -/// No route to host -pub const EHOSTUNREACH = 113; - -/// Operation already in progress -pub const EALREADY = 114; - -/// Operation now in progress -pub const EINPROGRESS = 115; - -/// Stale NFS file handle -pub const ESTALE = 116; - -/// Structure needs cleaning -pub const EUCLEAN = 117; - -/// Not a XENIX named type file -pub const ENOTNAM = 118; - -/// No XENIX semaphores available -pub const ENAVAIL = 119; - -/// Is a named type file -pub const EISNAM = 120; - -/// Remote I/O error -pub const EREMOTEIO = 121; - -/// Quota exceeded -pub const EDQUOT = 122; - -/// No medium found -pub const ENOMEDIUM = 123; - -/// Wrong medium type -pub const EMEDIUMTYPE = 124; - -// nameserver query return codes - -/// DNS server returned answer with no data -pub const ENSROK = 0; - -/// DNS server returned answer with no data -pub const ENSRNODATA = 160; - -/// DNS server claims query was misformatted -pub const ENSRFORMERR = 161; - -/// DNS server returned general failure -pub const ENSRSERVFAIL = 162; - -/// Domain name not found -pub const ENSRNOTFOUND = 163; - -/// DNS server does not implement requested operation -pub const ENSRNOTIMP = 164; - -/// DNS server refused query -pub const ENSRREFUSED = 165; - -/// Misformatted DNS query -pub const ENSRBADQUERY = 166; - -/// Misformatted domain name -pub const ENSRBADNAME = 167; - -/// Unsupported address family -pub const ENSRBADFAMILY = 168; - -/// Misformatted DNS reply -pub const ENSRBADRESP = 169; - -/// Could not contact DNS servers -pub const ENSRCONNREFUSED = 170; - -/// Timeout while contacting DNS servers -pub const ENSRTIMEOUT = 171; - -/// End of file -pub const ENSROF = 172; - -/// Error reading file -pub const ENSRFILE = 173; - -/// Out of memory -pub const ENSRNOMEM = 174; - -/// Application terminated lookup -pub const ENSRDESTRUCTION = 175; - -/// Domain name is too long -pub const ENSRQUERYDOMAINTOOLONG = 176; - -/// Domain name is too long -pub const ENSRCNAMELOOP = 177; diff --git a/lib/std/os/zen.zig b/lib/std/os/zen.zig index 727f55fa6d..9d111d98ae 100644 --- a/lib/std/os/zen.zig +++ b/lib/std/os/zen.zig @@ -80,7 +80,7 @@ pub const STDOUT_FILENO = 1; pub const STDERR_FILENO = 2; // FIXME: let's borrow Linux's error numbers for now. -usingnamespace @import("bits/linux/errno.zig"); +usingnamespace @import("bits/linux/errno-generic.zig"); // Get the errno from a syscall return value, or 0 for no error. pub fn getErrno(r: usize) usize { const signed_r = @bitCast(isize, r); -- cgit v1.2.3