| author | |
| committer | |
| log | a94372231ca3c4daab3cf2bc54d2de135ecdd5e8 |
| tree | 265edb29f69ad595b08f77795e230526d3653a8d |
| parent | dfb4446d091b3db21d0ce953d76948788e7feb89 |
5 files changed, 568 insertions(+), 430 deletions(-)
lib/std/os/bits/linux.zig+5-1| ... | @@ -3,7 +3,11 @@ const std = @import("../../std.zig"); | ... | @@ -3,7 +3,11 @@ const std = @import("../../std.zig"); |
| 3 | const maxInt = std.math.maxInt; | 3 | const maxInt = std.math.maxInt; |
| 4 | usingnamespace @import("../bits.zig"); | 4 | usingnamespace @import("../bits.zig"); |
| 5 | 5 | ||
| 6 | pub usingnamespace @import("linux/errno.zig"); | 6 | pub usingnamespace switch (builtin.arch) { |
| 7 | .mips, .mipsel => @import("linux/errno-mips.zig"), | ||
| 8 | else => @import("linux/errno-generic.zig"), | ||
| 9 | }; | ||
| 10 | |||
| 7 | pub usingnamespace switch (builtin.arch) { | 11 | pub usingnamespace switch (builtin.arch) { |
| 8 | .x86_64 => @import("linux/x86_64.zig"), | 12 | .x86_64 => @import("linux/x86_64.zig"), |
| 9 | .aarch64 => @import("linux/arm64.zig"), | 13 | .aarch64 => @import("linux/arm64.zig"), |
lib/std/os/bits/linux/errno-generic.zig created+428| ... | @@ -0,0 +1,428 @@ | ||
| 1 | /// Operation not permitted | ||
| 2 | pub const EPERM = 1; | ||
| 3 | |||
| 4 | /// No such file or directory | ||
| 5 | pub const ENOENT = 2; | ||
| 6 | |||
| 7 | /// No such process | ||
| 8 | pub const ESRCH = 3; | ||
| 9 | |||
| 10 | /// Interrupted system call | ||
| 11 | pub const EINTR = 4; | ||
| 12 | |||
| 13 | /// I/O error | ||
| 14 | pub const EIO = 5; | ||
| 15 | |||
| 16 | /// No such device or address | ||
| 17 | pub const ENXIO = 6; | ||
| 18 | |||
| 19 | /// Arg list too long | ||
| 20 | pub const E2BIG = 7; | ||
| 21 | |||
| 22 | /// Exec format error | ||
| 23 | pub const ENOEXEC = 8; | ||
| 24 | |||
| 25 | /// Bad file number | ||
| 26 | pub const EBADF = 9; | ||
| 27 | |||
| 28 | /// No child processes | ||
| 29 | pub const ECHILD = 10; | ||
| 30 | |||
| 31 | /// Try again | ||
| 32 | pub const EAGAIN = 11; | ||
| 33 | |||
| 34 | /// Out of memory | ||
| 35 | pub const ENOMEM = 12; | ||
| 36 | |||
| 37 | /// Permission denied | ||
| 38 | pub const EACCES = 13; | ||
| 39 | |||
| 40 | /// Bad address | ||
| 41 | pub const EFAULT = 14; | ||
| 42 | |||
| 43 | /// Block device required | ||
| 44 | pub const ENOTBLK = 15; | ||
| 45 | |||
| 46 | /// Device or resource busy | ||
| 47 | pub const EBUSY = 16; | ||
| 48 | |||
| 49 | /// File exists | ||
| 50 | pub const EEXIST = 17; | ||
| 51 | |||
| 52 | /// Cross-device link | ||
| 53 | pub const EXDEV = 18; | ||
| 54 | |||
| 55 | /// No such device | ||
| 56 | pub const ENODEV = 19; | ||
| 57 | |||
| 58 | /// Not a directory | ||
| 59 | pub const ENOTDIR = 20; | ||
| 60 | |||
| 61 | /// Is a directory | ||
| 62 | pub const EISDIR = 21; | ||
| 63 | |||
| 64 | /// Invalid argument | ||
| 65 | pub const EINVAL = 22; | ||
| 66 | |||
| 67 | /// File table overflow | ||
| 68 | pub const ENFILE = 23; | ||
| 69 | |||
| 70 | /// Too many open files | ||
| 71 | pub const EMFILE = 24; | ||
| 72 | |||
| 73 | /// Not a typewriter | ||
| 74 | pub const ENOTTY = 25; | ||
| 75 | |||
| 76 | /// Text file busy | ||
| 77 | pub const ETXTBSY = 26; | ||
| 78 | |||
| 79 | /// File too large | ||
| 80 | pub const EFBIG = 27; | ||
| 81 | |||
| 82 | /// No space left on device | ||
| 83 | pub const ENOSPC = 28; | ||
| 84 | |||
| 85 | /// Illegal seek | ||
| 86 | pub const ESPIPE = 29; | ||
| 87 | |||
| 88 | /// Read-only file system | ||
| 89 | pub const EROFS = 30; | ||
| 90 | |||
| 91 | /// Too many links | ||
| 92 | pub const EMLINK = 31; | ||
| 93 | |||
| 94 | /// Broken pipe | ||
| 95 | pub const EPIPE = 32; | ||
| 96 | |||
| 97 | /// Math argument out of domain of func | ||
| 98 | pub const EDOM = 33; | ||
| 99 | |||
| 100 | /// Math result not representable | ||
| 101 | pub const ERANGE = 34; | ||
| 102 | |||
| 103 | /// Resource deadlock would occur | ||
| 104 | pub const EDEADLK = 35; | ||
| 105 | |||
| 106 | /// File name too long | ||
| 107 | pub const ENAMETOOLONG = 36; | ||
| 108 | |||
| 109 | /// No record locks available | ||
| 110 | pub const ENOLCK = 37; | ||
| 111 | |||
| 112 | /// Function not implemented | ||
| 113 | pub const ENOSYS = 38; | ||
| 114 | |||
| 115 | /// Directory not empty | ||
| 116 | pub const ENOTEMPTY = 39; | ||
| 117 | |||
| 118 | /// Too many symbolic links encountered | ||
| 119 | pub const ELOOP = 40; | ||
| 120 | |||
| 121 | /// Operation would block | ||
| 122 | pub const EWOULDBLOCK = EAGAIN; | ||
| 123 | |||
| 124 | /// No message of desired type | ||
| 125 | pub const ENOMSG = 42; | ||
| 126 | |||
| 127 | /// Identifier removed | ||
| 128 | pub const EIDRM = 43; | ||
| 129 | |||
| 130 | /// Channel number out of range | ||
| 131 | pub const ECHRNG = 44; | ||
| 132 | |||
| 133 | /// Level 2 not synchronized | ||
| 134 | pub const EL2NSYNC = 45; | ||
| 135 | |||
| 136 | /// Level 3 halted | ||
| 137 | pub const EL3HLT = 46; | ||
| 138 | |||
| 139 | /// Level 3 reset | ||
| 140 | pub const EL3RST = 47; | ||
| 141 | |||
| 142 | /// Link number out of range | ||
| 143 | pub const ELNRNG = 48; | ||
| 144 | |||
| 145 | /// Protocol driver not attached | ||
| 146 | pub const EUNATCH = 49; | ||
| 147 | |||
| 148 | /// No CSI structure available | ||
| 149 | pub const ENOCSI = 50; | ||
| 150 | |||
| 151 | /// Level 2 halted | ||
| 152 | pub const EL2HLT = 51; | ||
| 153 | |||
| 154 | /// Invalid exchange | ||
| 155 | pub const EBADE = 52; | ||
| 156 | |||
| 157 | /// Invalid request descriptor | ||
| 158 | pub const EBADR = 53; | ||
| 159 | |||
| 160 | /// Exchange full | ||
| 161 | pub const EXFULL = 54; | ||
| 162 | |||
| 163 | /// No anode | ||
| 164 | pub const ENOANO = 55; | ||
| 165 | |||
| 166 | /// Invalid request code | ||
| 167 | pub const EBADRQC = 56; | ||
| 168 | |||
| 169 | /// Invalid slot | ||
| 170 | pub const EBADSLT = 57; | ||
| 171 | |||
| 172 | /// Bad font file format | ||
| 173 | pub const EBFONT = 59; | ||
| 174 | |||
| 175 | /// Device not a stream | ||
| 176 | pub const ENOSTR = 60; | ||
| 177 | |||
| 178 | /// No data available | ||
| 179 | pub const ENODATA = 61; | ||
| 180 | |||
| 181 | /// Timer expired | ||
| 182 | pub const ETIME = 62; | ||
| 183 | |||
| 184 | /// Out of streams resources | ||
| 185 | pub const ENOSR = 63; | ||
| 186 | |||
| 187 | /// Machine is not on the network | ||
| 188 | pub const ENONET = 64; | ||
| 189 | |||
| 190 | /// Package not installed | ||
| 191 | pub const ENOPKG = 65; | ||
| 192 | |||
| 193 | /// Object is remote | ||
| 194 | pub const EREMOTE = 66; | ||
| 195 | |||
| 196 | /// Link has been severed | ||
| 197 | pub const ENOLINK = 67; | ||
| 198 | |||
| 199 | /// Advertise error | ||
| 200 | pub const EADV = 68; | ||
| 201 | |||
| 202 | /// Srmount error | ||
| 203 | pub const ESRMNT = 69; | ||
| 204 | |||
| 205 | /// Communication error on send | ||
| 206 | pub const ECOMM = 70; | ||
| 207 | |||
| 208 | /// Protocol error | ||
| 209 | pub const EPROTO = 71; | ||
| 210 | |||
| 211 | /// Multihop attempted | ||
| 212 | pub const EMULTIHOP = 72; | ||
| 213 | |||
| 214 | /// RFS specific error | ||
| 215 | pub const EDOTDOT = 73; | ||
| 216 | |||
| 217 | /// Not a data message | ||
| 218 | pub const EBADMSG = 74; | ||
| 219 | |||
| 220 | /// Value too large for defined data type | ||
| 221 | pub const EOVERFLOW = 75; | ||
| 222 | |||
| 223 | /// Name not unique on network | ||
| 224 | pub const ENOTUNIQ = 76; | ||
| 225 | |||
| 226 | /// File descriptor in bad state | ||
| 227 | pub const EBADFD = 77; | ||
| 228 | |||
| 229 | /// Remote address changed | ||
| 230 | pub const EREMCHG = 78; | ||
| 231 | |||
| 232 | /// Can not access a needed shared library | ||
| 233 | pub const ELIBACC = 79; | ||
| 234 | |||
| 235 | /// Accessing a corrupted shared library | ||
| 236 | pub const ELIBBAD = 80; | ||
| 237 | |||
| 238 | /// .lib section in a.out corrupted | ||
| 239 | pub const ELIBSCN = 81; | ||
| 240 | |||
| 241 | /// Attempting to link in too many shared libraries | ||
| 242 | pub const ELIBMAX = 82; | ||
| 243 | |||
| 244 | /// Cannot exec a shared library directly | ||
| 245 | pub const ELIBEXEC = 83; | ||
| 246 | |||
| 247 | /// Illegal byte sequence | ||
| 248 | pub const EILSEQ = 84; | ||
| 249 | |||
| 250 | /// Interrupted system call should be restarted | ||
| 251 | pub const ERESTART = 85; | ||
| 252 | |||
| 253 | /// Streams pipe error | ||
| 254 | pub const ESTRPIPE = 86; | ||
| 255 | |||
| 256 | /// Too many users | ||
| 257 | pub const EUSERS = 87; | ||
| 258 | |||
| 259 | /// Socket operation on non-socket | ||
| 260 | pub const ENOTSOCK = 88; | ||
| 261 | |||
| 262 | /// Destination address required | ||
| 263 | pub const EDESTADDRREQ = 89; | ||
| 264 | |||
| 265 | /// Message too long | ||
| 266 | pub const EMSGSIZE = 90; | ||
| 267 | |||
| 268 | /// Protocol wrong type for socket | ||
| 269 | pub const EPROTOTYPE = 91; | ||
| 270 | |||
| 271 | /// Protocol not available | ||
| 272 | pub const ENOPROTOOPT = 92; | ||
| 273 | |||
| 274 | /// Protocol not supported | ||
| 275 | pub const EPROTONOSUPPORT = 93; | ||
| 276 | |||
| 277 | /// Socket type not supported | ||
| 278 | pub const ESOCKTNOSUPPORT = 94; | ||
| 279 | |||
| 280 | /// Operation not supported on transport endpoint | ||
| 281 | pub const EOPNOTSUPP = 95; | ||
| 282 | pub const ENOTSUP = EOPNOTSUPP; | ||
| 283 | |||
| 284 | /// Protocol family not supported | ||
| 285 | pub const EPFNOSUPPORT = 96; | ||
| 286 | |||
| 287 | /// Address family not supported by protocol | ||
| 288 | pub const EAFNOSUPPORT = 97; | ||
| 289 | |||
| 290 | /// Address already in use | ||
| 291 | pub const EADDRINUSE = 98; | ||
| 292 | |||
| 293 | /// Cannot assign requested address | ||
| 294 | pub const EADDRNOTAVAIL = 99; | ||
| 295 | |||
| 296 | /// Network is down | ||
| 297 | pub const ENETDOWN = 100; | ||
| 298 | |||
| 299 | /// Network is unreachable | ||
| 300 | pub const ENETUNREACH = 101; | ||
| 301 | |||
| 302 | /// Network dropped connection because of reset | ||
| 303 | pub const ENETRESET = 102; | ||
| 304 | |||
| 305 | /// Software caused connection abort | ||
| 306 | pub const ECONNABORTED = 103; | ||
| 307 | |||
| 308 | /// Connection reset by peer | ||
| 309 | pub const ECONNRESET = 104; | ||
| 310 | |||
| 311 | /// No buffer space available | ||
| 312 | pub const ENOBUFS = 105; | ||
| 313 | |||
| 314 | /// Transport endpoint is already connected | ||
| 315 | pub const EISCONN = 106; | ||
| 316 | |||
| 317 | /// Transport endpoint is not connected | ||
| 318 | pub const ENOTCONN = 107; | ||
| 319 | |||
| 320 | /// Cannot send after transport endpoint shutdown | ||
| 321 | pub const ESHUTDOWN = 108; | ||
| 322 | |||
| 323 | /// Too many references: cannot splice | ||
| 324 | pub const ETOOMANYREFS = 109; | ||
| 325 | |||
| 326 | /// Connection timed out | ||
| 327 | pub const ETIMEDOUT = 110; | ||
| 328 | |||
| 329 | /// Connection refused | ||
| 330 | pub const ECONNREFUSED = 111; | ||
| 331 | |||
| 332 | /// Host is down | ||
| 333 | pub const EHOSTDOWN = 112; | ||
| 334 | |||
| 335 | /// No route to host | ||
| 336 | pub const EHOSTUNREACH = 113; | ||
| 337 | |||
| 338 | /// Operation already in progress | ||
| 339 | pub const EALREADY = 114; | ||
| 340 | |||
| 341 | /// Operation now in progress | ||
| 342 | pub const EINPROGRESS = 115; | ||
| 343 | |||
| 344 | /// Stale NFS file handle | ||
| 345 | pub const ESTALE = 116; | ||
| 346 | |||
| 347 | /// Structure needs cleaning | ||
| 348 | pub const EUCLEAN = 117; | ||
| 349 | |||
| 350 | /// Not a XENIX named type file | ||
| 351 | pub const ENOTNAM = 118; | ||
| 352 | |||
| 353 | /// No XENIX semaphores available | ||
| 354 | pub const ENAVAIL = 119; | ||
| 355 | |||
| 356 | /// Is a named type file | ||
| 357 | pub const EISNAM = 120; | ||
| 358 | |||
| 359 | /// Remote I/O error | ||
| 360 | pub const EREMOTEIO = 121; | ||
| 361 | |||
| 362 | /// Quota exceeded | ||
| 363 | pub const EDQUOT = 122; | ||
| 364 | |||
| 365 | /// No medium found | ||
| 366 | pub const ENOMEDIUM = 123; | ||
| 367 | |||
| 368 | /// Wrong medium type | ||
| 369 | pub const EMEDIUMTYPE = 124; | ||
| 370 | |||
| 371 | // nameserver query return codes | ||
| 372 | |||
| 373 | /// DNS server returned answer with no data | ||
| 374 | pub const ENSROK = 0; | ||
| 375 | |||
| 376 | /// DNS server returned answer with no data | ||
| 377 | pub const ENSRNODATA = 160; | ||
| 378 | |||
| 379 | /// DNS server claims query was misformatted | ||
| 380 | pub const ENSRFORMERR = 161; | ||
| 381 | |||
| 382 | /// DNS server returned general failure | ||
| 383 | pub const ENSRSERVFAIL = 162; | ||
| 384 | |||
| 385 | /// Domain name not found | ||
| 386 | pub const ENSRNOTFOUND = 163; | ||
| 387 | |||
| 388 | /// DNS server does not implement requested operation | ||
| 389 | pub const ENSRNOTIMP = 164; | ||
| 390 | |||
| 391 | /// DNS server refused query | ||
| 392 | pub const ENSRREFUSED = 165; | ||
| 393 | |||
| 394 | /// Misformatted DNS query | ||
| 395 | pub const ENSRBADQUERY = 166; | ||
| 396 | |||
| 397 | /// Misformatted domain name | ||
| 398 | pub const ENSRBADNAME = 167; | ||
| 399 | |||
| 400 | /// Unsupported address family | ||
| 401 | pub const ENSRBADFAMILY = 168; | ||
| 402 | |||
| 403 | /// Misformatted DNS reply | ||
| 404 | pub const ENSRBADRESP = 169; | ||
| 405 | |||
| 406 | /// Could not contact DNS servers | ||
| 407 | pub const ENSRCONNREFUSED = 170; | ||
| 408 | |||
| 409 | /// Timeout while contacting DNS servers | ||
| 410 | pub const ENSRTIMEOUT = 171; | ||
| 411 | |||
| 412 | /// End of file | ||
| 413 | pub const ENSROF = 172; | ||
| 414 | |||
| 415 | /// Error reading file | ||
| 416 | pub const ENSRFILE = 173; | ||
| 417 | |||
| 418 | /// Out of memory | ||
| 419 | pub const ENSRNOMEM = 174; | ||
| 420 | |||
| 421 | /// Application terminated lookup | ||
| 422 | pub const ENSRDESTRUCTION = 175; | ||
| 423 | |||
| 424 | /// Domain name is too long | ||
| 425 | pub const ENSRQUERYDOMAINTOOLONG = 176; | ||
| 426 | |||
| 427 | /// Domain name is too long | ||
| 428 | pub const ENSRCNAMELOOP = 177; | ||
lib/std/os/bits/linux/errno-mips.zig created+134| ... | @@ -0,0 +1,134 @@ | ||
| 1 | pub const EPERM = 1; | ||
| 2 | pub const ENOENT = 2; | ||
| 3 | pub const ESRCH = 3; | ||
| 4 | pub const EINTR = 4; | ||
| 5 | pub const EIO = 5; | ||
| 6 | pub const ENXIO = 6; | ||
| 7 | pub const E2BIG = 7; | ||
| 8 | pub const ENOEXEC = 8; | ||
| 9 | pub const EBADF = 9; | ||
| 10 | pub const ECHILD = 10; | ||
| 11 | pub const EAGAIN = 11; | ||
| 12 | pub const ENOMEM = 12; | ||
| 13 | pub const EACCES = 13; | ||
| 14 | pub const EFAULT = 14; | ||
| 15 | pub const ENOTBLK = 15; | ||
| 16 | pub const EBUSY = 16; | ||
| 17 | pub const EEXIST = 17; | ||
| 18 | pub const EXDEV = 18; | ||
| 19 | pub const ENODEV = 19; | ||
| 20 | pub const ENOTDIR = 20; | ||
| 21 | pub const EISDIR = 21; | ||
| 22 | pub const EINVAL = 22; | ||
| 23 | pub const ENFILE = 23; | ||
| 24 | pub const EMFILE = 24; | ||
| 25 | pub const ENOTTY = 25; | ||
| 26 | pub const ETXTBSY = 26; | ||
| 27 | pub const EFBIG = 27; | ||
| 28 | pub const ENOSPC = 28; | ||
| 29 | pub const ESPIPE = 29; | ||
| 30 | pub const EROFS = 30; | ||
| 31 | pub const EMLINK = 31; | ||
| 32 | pub const EPIPE = 32; | ||
| 33 | pub const EDOM = 33; | ||
| 34 | pub const ERANGE = 34; | ||
| 35 | pub const ENOMSG = 35; | ||
| 36 | pub const EIDRM = 36; | ||
| 37 | pub const ECHRNG = 37; | ||
| 38 | pub const EL2NSYNC = 38; | ||
| 39 | pub const EL3HLT = 39; | ||
| 40 | pub const EL3RST = 40; | ||
| 41 | pub const ELNRNG = 41; | ||
| 42 | pub const EUNATCH = 42; | ||
| 43 | pub const ENOCSI = 43; | ||
| 44 | pub const EL2HLT = 44; | ||
| 45 | pub const EDEADLK = 45; | ||
| 46 | pub const ENOLCK = 46; | ||
| 47 | pub const EBADE = 50; | ||
| 48 | pub const EBADR = 51; | ||
| 49 | pub const EXFULL = 52; | ||
| 50 | pub const ENOANO = 53; | ||
| 51 | pub const EBADRQC = 54; | ||
| 52 | pub const EBADSLT = 55; | ||
| 53 | pub const EDEADLOCK = 56; | ||
| 54 | pub const EBFONT = 59; | ||
| 55 | pub const ENOSTR = 60; | ||
| 56 | pub const ENODATA = 61; | ||
| 57 | pub const ETIME = 62; | ||
| 58 | pub const ENOSR = 63; | ||
| 59 | pub const ENONET = 64; | ||
| 60 | pub const ENOPKG = 65; | ||
| 61 | pub const EREMOTE = 66; | ||
| 62 | pub const ENOLINK = 67; | ||
| 63 | pub const EADV = 68; | ||
| 64 | pub const ESRMNT = 69; | ||
| 65 | pub const ECOMM = 70; | ||
| 66 | pub const EPROTO = 71; | ||
| 67 | pub const EDOTDOT = 73; | ||
| 68 | pub const EMULTIHOP = 74; | ||
| 69 | pub const EBADMSG = 77; | ||
| 70 | pub const ENAMETOOLONG = 78; | ||
| 71 | pub const EOVERFLOW = 79; | ||
| 72 | pub const ENOTUNIQ = 80; | ||
| 73 | pub const EBADFD = 81; | ||
| 74 | pub const EREMCHG = 82; | ||
| 75 | pub const ELIBACC = 83; | ||
| 76 | pub const ELIBBAD = 84; | ||
| 77 | pub const ELIBSCN = 85; | ||
| 78 | pub const ELIBMAX = 86; | ||
| 79 | pub const ELIBEXEC = 87; | ||
| 80 | pub const EILSEQ = 88; | ||
| 81 | pub const ENOSYS = 89; | ||
| 82 | pub const ELOOP = 90; | ||
| 83 | pub const ERESTART = 91; | ||
| 84 | pub const ESTRPIPE = 92; | ||
| 85 | pub const ENOTEMPTY = 93; | ||
| 86 | pub const EUSERS = 94; | ||
| 87 | pub const ENOTSOCK = 95; | ||
| 88 | pub const EDESTADDRREQ = 96; | ||
| 89 | pub const EMSGSIZE = 97; | ||
| 90 | pub const EPROTOTYPE = 98; | ||
| 91 | pub const ENOPROTOOPT = 99; | ||
| 92 | pub const EPROTONOSUPPORT = 120; | ||
| 93 | pub const ESOCKTNOSUPPORT = 121; | ||
| 94 | pub const EOPNOTSUPP = 122; | ||
| 95 | pub const ENOTSUP = EOPNOTSUPP; | ||
| 96 | pub const EPFNOSUPPORT = 123; | ||
| 97 | pub const EAFNOSUPPORT = 124; | ||
| 98 | pub const EADDRINUSE = 125; | ||
| 99 | pub const EADDRNOTAVAIL = 126; | ||
| 100 | pub const ENETDOWN = 127; | ||
| 101 | pub const ENETUNREACH = 128; | ||
| 102 | pub const ENETRESET = 129; | ||
| 103 | pub const ECONNABORTED = 130; | ||
| 104 | pub const ECONNRESET = 131; | ||
| 105 | pub const ENOBUFS = 132; | ||
| 106 | pub const EISCONN = 133; | ||
| 107 | pub const ENOTCONN = 134; | ||
| 108 | pub const EUCLEAN = 135; | ||
| 109 | pub const ENOTNAM = 137; | ||
| 110 | pub const ENAVAIL = 138; | ||
| 111 | pub const EISNAM = 139; | ||
| 112 | pub const EREMOTEIO = 140; | ||
| 113 | pub const ESHUTDOWN = 143; | ||
| 114 | pub const ETOOMANYREFS = 144; | ||
| 115 | pub const ETIMEDOUT = 145; | ||
| 116 | pub const ECONNREFUSED = 146; | ||
| 117 | pub const EHOSTDOWN = 147; | ||
| 118 | pub const EHOSTUNREACH = 148; | ||
| 119 | pub const EWOULDBLOCK = EAGAIN; | ||
| 120 | pub const EALREADY = 149; | ||
| 121 | pub const EINPROGRESS = 150; | ||
| 122 | pub const ESTALE = 151; | ||
| 123 | pub const ECANCELED = 158; | ||
| 124 | pub const ENOMEDIUM = 159; | ||
| 125 | pub const EMEDIUMTYPE = 160; | ||
| 126 | pub const ENOKEY = 161; | ||
| 127 | pub const EKEYEXPIRED = 162; | ||
| 128 | pub const EKEYREVOKED = 163; | ||
| 129 | pub const EKEYREJECTED = 164; | ||
| 130 | pub const EOWNERDEAD = 165; | ||
| 131 | pub const ENOTRECOVERABLE = 166; | ||
| 132 | pub const ERFKILL = 167; | ||
| 133 | pub const EHWPOISON = 168; | ||
| 134 | pub const EDQUOT = 1133; | ||
lib/std/os/bits/linux/errno.zig deleted-428| ... | @@ -1,428 +0,0 @@ | ||
| 1 | /// Operation not permitted | ||
| 2 | pub const EPERM = 1; | ||
| 3 | |||
| 4 | /// No such file or directory | ||
| 5 | pub const ENOENT = 2; | ||
| 6 | |||
| 7 | /// No such process | ||
| 8 | pub const ESRCH = 3; | ||
| 9 | |||
| 10 | /// Interrupted system call | ||
| 11 | pub const EINTR = 4; | ||
| 12 | |||
| 13 | /// I/O error | ||
| 14 | pub const EIO = 5; | ||
| 15 | |||
| 16 | /// No such device or address | ||
| 17 | pub const ENXIO = 6; | ||
| 18 | |||
| 19 | /// Arg list too long | ||
| 20 | pub const E2BIG = 7; | ||
| 21 | |||
| 22 | /// Exec format error | ||
| 23 | pub const ENOEXEC = 8; | ||
| 24 | |||
| 25 | /// Bad file number | ||
| 26 | pub const EBADF = 9; | ||
| 27 | |||
| 28 | /// No child processes | ||
| 29 | pub const ECHILD = 10; | ||
| 30 | |||
| 31 | /// Try again | ||
| 32 | pub const EAGAIN = 11; | ||
| 33 | |||
| 34 | /// Out of memory | ||
| 35 | pub const ENOMEM = 12; | ||
| 36 | |||
| 37 | /// Permission denied | ||
| 38 | pub const EACCES = 13; | ||
| 39 | |||
| 40 | /// Bad address | ||
| 41 | pub const EFAULT = 14; | ||
| 42 | |||
| 43 | /// Block device required | ||
| 44 | pub const ENOTBLK = 15; | ||
| 45 | |||
| 46 | /// Device or resource busy | ||
| 47 | pub const EBUSY = 16; | ||
| 48 | |||
| 49 | /// File exists | ||
| 50 | pub const EEXIST = 17; | ||
| 51 | |||
| 52 | /// Cross-device link | ||
| 53 | pub const EXDEV = 18; | ||
| 54 | |||
| 55 | /// No such device | ||
| 56 | pub const ENODEV = 19; | ||
| 57 | |||
| 58 | /// Not a directory | ||
| 59 | pub const ENOTDIR = 20; | ||
| 60 | |||
| 61 | /// Is a directory | ||
| 62 | pub const EISDIR = 21; | ||
| 63 | |||
| 64 | /// Invalid argument | ||
| 65 | pub const EINVAL = 22; | ||
| 66 | |||
| 67 | /// File table overflow | ||
| 68 | pub const ENFILE = 23; | ||
| 69 | |||
| 70 | /// Too many open files | ||
| 71 | pub const EMFILE = 24; | ||
| 72 | |||
| 73 | /// Not a typewriter | ||
| 74 | pub const ENOTTY = 25; | ||
| 75 | |||
| 76 | /// Text file busy | ||
| 77 | pub const ETXTBSY = 26; | ||
| 78 | |||
| 79 | /// File too large | ||
| 80 | pub const EFBIG = 27; | ||
| 81 | |||
| 82 | /// No space left on device | ||
| 83 | pub const ENOSPC = 28; | ||
| 84 | |||
| 85 | /// Illegal seek | ||
| 86 | pub const ESPIPE = 29; | ||
| 87 | |||
| 88 | /// Read-only file system | ||
| 89 | pub const EROFS = 30; | ||
| 90 | |||
| 91 | /// Too many links | ||
| 92 | pub const EMLINK = 31; | ||
| 93 | |||
| 94 | /// Broken pipe | ||
| 95 | pub const EPIPE = 32; | ||
| 96 | |||
| 97 | /// Math argument out of domain of func | ||
| 98 | pub const EDOM = 33; | ||
| 99 | |||
| 100 | /// Math result not representable | ||
| 101 | pub const ERANGE = 34; | ||
| 102 | |||
| 103 | /// Resource deadlock would occur | ||
| 104 | pub const EDEADLK = 35; | ||
| 105 | |||
| 106 | /// File name too long | ||
| 107 | pub const ENAMETOOLONG = 36; | ||
| 108 | |||
| 109 | /// No record locks available | ||
| 110 | pub const ENOLCK = 37; | ||
| 111 | |||
| 112 | /// Function not implemented | ||
| 113 | pub const ENOSYS = 38; | ||
| 114 | |||
| 115 | /// Directory not empty | ||
| 116 | pub const ENOTEMPTY = 39; | ||
| 117 | |||
| 118 | /// Too many symbolic links encountered | ||
| 119 | pub const ELOOP = 40; | ||
| 120 | |||
| 121 | /// Operation would block | ||
| 122 | pub const EWOULDBLOCK = EAGAIN; | ||
| 123 | |||
| 124 | /// No message of desired type | ||
| 125 | pub const ENOMSG = 42; | ||
| 126 | |||
| 127 | /// Identifier removed | ||
| 128 | pub const EIDRM = 43; | ||
| 129 | |||
| 130 | /// Channel number out of range | ||
| 131 | pub const ECHRNG = 44; | ||
| 132 | |||
| 133 | /// Level 2 not synchronized | ||
| 134 | pub const EL2NSYNC = 45; | ||
| 135 | |||
| 136 | /// Level 3 halted | ||
| 137 | pub const EL3HLT = 46; | ||
| 138 | |||
| 139 | /// Level 3 reset | ||
| 140 | pub const EL3RST = 47; | ||
| 141 | |||
| 142 | /// Link number out of range | ||
| 143 | pub const ELNRNG = 48; | ||
| 144 | |||
| 145 | /// Protocol driver not attached | ||
| 146 | pub const EUNATCH = 49; | ||
| 147 | |||
| 148 | /// No CSI structure available | ||
| 149 | pub const ENOCSI = 50; | ||
| 150 | |||
| 151 | /// Level 2 halted | ||
| 152 | pub const EL2HLT = 51; | ||
| 153 | |||
| 154 | /// Invalid exchange | ||
| 155 | pub const EBADE = 52; | ||
| 156 | |||
| 157 | /// Invalid request descriptor | ||
| 158 | pub const EBADR = 53; | ||
| 159 | |||
| 160 | /// Exchange full | ||
| 161 | pub const EXFULL = 54; | ||
| 162 | |||
| 163 | /// No anode | ||
| 164 | pub const ENOANO = 55; | ||
| 165 | |||
| 166 | /// Invalid request code | ||
| 167 | pub const EBADRQC = 56; | ||
| 168 | |||
| 169 | /// Invalid slot | ||
| 170 | pub const EBADSLT = 57; | ||
| 171 | |||
| 172 | /// Bad font file format | ||
| 173 | pub const EBFONT = 59; | ||
| 174 | |||
| 175 | /// Device not a stream | ||
| 176 | pub const ENOSTR = 60; | ||
| 177 | |||
| 178 | /// No data available | ||
| 179 | pub const ENODATA = 61; | ||
| 180 | |||
| 181 | /// Timer expired | ||
| 182 | pub const ETIME = 62; | ||
| 183 | |||
| 184 | /// Out of streams resources | ||
| 185 | pub const ENOSR = 63; | ||
| 186 | |||
| 187 | /// Machine is not on the network | ||
| 188 | pub const ENONET = 64; | ||
| 189 | |||
| 190 | /// Package not installed | ||
| 191 | pub const ENOPKG = 65; | ||
| 192 | |||
| 193 | /// Object is remote | ||
| 194 | pub const EREMOTE = 66; | ||
| 195 | |||
| 196 | /// Link has been severed | ||
| 197 | pub const ENOLINK = 67; | ||
| 198 | |||
| 199 | /// Advertise error | ||
| 200 | pub const EADV = 68; | ||
| 201 | |||
| 202 | /// Srmount error | ||
| 203 | pub const ESRMNT = 69; | ||
| 204 | |||
| 205 | /// Communication error on send | ||
| 206 | pub const ECOMM = 70; | ||
| 207 | |||
| 208 | /// Protocol error | ||
| 209 | pub const EPROTO = 71; | ||
| 210 | |||
| 211 | /// Multihop attempted | ||
| 212 | pub const EMULTIHOP = 72; | ||
| 213 | |||
| 214 | /// RFS specific error | ||
| 215 | pub const EDOTDOT = 73; | ||
| 216 | |||
| 217 | /// Not a data message | ||
| 218 | pub const EBADMSG = 74; | ||
| 219 | |||
| 220 | /// Value too large for defined data type | ||
| 221 | pub const EOVERFLOW = 75; | ||
| 222 | |||
| 223 | /// Name not unique on network | ||
| 224 | pub const ENOTUNIQ = 76; | ||
| 225 | |||
| 226 | /// File descriptor in bad state | ||
| 227 | pub const EBADFD = 77; | ||
| 228 | |||
| 229 | /// Remote address changed | ||
| 230 | pub const EREMCHG = 78; | ||
| 231 | |||
| 232 | /// Can not access a needed shared library | ||
| 233 | pub const ELIBACC = 79; | ||
| 234 | |||
| 235 | /// Accessing a corrupted shared library | ||
| 236 | pub const ELIBBAD = 80; | ||
| 237 | |||
| 238 | /// .lib section in a.out corrupted | ||
| 239 | pub const ELIBSCN = 81; | ||
| 240 | |||
| 241 | /// Attempting to link in too many shared libraries | ||
| 242 | pub const ELIBMAX = 82; | ||
| 243 | |||
| 244 | /// Cannot exec a shared library directly | ||
| 245 | pub const ELIBEXEC = 83; | ||
| 246 | |||
| 247 | /// Illegal byte sequence | ||
| 248 | pub const EILSEQ = 84; | ||
| 249 | |||
| 250 | /// Interrupted system call should be restarted | ||
| 251 | pub const ERESTART = 85; | ||
| 252 | |||
| 253 | /// Streams pipe error | ||
| 254 | pub const ESTRPIPE = 86; | ||
| 255 | |||
| 256 | /// Too many users | ||
| 257 | pub const EUSERS = 87; | ||
| 258 | |||
| 259 | /// Socket operation on non-socket | ||
| 260 | pub const ENOTSOCK = 88; | ||
| 261 | |||
| 262 | /// Destination address required | ||
| 263 | pub const EDESTADDRREQ = 89; | ||
| 264 | |||
| 265 | /// Message too long | ||
| 266 | pub const EMSGSIZE = 90; | ||
| 267 | |||
| 268 | /// Protocol wrong type for socket | ||
| 269 | pub const EPROTOTYPE = 91; | ||
| 270 | |||
| 271 | /// Protocol not available | ||
| 272 | pub const ENOPROTOOPT = 92; | ||
| 273 | |||
| 274 | /// Protocol not supported | ||
| 275 | pub const EPROTONOSUPPORT = 93; | ||
| 276 | |||
| 277 | /// Socket type not supported | ||
| 278 | pub const ESOCKTNOSUPPORT = 94; | ||
| 279 | |||
| 280 | /// Operation not supported on transport endpoint | ||
| 281 | pub const EOPNOTSUPP = 95; | ||
| 282 | pub const ENOTSUP = EOPNOTSUPP; | ||
| 283 | |||
| 284 | /// Protocol family not supported | ||
| 285 | pub const EPFNOSUPPORT = 96; | ||
| 286 | |||
| 287 | /// Address family not supported by protocol | ||
| 288 | pub const EAFNOSUPPORT = 97; | ||
| 289 | |||
| 290 | /// Address already in use | ||
| 291 | pub const EADDRINUSE = 98; | ||
| 292 | |||
| 293 | /// Cannot assign requested address | ||
| 294 | pub const EADDRNOTAVAIL = 99; | ||
| 295 | |||
| 296 | /// Network is down | ||
| 297 | pub const ENETDOWN = 100; | ||
| 298 | |||
| 299 | /// Network is unreachable | ||
| 300 | pub const ENETUNREACH = 101; | ||
| 301 | |||
| 302 | /// Network dropped connection because of reset | ||
| 303 | pub const ENETRESET = 102; | ||
| 304 | |||
| 305 | /// Software caused connection abort | ||
| 306 | pub const ECONNABORTED = 103; | ||
| 307 | |||
| 308 | /// Connection reset by peer | ||
| 309 | pub const ECONNRESET = 104; | ||
| 310 | |||
| 311 | /// No buffer space available | ||
| 312 | pub const ENOBUFS = 105; | ||
| 313 | |||
| 314 | /// Transport endpoint is already connected | ||
| 315 | pub const EISCONN = 106; | ||
| 316 | |||
| 317 | /// Transport endpoint is not connected | ||
| 318 | pub const ENOTCONN = 107; | ||
| 319 | |||
| 320 | /// Cannot send after transport endpoint shutdown | ||
| 321 | pub const ESHUTDOWN = 108; | ||
| 322 | |||
| 323 | /// Too many references: cannot splice | ||
| 324 | pub const ETOOMANYREFS = 109; | ||
| 325 | |||
| 326 | /// Connection timed out | ||
| 327 | pub const ETIMEDOUT = 110; | ||
| 328 | |||
| 329 | /// Connection refused | ||
| 330 | pub const ECONNREFUSED = 111; | ||
| 331 | |||
| 332 | /// Host is down | ||
| 333 | pub const EHOSTDOWN = 112; | ||
| 334 | |||
| 335 | /// No route to host | ||
| 336 | pub const EHOSTUNREACH = 113; | ||
| 337 | |||
| 338 | /// Operation already in progress | ||
| 339 | pub const EALREADY = 114; | ||
| 340 | |||
| 341 | /// Operation now in progress | ||
| 342 | pub const EINPROGRESS = 115; | ||
| 343 | |||
| 344 | /// Stale NFS file handle | ||
| 345 | pub const ESTALE = 116; | ||
| 346 | |||
| 347 | /// Structure needs cleaning | ||
| 348 | pub const EUCLEAN = 117; | ||
| 349 | |||
| 350 | /// Not a XENIX named type file | ||
| 351 | pub const ENOTNAM = 118; | ||
| 352 | |||
| 353 | /// No XENIX semaphores available | ||
| 354 | pub const ENAVAIL = 119; | ||
| 355 | |||
| 356 | /// Is a named type file | ||
| 357 | pub const EISNAM = 120; | ||
| 358 | |||
| 359 | /// Remote I/O error | ||
| 360 | pub const EREMOTEIO = 121; | ||
| 361 | |||
| 362 | /// Quota exceeded | ||
| 363 | pub const EDQUOT = 122; | ||
| 364 | |||
| 365 | /// No medium found | ||
| 366 | pub const ENOMEDIUM = 123; | ||
| 367 | |||
| 368 | /// Wrong medium type | ||
| 369 | pub const EMEDIUMTYPE = 124; | ||
| 370 | |||
| 371 | // nameserver query return codes | ||
| 372 | |||
| 373 | /// DNS server returned answer with no data | ||
| 374 | pub const ENSROK = 0; | ||
| 375 | |||
| 376 | /// DNS server returned answer with no data | ||
| 377 | pub const ENSRNODATA = 160; | ||
| 378 | |||
| 379 | /// DNS server claims query was misformatted | ||
| 380 | pub const ENSRFORMERR = 161; | ||
| 381 | |||
| 382 | /// DNS server returned general failure | ||
| 383 | pub const ENSRSERVFAIL = 162; | ||
| 384 | |||
| 385 | /// Domain name not found | ||
| 386 | pub const ENSRNOTFOUND = 163; | ||
| 387 | |||
| 388 | /// DNS server does not implement requested operation | ||
| 389 | pub const ENSRNOTIMP = 164; | ||
| 390 | |||
| 391 | /// DNS server refused query | ||
| 392 | pub const ENSRREFUSED = 165; | ||
| 393 | |||
| 394 | /// Misformatted DNS query | ||
| 395 | pub const ENSRBADQUERY = 166; | ||
| 396 | |||
| 397 | /// Misformatted domain name | ||
| 398 | pub const ENSRBADNAME = 167; | ||
| 399 | |||
| 400 | /// Unsupported address family | ||
| 401 | pub const ENSRBADFAMILY = 168; | ||
| 402 | |||
| 403 | /// Misformatted DNS reply | ||
| 404 | pub const ENSRBADRESP = 169; | ||
| 405 | |||
| 406 | /// Could not contact DNS servers | ||
| 407 | pub const ENSRCONNREFUSED = 170; | ||
| 408 | |||
| 409 | /// Timeout while contacting DNS servers | ||
| 410 | pub const ENSRTIMEOUT = 171; | ||
| 411 | |||
| 412 | /// End of file | ||
| 413 | pub const ENSROF = 172; | ||
| 414 | |||
| 415 | /// Error reading file | ||
| 416 | pub const ENSRFILE = 173; | ||
| 417 | |||
| 418 | /// Out of memory | ||
| 419 | pub const ENSRNOMEM = 174; | ||
| 420 | |||
| 421 | /// Application terminated lookup | ||
| 422 | pub const ENSRDESTRUCTION = 175; | ||
| 423 | |||
| 424 | /// Domain name is too long | ||
| 425 | pub const ENSRQUERYDOMAINTOOLONG = 176; | ||
| 426 | |||
| 427 | /// Domain name is too long | ||
| 428 | pub const ENSRCNAMELOOP = 177; | ||
lib/std/os/zen.zig+1-1| ... | @@ -80,7 +80,7 @@ pub const STDOUT_FILENO = 1; | ... | @@ -80,7 +80,7 @@ pub const STDOUT_FILENO = 1; |
| 80 | pub const STDERR_FILENO = 2; | 80 | pub const STDERR_FILENO = 2; |
| 81 | 81 | ||
| 82 | // FIXME: let's borrow Linux's error numbers for now. | 82 | // FIXME: let's borrow Linux's error numbers for now. |
| 83 | usingnamespace @import("bits/linux/errno.zig"); | 83 | usingnamespace @import("bits/linux/errno-generic.zig"); |
| 84 | // Get the errno from a syscall return value, or 0 for no error. | 84 | // Get the errno from a syscall return value, or 0 for no error. |
| 85 | pub fn getErrno(r: usize) usize { | 85 | pub fn getErrno(r: usize) usize { |
| 86 | const signed_r = @bitCast(isize, r); | 86 | const signed_r = @bitCast(isize, r); |