| author | |
| committer | |
| log | 057f0fec33c4e54e87383d1181e946d3cddbc4c0 |
| tree | 506380fe20cdf941ae6f255f7def1da4de6f7418 |
| parent | feec4b0614c1fd64fa59634af8774a992c7a5646 |
17 files changed, 457 insertions(+), 489 deletions(-)
lib/std/c.zig+3-1| ... | @@ -57,6 +57,8 @@ pub usingnamespace switch (builtin.os.tag) { | ... | @@ -57,6 +57,8 @@ pub usingnamespace switch (builtin.os.tag) { |
| 57 | else => struct {}, | 57 | else => struct {}, |
| 58 | }; | 58 | }; |
| 59 | 59 | ||
| 60 | pub const whence_t = if (builtin.os.tag == .wasi) std.os.wasi.whence_t else c_int; | ||
| 61 | |||
| 60 | pub usingnamespace switch (builtin.os.tag) { | 62 | pub usingnamespace switch (builtin.os.tag) { |
| 61 | .netbsd, .macos, .ios, .watchos, .tvos, .windows => struct {}, | 63 | .netbsd, .macos, .ios, .watchos, .tvos, .windows => struct {}, |
| 62 | else => struct { | 64 | else => struct { |
| ... | @@ -106,7 +108,7 @@ pub extern "c" fn exit(code: c_int) noreturn; | ... | @@ -106,7 +108,7 @@ pub extern "c" fn exit(code: c_int) noreturn; |
| 106 | pub extern "c" fn _exit(code: c_int) noreturn; | 108 | pub extern "c" fn _exit(code: c_int) noreturn; |
| 107 | pub extern "c" fn isatty(fd: c.fd_t) c_int; | 109 | pub extern "c" fn isatty(fd: c.fd_t) c_int; |
| 108 | pub extern "c" fn close(fd: c.fd_t) c_int; | 110 | pub extern "c" fn close(fd: c.fd_t) c_int; |
| 109 | pub extern "c" fn lseek(fd: c.fd_t, offset: c.off_t, whence: c_int) c.off_t; | 111 | pub extern "c" fn lseek(fd: c.fd_t, offset: c.off_t, whence: whence_t) c.off_t; |
| 110 | pub extern "c" fn open(path: [*:0]const u8, oflag: c_uint, ...) c_int; | 112 | pub extern "c" fn open(path: [*:0]const u8, oflag: c_uint, ...) c_int; |
| 111 | pub extern "c" fn openat(fd: c_int, path: [*:0]const u8, oflag: c_uint, ...) c_int; | 113 | pub extern "c" fn openat(fd: c_int, path: [*:0]const u8, oflag: c_uint, ...) c_int; |
| 112 | pub extern "c" fn ftruncate(fd: c_int, length: c.off_t) c_int; | 114 | pub extern "c" fn ftruncate(fd: c_int, length: c.off_t) c_int; |
lib/std/c/darwin.zig+46-47| ... | @@ -613,38 +613,26 @@ pub const MAP = struct { | ... | @@ -613,38 +613,26 @@ pub const MAP = struct { |
| 613 | pub const FAILED = @intToPtr(*c_void, maxInt(usize)); | 613 | pub const FAILED = @intToPtr(*c_void, maxInt(usize)); |
| 614 | }; | 614 | }; |
| 615 | 615 | ||
| 616 | /// [XSI] no hang in wait/no child to reap | 616 | pub const SA = struct { |
| 617 | pub const WNOHANG = 0x00000001; | 617 | /// take signal on signal stack |
| 618 | 618 | pub const ONSTACK = 0x0001; | |
| 619 | /// [XSI] notify on stop, untraced child | 619 | /// restart system on signal return |
| 620 | pub const WUNTRACED = 0x00000002; | 620 | pub const RESTART = 0x0002; |
| 621 | 621 | /// reset to SIG.DFL when taking signal | |
| 622 | /// take signal on signal stack | 622 | pub const RESETHAND = 0x0004; |
| 623 | pub const SA_ONSTACK = 0x0001; | 623 | /// do not generate SIG.CHLD on child stop |
| 624 | 624 | pub const NOCLDSTOP = 0x0008; | |
| 625 | /// restart system on signal return | 625 | /// don't mask the signal we're delivering |
| 626 | pub const SA_RESTART = 0x0002; | 626 | pub const NODEFER = 0x0010; |
| 627 | 627 | /// don't keep zombies around | |
| 628 | /// reset to SIG.DFL when taking signal | 628 | pub const NOCLDWAIT = 0x0020; |
| 629 | pub const SA_RESETHAND = 0x0004; | 629 | /// signal handler with SIGINFO args |
| 630 | 630 | pub const SIGINFO = 0x0040; | |
| 631 | /// do not generate SIG.CHLD on child stop | 631 | /// do not bounce off kernel's sigtramp |
| 632 | pub const SA_NOCLDSTOP = 0x0008; | 632 | pub const USERTRAMP = 0x0100; |
| 633 | 633 | /// signal handler with SIGINFO args with 64bit regs information | |
| 634 | /// don't mask the signal we're delivering | 634 | pub const @"64REGSET" = 0x0200; |
| 635 | pub const SA_NODEFER = 0x0010; | 635 | }; |
| 636 | |||
| 637 | /// don't keep zombies around | ||
| 638 | pub const SA_NOCLDWAIT = 0x0020; | ||
| 639 | |||
| 640 | /// signal handler with SA_SIGINFO args | ||
| 641 | pub const SA_SIGINFO = 0x0040; | ||
| 642 | |||
| 643 | /// do not bounce off kernel's sigtramp | ||
| 644 | pub const SA_USERTRAMP = 0x0100; | ||
| 645 | |||
| 646 | /// signal handler with SA_SIGINFO args with 64bit regs information | ||
| 647 | pub const SA_64REGSET = 0x0200; | ||
| 648 | 636 | ||
| 649 | pub const F_OK = 0; | 637 | pub const F_OK = 0; |
| 650 | pub const X_OK = 1; | 638 | pub const X_OK = 1; |
| ... | @@ -694,19 +682,23 @@ pub const O = struct { | ... | @@ -694,19 +682,23 @@ pub const O = struct { |
| 694 | pub const SYNC = 128; | 682 | pub const SYNC = 128; |
| 695 | }; | 683 | }; |
| 696 | 684 | ||
| 697 | pub const SEEK_SET = 0x0; | 685 | pub const SEEK = struct { |
| 698 | pub const SEEK_CUR = 0x1; | 686 | pub const SET = 0x0; |
| 699 | pub const SEEK_END = 0x2; | 687 | pub const CUR = 0x1; |
| 688 | pub const END = 0x2; | ||
| 689 | }; | ||
| 700 | 690 | ||
| 701 | pub const DT_UNKNOWN = 0; | 691 | pub const DT = struct { |
| 702 | pub const DT_FIFO = 1; | 692 | pub const UNKNOWN = 0; |
| 703 | pub const DT_CHR = 2; | 693 | pub const FIFO = 1; |
| 704 | pub const DT_DIR = 4; | 694 | pub const CHR = 2; |
| 705 | pub const DT_BLK = 6; | 695 | pub const DIR = 4; |
| 706 | pub const DT_REG = 8; | 696 | pub const BLK = 6; |
| 707 | pub const DT_LNK = 10; | 697 | pub const REG = 8; |
| 708 | pub const DT_SOCK = 12; | 698 | pub const LNK = 10; |
| 709 | pub const DT_WHT = 14; | 699 | pub const SOCK = 12; |
| 700 | pub const WHT = 14; | ||
| 701 | }; | ||
| 710 | 702 | ||
| 711 | /// no flag value | 703 | /// no flag value |
| 712 | pub const KEVENT_FLAG_NONE = 0x000; | 704 | pub const KEVENT_FLAG_NONE = 0x000; |
| ... | @@ -1070,6 +1062,11 @@ pub const SO = struct { | ... | @@ -1070,6 +1062,11 @@ pub const SO = struct { |
| 1070 | }; | 1062 | }; |
| 1071 | 1063 | ||
| 1072 | pub const W = struct { | 1064 | pub const W = struct { |
| 1065 | /// [XSI] no hang in wait/no child to reap | ||
| 1066 | pub const NOHANG = 0x00000001; | ||
| 1067 | /// [XSI] notify on stop, untraced child | ||
| 1068 | pub const UNTRACED = 0x00000002; | ||
| 1069 | |||
| 1073 | pub fn EXITSTATUS(x: u32) u8 { | 1070 | pub fn EXITSTATUS(x: u32) u8 { |
| 1074 | return @intCast(u8, x >> 8); | 1071 | return @intCast(u8, x >> 8); |
| 1075 | } | 1072 | } |
| ... | @@ -1759,9 +1756,11 @@ pub const rlimit = extern struct { | ... | @@ -1759,9 +1756,11 @@ pub const rlimit = extern struct { |
| 1759 | max: rlim_t, | 1756 | max: rlim_t, |
| 1760 | }; | 1757 | }; |
| 1761 | 1758 | ||
| 1762 | pub const SHUT_RD = 0; | 1759 | pub const SHUT = struct { |
| 1763 | pub const SHUT_WR = 1; | 1760 | pub const RD = 0; |
| 1764 | pub const SHUT_RDWR = 2; | 1761 | pub const WR = 1; |
| 1762 | pub const RDWR = 2; | ||
| 1763 | }; | ||
| 1765 | 1764 | ||
| 1766 | // Term | 1765 | // Term |
| 1767 | pub const VEOF = 0; | 1766 | pub const VEOF = 0; |
lib/std/c/dragonfly.zig+61-51| ... | @@ -182,20 +182,43 @@ pub const MAP = struct { | ... | @@ -182,20 +182,43 @@ pub const MAP = struct { |
| 182 | pub const SIZEALIGN = 262144; | 182 | pub const SIZEALIGN = 262144; |
| 183 | }; | 183 | }; |
| 184 | 184 | ||
| 185 | pub const WNOHANG = 0x0001; | 185 | pub const W = struct { |
| 186 | pub const WUNTRACED = 0x0002; | 186 | pub const NOHANG = 0x0001; |
| 187 | pub const WCONTINUED = 0x0004; | 187 | pub const UNTRACED = 0x0002; |
| 188 | pub const WSTOPPED = WUNTRACED; | 188 | pub const CONTINUED = 0x0004; |
| 189 | pub const WNOWAIT = 0x0008; | 189 | pub const STOPPED = UNTRACED; |
| 190 | pub const WEXITED = 0x0010; | 190 | pub const NOWAIT = 0x0008; |
| 191 | pub const WTRAPPED = 0x0020; | 191 | pub const EXITED = 0x0010; |
| 192 | 192 | pub const TRAPPED = 0x0020; | |
| 193 | pub const SA_ONSTACK = 0x0001; | 193 | |
| 194 | pub const SA_RESTART = 0x0002; | 194 | pub fn EXITSTATUS(s: u32) u8 { |
| 195 | pub const SA_RESETHAND = 0x0004; | 195 | return @intCast(u8, (s & 0xff00) >> 8); |
| 196 | pub const SA_NODEFER = 0x0010; | 196 | } |
| 197 | pub const SA_NOCLDWAIT = 0x0020; | 197 | pub fn TERMSIG(s: u32) u32 { |
| 198 | pub const SA_SIGINFO = 0x0040; | 198 | return s & 0x7f; |
| 199 | } | ||
| 200 | pub fn STOPSIG(s: u32) u32 { | ||
| 201 | return EXITSTATUS(s); | ||
| 202 | } | ||
| 203 | pub fn IFEXITED(s: u32) bool { | ||
| 204 | return TERMSIG(s) == 0; | ||
| 205 | } | ||
| 206 | pub fn IFSTOPPED(s: u32) bool { | ||
| 207 | return @intCast(u16, (((s & 0xffff) *% 0x10001) >> 8)) > 0x7f00; | ||
| 208 | } | ||
| 209 | pub fn IFSIGNALED(s: u32) bool { | ||
| 210 | return (s & 0xffff) -% 1 < 0xff; | ||
| 211 | } | ||
| 212 | }; | ||
| 213 | |||
| 214 | pub const SA = struct { | ||
| 215 | pub const ONSTACK = 0x0001; | ||
| 216 | pub const RESTART = 0x0002; | ||
| 217 | pub const RESETHAND = 0x0004; | ||
| 218 | pub const NODEFER = 0x0010; | ||
| 219 | pub const NOCLDWAIT = 0x0020; | ||
| 220 | pub const SIGINFO = 0x0040; | ||
| 221 | }; | ||
| 199 | 222 | ||
| 200 | pub const PATH_MAX = 1024; | 223 | pub const PATH_MAX = 1024; |
| 201 | pub const IOV_MAX = KERN_IOV_MAX; | 224 | pub const IOV_MAX = KERN_IOV_MAX; |
| ... | @@ -348,11 +371,13 @@ pub const O = struct { | ... | @@ -348,11 +371,13 @@ pub const O = struct { |
| 348 | pub const DIRECTORY = 134217728; | 371 | pub const DIRECTORY = 134217728; |
| 349 | }; | 372 | }; |
| 350 | 373 | ||
| 351 | pub const SEEK_SET = 0; | 374 | pub const SEEK = struct { |
| 352 | pub const SEEK_CUR = 1; | 375 | pub const SET = 0; |
| 353 | pub const SEEK_END = 2; | 376 | pub const CUR = 1; |
| 354 | pub const SEEK_DATA = 3; | 377 | pub const END = 2; |
| 355 | pub const SEEK_HOLE = 4; | 378 | pub const DATA = 3; |
| 379 | pub const HOLE = 4; | ||
| 380 | }; | ||
| 356 | 381 | ||
| 357 | pub const F = struct { | 382 | pub const F = struct { |
| 358 | pub const ULOCK = 0; | 383 | pub const ULOCK = 0; |
| ... | @@ -388,25 +413,6 @@ pub const AT = struct { | ... | @@ -388,25 +413,6 @@ pub const AT = struct { |
| 388 | pub const SYMLINK_FOLLOW = 8; | 413 | pub const SYMLINK_FOLLOW = 8; |
| 389 | }; | 414 | }; |
| 390 | 415 | ||
| 391 | pub fn WEXITSTATUS(s: u32) u8 { | ||
| 392 | return @intCast(u8, (s & 0xff00) >> 8); | ||
| 393 | } | ||
| 394 | pub fn WTERMSIG(s: u32) u32 { | ||
| 395 | return s & 0x7f; | ||
| 396 | } | ||
| 397 | pub fn WSTOPSIG(s: u32) u32 { | ||
| 398 | return WEXITSTATUS(s); | ||
| 399 | } | ||
| 400 | pub fn WIFEXITED(s: u32) bool { | ||
| 401 | return WTERMSIG(s) == 0; | ||
| 402 | } | ||
| 403 | pub fn WIFSTOPPED(s: u32) bool { | ||
| 404 | return @intCast(u16, (((s & 0xffff) *% 0x10001) >> 8)) > 0x7f00; | ||
| 405 | } | ||
| 406 | pub fn WIFSIGNALED(s: u32) bool { | ||
| 407 | return (s & 0xffff) -% 1 < 0xff; | ||
| 408 | } | ||
| 409 | |||
| 410 | pub const dirent = extern struct { | 416 | pub const dirent = extern struct { |
| 411 | d_fileno: c_ulong, | 417 | d_fileno: c_ulong, |
| 412 | d_namlen: u16, | 418 | d_namlen: u16, |
| ... | @@ -420,16 +426,18 @@ pub const dirent = extern struct { | ... | @@ -420,16 +426,18 @@ pub const dirent = extern struct { |
| 420 | } | 426 | } |
| 421 | }; | 427 | }; |
| 422 | 428 | ||
| 423 | pub const DT_UNKNOWN = 0; | 429 | pub const DT = struct { |
| 424 | pub const DT_FIFO = 1; | 430 | pub const UNKNOWN = 0; |
| 425 | pub const DT_CHR = 2; | 431 | pub const FIFO = 1; |
| 426 | pub const DT_DIR = 4; | 432 | pub const CHR = 2; |
| 427 | pub const DT_BLK = 6; | 433 | pub const DIR = 4; |
| 428 | pub const DT_REG = 8; | 434 | pub const BLK = 6; |
| 429 | pub const DT_LNK = 10; | 435 | pub const REG = 8; |
| 430 | pub const DT_SOCK = 12; | 436 | pub const LNK = 10; |
| 431 | pub const DT_WHT = 14; | 437 | pub const SOCK = 12; |
| 432 | pub const DT_DBF = 15; | 438 | pub const WHT = 14; |
| 439 | pub const DBF = 15; | ||
| 440 | }; | ||
| 433 | 441 | ||
| 434 | pub const CLOCK = struct { | 442 | pub const CLOCK = struct { |
| 435 | pub const REALTIME = 0; | 443 | pub const REALTIME = 0; |
| ... | @@ -1075,9 +1083,11 @@ pub const rlimit = extern struct { | ... | @@ -1075,9 +1083,11 @@ pub const rlimit = extern struct { |
| 1075 | max: rlim_t, | 1083 | max: rlim_t, |
| 1076 | }; | 1084 | }; |
| 1077 | 1085 | ||
| 1078 | pub const SHUT_RD = 0; | 1086 | pub const SHUT = struct { |
| 1079 | pub const SHUT_WR = 1; | 1087 | pub const RD = 0; |
| 1080 | pub const SHUT_RDWR = 2; | 1088 | pub const WR = 1; |
| 1089 | pub const RDWR = 2; | ||
| 1090 | }; | ||
| 1081 | 1091 | ||
| 1082 | pub const nfds_t = u32; | 1092 | pub const nfds_t = u32; |
| 1083 | 1093 |
lib/std/c/freebsd.zig+21-15| ... | @@ -569,9 +569,11 @@ pub const LOCK = struct { | ... | @@ -569,9 +569,11 @@ pub const LOCK = struct { |
| 569 | 569 | ||
| 570 | pub const FD_CLOEXEC = 1; | 570 | pub const FD_CLOEXEC = 1; |
| 571 | 571 | ||
| 572 | pub const SEEK_SET = 0; | 572 | pub const SEEK = struct { |
| 573 | pub const SEEK_CUR = 1; | 573 | pub const SET = 0; |
| 574 | pub const SEEK_END = 2; | 574 | pub const CUR = 1; |
| 575 | pub const END = 2; | ||
| 576 | }; | ||
| 575 | 577 | ||
| 576 | pub const SOCK = struct { | 578 | pub const SOCK = struct { |
| 577 | pub const STREAM = 1; | 579 | pub const STREAM = 1; |
| ... | @@ -721,15 +723,17 @@ pub const AF = struct { | ... | @@ -721,15 +723,17 @@ pub const AF = struct { |
| 721 | pub const MAX = 42; | 723 | pub const MAX = 42; |
| 722 | }; | 724 | }; |
| 723 | 725 | ||
| 724 | pub const DT_UNKNOWN = 0; | 726 | pub const DT = struct { |
| 725 | pub const DT_FIFO = 1; | 727 | pub const UNKNOWN = 0; |
| 726 | pub const DT_CHR = 2; | 728 | pub const FIFO = 1; |
| 727 | pub const DT_DIR = 4; | 729 | pub const CHR = 2; |
| 728 | pub const DT_BLK = 6; | 730 | pub const DIR = 4; |
| 729 | pub const DT_REG = 8; | 731 | pub const BLK = 6; |
| 730 | pub const DT_LNK = 10; | 732 | pub const REG = 8; |
| 731 | pub const DT_SOCK = 12; | 733 | pub const LNK = 10; |
| 732 | pub const DT_WHT = 14; | 734 | pub const SOCK = 12; |
| 735 | pub const WHT = 14; | ||
| 736 | }; | ||
| 733 | 737 | ||
| 734 | /// add event to kq (implies enable) | 738 | /// add event to kq (implies enable) |
| 735 | pub const EV_ADD = 0x0001; | 739 | pub const EV_ADD = 0x0001; |
| ... | @@ -1541,9 +1545,11 @@ pub const rlimit = extern struct { | ... | @@ -1541,9 +1545,11 @@ pub const rlimit = extern struct { |
| 1541 | max: rlim_t, | 1545 | max: rlim_t, |
| 1542 | }; | 1546 | }; |
| 1543 | 1547 | ||
| 1544 | pub const SHUT_RD = 0; | 1548 | pub const SHUT = struct { |
| 1545 | pub const SHUT_WR = 1; | 1549 | pub const RD = 0; |
| 1546 | pub const SHUT_RDWR = 2; | 1550 | pub const WR = 1; |
| 1551 | pub const RDWR = 2; | ||
| 1552 | }; | ||
| 1547 | 1553 | ||
| 1548 | pub const nfds_t = u32; | 1554 | pub const nfds_t = u32; |
| 1549 | 1555 |
lib/std/c/haiku.zig+67-58| ... | @@ -408,23 +408,52 @@ pub const MAP = struct { | ... | @@ -408,23 +408,52 @@ pub const MAP = struct { |
| 408 | pub const PREFAULT_READ = 0x00040000; | 408 | pub const PREFAULT_READ = 0x00040000; |
| 409 | pub const @"32BIT" = 0x00080000; | 409 | pub const @"32BIT" = 0x00080000; |
| 410 | }; | 410 | }; |
| 411 | pub const WNOHANG = 0x1; | 411 | |
| 412 | pub const WUNTRACED = 0x2; | 412 | pub const W = struct { |
| 413 | pub const WSTOPPED = 0x10; | 413 | pub const NOHANG = 0x1; |
| 414 | pub const WCONTINUED = 0x4; | 414 | pub const UNTRACED = 0x2; |
| 415 | pub const WNOWAIT = 0x20; | 415 | pub const STOPPED = 0x10; |
| 416 | pub const WEXITED = 0x08; | 416 | pub const CONTINUED = 0x4; |
| 417 | 417 | pub const NOWAIT = 0x20; | |
| 418 | pub const SA_ONSTACK = 0x20; | 418 | pub const EXITED = 0x08; |
| 419 | pub const SA_RESTART = 0x10; | 419 | |
| 420 | pub const SA_RESETHAND = 0x04; | 420 | pub fn EXITSTATUS(s: u32) u8 { |
| 421 | pub const SA_NOCLDSTOP = 0x01; | 421 | return @intCast(u8, s & 0xff); |
| 422 | pub const SA_NODEFER = 0x08; | 422 | } |
| 423 | pub const SA_NOCLDWAIT = 0x02; | 423 | |
| 424 | pub const SA_SIGINFO = 0x40; | 424 | pub fn TERMSIG(s: u32) u32 { |
| 425 | pub const SA_NOMASK = SA_NODEFER; | 425 | return (s >> 8) & 0xff; |
| 426 | pub const SA_STACK = SA_ONSTACK; | 426 | } |
| 427 | pub const SA_ONESHOT = SA_RESETHAND; | 427 | |
| 428 | pub fn STOPSIG(s: u32) u32 { | ||
| 429 | return EXITSTATUS(s); | ||
| 430 | } | ||
| 431 | |||
| 432 | pub fn IFEXITED(s: u32) bool { | ||
| 433 | return TERMSIG(s) == 0; | ||
| 434 | } | ||
| 435 | |||
| 436 | pub fn IFSTOPPED(s: u32) bool { | ||
| 437 | return ((s >> 16) & 0xff) != 0; | ||
| 438 | } | ||
| 439 | |||
| 440 | pub fn IFSIGNALED(s: u32) bool { | ||
| 441 | return ((s >> 8) & 0xff) != 0; | ||
| 442 | } | ||
| 443 | }; | ||
| 444 | |||
| 445 | pub const SA = struct { | ||
| 446 | pub const ONSTACK = 0x20; | ||
| 447 | pub const RESTART = 0x10; | ||
| 448 | pub const RESETHAND = 0x04; | ||
| 449 | pub const NOCLDSTOP = 0x01; | ||
| 450 | pub const NODEFER = 0x08; | ||
| 451 | pub const NOCLDWAIT = 0x02; | ||
| 452 | pub const SIGINFO = 0x40; | ||
| 453 | pub const NOMASK = NODEFER; | ||
| 454 | pub const STACK = ONSTACK; | ||
| 455 | pub const ONESHOT = RESETHAND; | ||
| 456 | }; | ||
| 428 | 457 | ||
| 429 | pub const SIG = struct { | 458 | pub const SIG = struct { |
| 430 | pub const ERR = @intToPtr(fn (i32) callconv(.C) void, maxInt(usize)); | 459 | pub const ERR = @intToPtr(fn (i32) callconv(.C) void, maxInt(usize)); |
| ... | @@ -558,9 +587,11 @@ pub const LOCK = struct { | ... | @@ -558,9 +587,11 @@ pub const LOCK = struct { |
| 558 | 587 | ||
| 559 | pub const FD_CLOEXEC = 1; | 588 | pub const FD_CLOEXEC = 1; |
| 560 | 589 | ||
| 561 | pub const SEEK_SET = 0; | 590 | pub const SEEK = struct { |
| 562 | pub const SEEK_CUR = 1; | 591 | pub const SET = 0; |
| 563 | pub const SEEK_END = 2; | 592 | pub const CUR = 1; |
| 593 | pub const END = 2; | ||
| 594 | }; | ||
| 564 | 595 | ||
| 565 | pub const SOCK = struct { | 596 | pub const SOCK = struct { |
| 566 | pub const STREAM = 1; | 597 | pub const STREAM = 1; |
| ... | @@ -710,15 +741,17 @@ pub const AF = struct { | ... | @@ -710,15 +741,17 @@ pub const AF = struct { |
| 710 | pub const MAX = 42; | 741 | pub const MAX = 42; |
| 711 | }; | 742 | }; |
| 712 | 743 | ||
| 713 | pub const DT_UNKNOWN = 0; | 744 | pub const DT = struct { |
| 714 | pub const DT_FIFO = 1; | 745 | pub const UNKNOWN = 0; |
| 715 | pub const DT_CHR = 2; | 746 | pub const FIFO = 1; |
| 716 | pub const DT_DIR = 4; | 747 | pub const CHR = 2; |
| 717 | pub const DT_BLK = 6; | 748 | pub const DIR = 4; |
| 718 | pub const DT_REG = 8; | 749 | pub const BLK = 6; |
| 719 | pub const DT_LNK = 10; | 750 | pub const REG = 8; |
| 720 | pub const DT_SOCK = 12; | 751 | pub const LNK = 10; |
| 721 | pub const DT_WHT = 14; | 752 | pub const SOCK = 12; |
| 753 | pub const WHT = 14; | ||
| 754 | }; | ||
| 722 | 755 | ||
| 723 | /// add event to kq (implies enable) | 756 | /// add event to kq (implies enable) |
| 724 | pub const EV_ADD = 0x0001; | 757 | pub const EV_ADD = 0x0001; |
| ... | @@ -806,32 +839,6 @@ pub const T = struct { | ... | @@ -806,32 +839,6 @@ pub const T = struct { |
| 806 | pub const IOCGSID = 0x8024; | 839 | pub const IOCGSID = 0x8024; |
| 807 | }; | 840 | }; |
| 808 | 841 | ||
| 809 | pub const W = struct { | ||
| 810 | pub fn EXITSTATUS(s: u32) u8 { | ||
| 811 | return @intCast(u8, s & 0xff); | ||
| 812 | } | ||
| 813 | |||
| 814 | pub fn TERMSIG(s: u32) u32 { | ||
| 815 | return (s >> 8) & 0xff; | ||
| 816 | } | ||
| 817 | |||
| 818 | pub fn STOPSIG(s: u32) u32 { | ||
| 819 | return EXITSTATUS(s); | ||
| 820 | } | ||
| 821 | |||
| 822 | pub fn IFEXITED(s: u32) bool { | ||
| 823 | return TERMSIG(s) == 0; | ||
| 824 | } | ||
| 825 | |||
| 826 | pub fn IFSTOPPED(s: u32) bool { | ||
| 827 | return ((s >> 16) & 0xff) != 0; | ||
| 828 | } | ||
| 829 | |||
| 830 | pub fn IFSIGNALED(s: u32) bool { | ||
| 831 | return ((s >> 8) & 0xff) != 0; | ||
| 832 | } | ||
| 833 | }; | ||
| 834 | |||
| 835 | pub const winsize = extern struct { | 842 | pub const winsize = extern struct { |
| 836 | ws_row: u16, | 843 | ws_row: u16, |
| 837 | ws_col: u16, | 844 | ws_col: u16, |
| ... | @@ -1364,9 +1371,11 @@ pub const rlimit = extern struct { | ... | @@ -1364,9 +1371,11 @@ pub const rlimit = extern struct { |
| 1364 | max: rlim_t, | 1371 | max: rlim_t, |
| 1365 | }; | 1372 | }; |
| 1366 | 1373 | ||
| 1367 | pub const SHUT_RD = 0; | 1374 | pub const SHUT = struct { |
| 1368 | pub const SHUT_WR = 1; | 1375 | pub const RD = 0; |
| 1369 | pub const SHUT_RDWR = 2; | 1376 | pub const WR = 1; |
| 1377 | pub const RDWR = 2; | ||
| 1378 | }; | ||
| 1370 | 1379 | ||
| 1371 | // TODO fill out if needed | 1380 | // TODO fill out if needed |
| 1372 | pub const directory_which = enum(c_int) { | 1381 | pub const directory_which = enum(c_int) { |
lib/std/c/linux.zig+1| ... | @@ -96,6 +96,7 @@ pub const ucontext_t = linux.ucontext_t; | ... | @@ -96,6 +96,7 @@ pub const ucontext_t = linux.ucontext_t; |
| 96 | pub const uid_t = linux.uid_t; | 96 | pub const uid_t = linux.uid_t; |
| 97 | pub const user_desc = linux.user_desc; | 97 | pub const user_desc = linux.user_desc; |
| 98 | pub const utsname = linux.utsname; | 98 | pub const utsname = linux.utsname; |
| 99 | pub const PR = linux.PR; | ||
| 99 | 100 | ||
| 100 | pub const _errno = switch (native_abi) { | 101 | pub const _errno = switch (native_abi) { |
| 101 | .android => struct { | 102 | .android => struct { |
lib/std/c/netbsd.zig+66-55| ... | @@ -569,21 +569,51 @@ pub const MAP = struct { | ... | @@ -569,21 +569,51 @@ pub const MAP = struct { |
| 569 | pub const ANONYMOUS = ANON; | 569 | pub const ANONYMOUS = ANON; |
| 570 | pub const STACK = 0x2000; | 570 | pub const STACK = 0x2000; |
| 571 | }; | 571 | }; |
| 572 | pub const WNOHANG = 0x00000001; | 572 | |
| 573 | pub const WUNTRACED = 0x00000002; | 573 | pub const W = struct { |
| 574 | pub const WSTOPPED = WUNTRACED; | 574 | pub const NOHANG = 0x00000001; |
| 575 | pub const WCONTINUED = 0x00000010; | 575 | pub const UNTRACED = 0x00000002; |
| 576 | pub const WNOWAIT = 0x00010000; | 576 | pub const STOPPED = UNTRACED; |
| 577 | pub const WEXITED = 0x00000020; | 577 | pub const CONTINUED = 0x00000010; |
| 578 | pub const WTRAPPED = 0x00000040; | 578 | pub const NOWAIT = 0x00010000; |
| 579 | 579 | pub const EXITED = 0x00000020; | |
| 580 | pub const SA_ONSTACK = 0x0001; | 580 | pub const TRAPPED = 0x00000040; |
| 581 | pub const SA_RESTART = 0x0002; | 581 | |
| 582 | pub const SA_RESETHAND = 0x0004; | 582 | pub fn EXITSTATUS(s: u32) u8 { |
| 583 | pub const SA_NOCLDSTOP = 0x0008; | 583 | return @intCast(u8, (s >> 8) & 0xff); |
| 584 | pub const SA_NODEFER = 0x0010; | 584 | } |
| 585 | pub const SA_NOCLDWAIT = 0x0020; | 585 | pub fn TERMSIG(s: u32) u32 { |
| 586 | pub const SA_SIGINFO = 0x0040; | 586 | return s & 0x7f; |
| 587 | } | ||
| 588 | pub fn STOPSIG(s: u32) u32 { | ||
| 589 | return EXITSTATUS(s); | ||
| 590 | } | ||
| 591 | pub fn IFEXITED(s: u32) bool { | ||
| 592 | return TERMSIG(s) == 0; | ||
| 593 | } | ||
| 594 | |||
| 595 | pub fn IFCONTINUED(s: u32) bool { | ||
| 596 | return ((s & 0x7f) == 0xffff); | ||
| 597 | } | ||
| 598 | |||
| 599 | pub fn IFSTOPPED(s: u32) bool { | ||
| 600 | return ((s & 0x7f != 0x7f) and !IFCONTINUED(s)); | ||
| 601 | } | ||
| 602 | |||
| 603 | pub fn IFSIGNALED(s: u32) bool { | ||
| 604 | return !IFSTOPPED(s) and !IFCONTINUED(s) and !IFEXITED(s); | ||
| 605 | } | ||
| 606 | }; | ||
| 607 | |||
| 608 | pub const SA = struct { | ||
| 609 | pub const ONSTACK = 0x0001; | ||
| 610 | pub const RESTART = 0x0002; | ||
| 611 | pub const RESETHAND = 0x0004; | ||
| 612 | pub const NOCLDSTOP = 0x0008; | ||
| 613 | pub const NODEFER = 0x0010; | ||
| 614 | pub const NOCLDWAIT = 0x0020; | ||
| 615 | pub const SIGINFO = 0x0040; | ||
| 616 | }; | ||
| 587 | 617 | ||
| 588 | // access function | 618 | // access function |
| 589 | pub const F_OK = 0; // test for existence of file | 619 | pub const F_OK = 0; // test for existence of file |
| ... | @@ -666,19 +696,23 @@ pub const LOCK = struct { | ... | @@ -666,19 +696,23 @@ pub const LOCK = struct { |
| 666 | 696 | ||
| 667 | pub const FD_CLOEXEC = 1; | 697 | pub const FD_CLOEXEC = 1; |
| 668 | 698 | ||
| 669 | pub const SEEK_SET = 0; | 699 | pub const SEEK = struct { |
| 670 | pub const SEEK_CUR = 1; | 700 | pub const SET = 0; |
| 671 | pub const SEEK_END = 2; | 701 | pub const CUR = 1; |
| 702 | pub const END = 2; | ||
| 703 | }; | ||
| 672 | 704 | ||
| 673 | pub const DT_UNKNOWN = 0; | 705 | pub const DT = struct { |
| 674 | pub const DT_FIFO = 1; | 706 | pub const UNKNOWN = 0; |
| 675 | pub const DT_CHR = 2; | 707 | pub const FIFO = 1; |
| 676 | pub const DT_DIR = 4; | 708 | pub const CHR = 2; |
| 677 | pub const DT_BLK = 6; | 709 | pub const DIR = 4; |
| 678 | pub const DT_REG = 8; | 710 | pub const BLK = 6; |
| 679 | pub const DT_LNK = 10; | 711 | pub const REG = 8; |
| 680 | pub const DT_SOCK = 12; | 712 | pub const LNK = 10; |
| 681 | pub const DT_WHT = 14; | 713 | pub const SOCK = 12; |
| 714 | pub const WHT = 14; | ||
| 715 | }; | ||
| 682 | 716 | ||
| 683 | /// add event to kq (implies enable) | 717 | /// add event to kq (implies enable) |
| 684 | pub const EV_ADD = 0x0001; | 718 | pub const EV_ADD = 0x0001; |
| ... | @@ -845,31 +879,6 @@ pub const T = struct { | ... | @@ -845,31 +879,6 @@ pub const T = struct { |
| 845 | pub const IOCXMTFRAME = 0x80087444; | 879 | pub const IOCXMTFRAME = 0x80087444; |
| 846 | }; | 880 | }; |
| 847 | 881 | ||
| 848 | pub fn WEXITSTATUS(s: u32) u8 { | ||
| 849 | return @intCast(u8, (s >> 8) & 0xff); | ||
| 850 | } | ||
| 851 | pub fn WTERMSIG(s: u32) u32 { | ||
| 852 | return s & 0x7f; | ||
| 853 | } | ||
| 854 | pub fn WSTOPSIG(s: u32) u32 { | ||
| 855 | return WEXITSTATUS(s); | ||
| 856 | } | ||
| 857 | pub fn WIFEXITED(s: u32) bool { | ||
| 858 | return WTERMSIG(s) == 0; | ||
| 859 | } | ||
| 860 | |||
| 861 | pub fn WIFCONTINUED(s: u32) bool { | ||
| 862 | return ((s & 0x7f) == 0xffff); | ||
| 863 | } | ||
| 864 | |||
| 865 | pub fn WIFSTOPPED(s: u32) bool { | ||
| 866 | return ((s & 0x7f != 0x7f) and !WIFCONTINUED(s)); | ||
| 867 | } | ||
| 868 | |||
| 869 | pub fn WIFSIGNALED(s: u32) bool { | ||
| 870 | return !WIFSTOPPED(s) and !WIFCONTINUED(s) and !WIFEXITED(s); | ||
| 871 | } | ||
| 872 | |||
| 873 | pub const winsize = extern struct { | 882 | pub const winsize = extern struct { |
| 874 | ws_row: u16, | 883 | ws_row: u16, |
| 875 | ws_col: u16, | 884 | ws_col: u16, |
| ... | @@ -1388,9 +1397,11 @@ pub const rlimit = extern struct { | ... | @@ -1388,9 +1397,11 @@ pub const rlimit = extern struct { |
| 1388 | max: rlim_t, | 1397 | max: rlim_t, |
| 1389 | }; | 1398 | }; |
| 1390 | 1399 | ||
| 1391 | pub const SHUT_RD = 0; | 1400 | pub const SHUT = struct { |
| 1392 | pub const SHUT_WR = 1; | 1401 | pub const RD = 0; |
| 1393 | pub const SHUT_RDWR = 2; | 1402 | pub const WR = 1; |
| 1403 | pub const RDWR = 2; | ||
| 1404 | }; | ||
| 1394 | 1405 | ||
| 1395 | pub const nfds_t = u32; | 1406 | pub const nfds_t = u32; |
| 1396 | 1407 |
lib/std/c/openbsd.zig+62-51| ... | @@ -361,17 +361,47 @@ pub const MAP = struct { | ... | @@ -361,17 +361,47 @@ pub const MAP = struct { |
| 361 | pub const STACK = 0x4000; | 361 | pub const STACK = 0x4000; |
| 362 | pub const CONCEAL = 0x8000; | 362 | pub const CONCEAL = 0x8000; |
| 363 | }; | 363 | }; |
| 364 | pub const WNOHANG = 1; | 364 | |
| 365 | pub const WUNTRACED = 2; | 365 | pub const W = struct { |
| 366 | pub const WCONTINUED = 8; | 366 | pub const NOHANG = 1; |
| 367 | 367 | pub const UNTRACED = 2; | |
| 368 | pub const SA_ONSTACK = 0x0001; | 368 | pub const CONTINUED = 8; |
| 369 | pub const SA_RESTART = 0x0002; | 369 | |
| 370 | pub const SA_RESETHAND = 0x0004; | 370 | pub fn EXITSTATUS(s: u32) u8 { |
| 371 | pub const SA_NOCLDSTOP = 0x0008; | 371 | return @intCast(u8, (s >> 8) & 0xff); |
| 372 | pub const SA_NODEFER = 0x0010; | 372 | } |
| 373 | pub const SA_NOCLDWAIT = 0x0020; | 373 | pub fn TERMSIG(s: u32) u32 { |
| 374 | pub const SA_SIGINFO = 0x0040; | 374 | return (s & 0x7f); |
| 375 | } | ||
| 376 | pub fn STOPSIG(s: u32) u32 { | ||
| 377 | return EXITSTATUS(s); | ||
| 378 | } | ||
| 379 | pub fn IFEXITED(s: u32) bool { | ||
| 380 | return TERMSIG(s) == 0; | ||
| 381 | } | ||
| 382 | |||
| 383 | pub fn IFCONTINUED(s: u32) bool { | ||
| 384 | return ((s & 0o177777) == 0o177777); | ||
| 385 | } | ||
| 386 | |||
| 387 | pub fn IFSTOPPED(s: u32) bool { | ||
| 388 | return (s & 0xff == 0o177); | ||
| 389 | } | ||
| 390 | |||
| 391 | pub fn IFSIGNALED(s: u32) bool { | ||
| 392 | return (((s) & 0o177) != 0o177) and (((s) & 0o177) != 0); | ||
| 393 | } | ||
| 394 | }; | ||
| 395 | |||
| 396 | pub const SA = struct { | ||
| 397 | pub const ONSTACK = 0x0001; | ||
| 398 | pub const RESTART = 0x0002; | ||
| 399 | pub const RESETHAND = 0x0004; | ||
| 400 | pub const NOCLDSTOP = 0x0008; | ||
| 401 | pub const NODEFER = 0x0010; | ||
| 402 | pub const NOCLDWAIT = 0x0020; | ||
| 403 | pub const SIGINFO = 0x0040; | ||
| 404 | }; | ||
| 375 | 405 | ||
| 376 | // access function | 406 | // access function |
| 377 | pub const F_OK = 0; // test for existence of file | 407 | pub const F_OK = 0; // test for existence of file |
| ... | @@ -448,9 +478,11 @@ pub const LOCK = struct { | ... | @@ -448,9 +478,11 @@ pub const LOCK = struct { |
| 448 | 478 | ||
| 449 | pub const FD_CLOEXEC = 1; | 479 | pub const FD_CLOEXEC = 1; |
| 450 | 480 | ||
| 451 | pub const SEEK_SET = 0; | 481 | pub const SEEK = struct { |
| 452 | pub const SEEK_CUR = 1; | 482 | pub const SET = 0; |
| 453 | pub const SEEK_END = 2; | 483 | pub const CUR = 1; |
| 484 | pub const END = 2; | ||
| 485 | }; | ||
| 454 | 486 | ||
| 455 | pub const SOCK = struct { | 487 | pub const SOCK = struct { |
| 456 | pub const STREAM = 1; | 488 | pub const STREAM = 1; |
| ... | @@ -530,15 +562,17 @@ pub const AF = struct { | ... | @@ -530,15 +562,17 @@ pub const AF = struct { |
| 530 | pub const MAX = 36; | 562 | pub const MAX = 36; |
| 531 | }; | 563 | }; |
| 532 | 564 | ||
| 533 | pub const DT_UNKNOWN = 0; | 565 | pub const DT = struct { |
| 534 | pub const DT_FIFO = 1; | 566 | pub const UNKNOWN = 0; |
| 535 | pub const DT_CHR = 2; | 567 | pub const FIFO = 1; |
| 536 | pub const DT_DIR = 4; | 568 | pub const CHR = 2; |
| 537 | pub const DT_BLK = 6; | 569 | pub const DIR = 4; |
| 538 | pub const DT_REG = 8; | 570 | pub const BLK = 6; |
| 539 | pub const DT_LNK = 10; | 571 | pub const REG = 8; |
| 540 | pub const DT_SOCK = 12; | 572 | pub const LNK = 10; |
| 541 | pub const DT_WHT = 14; // XXX | 573 | pub const SOCK = 12; |
| 574 | pub const WHT = 14; // XXX | ||
| 575 | }; | ||
| 542 | 576 | ||
| 543 | pub const EV_ADD = 0x0001; | 577 | pub const EV_ADD = 0x0001; |
| 544 | pub const EV_DELETE = 0x0002; | 578 | pub const EV_DELETE = 0x0002; |
| ... | @@ -668,31 +702,6 @@ pub const T = struct { | ... | @@ -668,31 +702,6 @@ pub const T = struct { |
| 668 | pub const IOCXMTFRAME = 0x80087444; | 702 | pub const IOCXMTFRAME = 0x80087444; |
| 669 | }; | 703 | }; |
| 670 | 704 | ||
| 671 | pub fn WEXITSTATUS(s: u32) u8 { | ||
| 672 | return @intCast(u8, (s >> 8) & 0xff); | ||
| 673 | } | ||
| 674 | pub fn WTERMSIG(s: u32) u32 { | ||
| 675 | return (s & 0x7f); | ||
| 676 | } | ||
| 677 | pub fn WSTOPSIG(s: u32) u32 { | ||
| 678 | return WEXITSTATUS(s); | ||
| 679 | } | ||
| 680 | pub fn WIFEXITED(s: u32) bool { | ||
| 681 | return WTERMSIG(s) == 0; | ||
| 682 | } | ||
| 683 | |||
| 684 | pub fn WIFCONTINUED(s: u32) bool { | ||
| 685 | return ((s & 0o177777) == 0o177777); | ||
| 686 | } | ||
| 687 | |||
| 688 | pub fn WIFSTOPPED(s: u32) bool { | ||
| 689 | return (s & 0xff == 0o177); | ||
| 690 | } | ||
| 691 | |||
| 692 | pub fn WIFSIGNALED(s: u32) bool { | ||
| 693 | return (((s) & 0o177) != 0o177) and (((s) & 0o177) != 0); | ||
| 694 | } | ||
| 695 | |||
| 696 | pub const winsize = extern struct { | 705 | pub const winsize = extern struct { |
| 697 | ws_row: c_ushort, | 706 | ws_row: c_ushort, |
| 698 | ws_col: c_ushort, | 707 | ws_col: c_ushort, |
| ... | @@ -1178,9 +1187,11 @@ pub const rlimit = extern struct { | ... | @@ -1178,9 +1187,11 @@ pub const rlimit = extern struct { |
| 1178 | max: rlim_t, | 1187 | max: rlim_t, |
| 1179 | }; | 1188 | }; |
| 1180 | 1189 | ||
| 1181 | pub const SHUT_RD = 0; | 1190 | pub const SHUT = struct { |
| 1182 | pub const SHUT_WR = 1; | 1191 | pub const RD = 0; |
| 1183 | pub const SHUT_RDWR = 2; | 1192 | pub const WR = 1; |
| 1193 | pub const RDWR = 2; | ||
| 1194 | }; | ||
| 1184 | 1195 | ||
| 1185 | pub const nfds_t = c_uint; | 1196 | pub const nfds_t = c_uint; |
| 1186 | 1197 |
lib/std/c/wasi.zig+4-1| ... | @@ -8,7 +8,7 @@ pub fn _errno() *c_int { | ... | @@ -8,7 +8,7 @@ pub fn _errno() *c_int { |
| 8 | return &errno; | 8 | return &errno; |
| 9 | } | 9 | } |
| 10 | 10 | ||
| 11 | pub const fd_t = c_int; | 11 | pub const fd_t = wasi.fd_t; |
| 12 | pub const pid_t = c_int; | 12 | pub const pid_t = c_int; |
| 13 | pub const uid_t = u32; | 13 | pub const uid_t = u32; |
| 14 | pub const gid_t = u32; | 14 | pub const gid_t = u32; |
| ... | @@ -22,6 +22,9 @@ pub const STDIN_FILENO = wasi.STDIN_FILENO; | ... | @@ -22,6 +22,9 @@ pub const STDIN_FILENO = wasi.STDIN_FILENO; |
| 22 | pub const STDOUT_FILENO = wasi.STDOUT_FILENO; | 22 | pub const STDOUT_FILENO = wasi.STDOUT_FILENO; |
| 23 | pub const E = wasi.E; | 23 | pub const E = wasi.E; |
| 24 | pub const CLOCK = wasi.CLOCK; | 24 | pub const CLOCK = wasi.CLOCK; |
| 25 | pub const S = wasi.S; | ||
| 26 | pub const IOV_MAX = wasi.IOV_MAX; | ||
| 27 | pub const AT = wasi.AT; | ||
| 25 | 28 | ||
| 26 | pub const Stat = extern struct { | 29 | pub const Stat = extern struct { |
| 27 | dev: i32, | 30 | dev: i32, |
lib/std/c/windows.zig+5-3| ... | @@ -88,9 +88,11 @@ pub const SIG = struct { | ... | @@ -88,9 +88,11 @@ pub const SIG = struct { |
| 88 | pub const ERR = -1; | 88 | pub const ERR = -1; |
| 89 | }; | 89 | }; |
| 90 | 90 | ||
| 91 | pub const SEEK_SET = 0; | 91 | pub const SEEK = struct { |
| 92 | pub const SEEK_CUR = 1; | 92 | pub const SET = 0; |
| 93 | pub const SEEK_END = 2; | 93 | pub const CUR = 1; |
| 94 | pub const END = 2; | ||
| 95 | }; | ||
| 94 | 96 | ||
| 95 | pub const E = enum(u16) { | 97 | pub const E = enum(u16) { |
| 96 | /// No error occurred. | 98 | /// No error occurred. |
lib/std/fs.zig+17-17| ... | @@ -344,7 +344,7 @@ pub const Dir = struct { | ... | @@ -344,7 +344,7 @@ pub const Dir = struct { |
| 344 | self.index = 0; | 344 | self.index = 0; |
| 345 | self.end_index = @intCast(usize, rc); | 345 | self.end_index = @intCast(usize, rc); |
| 346 | } | 346 | } |
| 347 | const darwin_entry = @ptrCast(*align(1) os.dirent, &self.buf[self.index]); | 347 | const darwin_entry = @ptrCast(*align(1) os.darwin.dirent, &self.buf[self.index]); |
| 348 | const next_index = self.index + darwin_entry.reclen(); | 348 | const next_index = self.index + darwin_entry.reclen(); |
| 349 | self.index = next_index; | 349 | self.index = next_index; |
| 350 | 350 | ||
| ... | @@ -355,14 +355,14 @@ pub const Dir = struct { | ... | @@ -355,14 +355,14 @@ pub const Dir = struct { |
| 355 | } | 355 | } |
| 356 | 356 | ||
| 357 | const entry_kind = switch (darwin_entry.d_type) { | 357 | const entry_kind = switch (darwin_entry.d_type) { |
| 358 | os.DT_BLK => Entry.Kind.BlockDevice, | 358 | os.DT.BLK => Entry.Kind.BlockDevice, |
| 359 | os.DT_CHR => Entry.Kind.CharacterDevice, | 359 | os.DT.CHR => Entry.Kind.CharacterDevice, |
| 360 | os.DT_DIR => Entry.Kind.Directory, | 360 | os.DT.DIR => Entry.Kind.Directory, |
| 361 | os.DT_FIFO => Entry.Kind.NamedPipe, | 361 | os.DT.FIFO => Entry.Kind.NamedPipe, |
| 362 | os.DT_LNK => Entry.Kind.SymLink, | 362 | os.DT.LNK => Entry.Kind.SymLink, |
| 363 | os.DT_REG => Entry.Kind.File, | 363 | os.DT.REG => Entry.Kind.File, |
| 364 | os.DT_SOCK => Entry.Kind.UnixDomainSocket, | 364 | os.DT.SOCK => Entry.Kind.UnixDomainSocket, |
| 365 | os.DT_WHT => Entry.Kind.Whiteout, | 365 | os.DT.WHT => Entry.Kind.Whiteout, |
| 366 | else => Entry.Kind.Unknown, | 366 | else => Entry.Kind.Unknown, |
| 367 | }; | 367 | }; |
| 368 | return Entry{ | 368 | return Entry{ |
| ... | @@ -409,14 +409,14 @@ pub const Dir = struct { | ... | @@ -409,14 +409,14 @@ pub const Dir = struct { |
| 409 | } | 409 | } |
| 410 | 410 | ||
| 411 | const entry_kind = switch (bsd_entry.d_type) { | 411 | const entry_kind = switch (bsd_entry.d_type) { |
| 412 | os.DT_BLK => Entry.Kind.BlockDevice, | 412 | os.DT.BLK => Entry.Kind.BlockDevice, |
| 413 | os.DT_CHR => Entry.Kind.CharacterDevice, | 413 | os.DT.CHR => Entry.Kind.CharacterDevice, |
| 414 | os.DT_DIR => Entry.Kind.Directory, | 414 | os.DT.DIR => Entry.Kind.Directory, |
| 415 | os.DT_FIFO => Entry.Kind.NamedPipe, | 415 | os.DT.FIFO => Entry.Kind.NamedPipe, |
| 416 | os.DT_LNK => Entry.Kind.SymLink, | 416 | os.DT.LNK => Entry.Kind.SymLink, |
| 417 | os.DT_REG => Entry.Kind.File, | 417 | os.DT.REG => Entry.Kind.File, |
| 418 | os.DT_SOCK => Entry.Kind.UnixDomainSocket, | 418 | os.DT.SOCK => Entry.Kind.UnixDomainSocket, |
| 419 | os.DT_WHT => Entry.Kind.Whiteout, | 419 | os.DT.WHT => Entry.Kind.Whiteout, |
| 420 | else => Entry.Kind.Unknown, | 420 | else => Entry.Kind.Unknown, |
| 421 | }; | 421 | }; |
| 422 | return Entry{ | 422 | return Entry{ |
lib/std/fs/wasi.zig+1-1| ... | @@ -175,5 +175,5 @@ test "extracting WASI preopens" { | ... | @@ -175,5 +175,5 @@ test "extracting WASI preopens" { |
| 175 | try std.testing.expectEqual(@as(usize, 1), preopens.asSlice().len); | 175 | try std.testing.expectEqual(@as(usize, 1), preopens.asSlice().len); |
| 176 | const preopen = preopens.find(PreopenType{ .Dir = "." }) orelse unreachable; | 176 | const preopen = preopens.find(PreopenType{ .Dir = "." }) orelse unreachable; |
| 177 | try std.testing.expect(preopen.@"type".eql(PreopenType{ .Dir = "." })); | 177 | try std.testing.expect(preopen.@"type".eql(PreopenType{ .Dir = "." })); |
| 178 | try std.testing.expectEqual(@as(usize, 3), preopen.fd); | 178 | try std.testing.expectEqual(@as(i32, 3), preopen.fd); |
| 179 | } | 179 | } |
lib/std/os.zig+1| ... | @@ -68,6 +68,7 @@ pub const ARCH = system.ARCH; | ... | @@ -68,6 +68,7 @@ pub const ARCH = system.ARCH; |
| 68 | pub const AT = system.AT; | 68 | pub const AT = system.AT; |
| 69 | pub const CLOCK = system.CLOCK; | 69 | pub const CLOCK = system.CLOCK; |
| 70 | pub const CPU_COUNT = system.CPU_COUNT; | 70 | pub const CPU_COUNT = system.CPU_COUNT; |
| 71 | pub const DT = system.DT; | ||
| 71 | pub const E = system.E; | 72 | pub const E = system.E; |
| 72 | pub const Elf_Symndx = system.Elf_Symndx; | 73 | pub const Elf_Symndx = system.Elf_Symndx; |
| 73 | pub const F = system.F; | 74 | pub const F = system.F; |
lib/std/os/linux.zig+93-154| ... | @@ -105,18 +105,19 @@ pub const MAP = struct { | ... | @@ -105,18 +105,19 @@ pub const MAP = struct { |
| 105 | /// Interpret addr exactly | 105 | /// Interpret addr exactly |
| 106 | pub const FIXED = 0x10; | 106 | pub const FIXED = 0x10; |
| 107 | /// don't use a file | 107 | /// don't use a file |
| 108 | pub const ANONYMOUS = 0x20; | 108 | pub const ANONYMOUS = if (is_mips) 0x800 else 0x20; |
| 109 | // MAP_ 0x0100 - 0x4000 flags are per architecture | ||
| 109 | /// populate (prefault) pagetables | 110 | /// populate (prefault) pagetables |
| 110 | pub const POPULATE = 0x8000; | 111 | pub const POPULATE = if (is_mips) 0x10000 else 0x8000; |
| 111 | /// do not block on IO | 112 | /// do not block on IO |
| 112 | pub const NONBLOCK = 0x10000; | 113 | pub const NONBLOCK = if (is_mips) 0x20000 else 0x10000; |
| 113 | /// give out an address that is best suited for process/thread stacks | 114 | /// give out an address that is best suited for process/thread stacks |
| 114 | pub const STACK = 0x20000; | 115 | pub const STACK = if (is_mips) 0x40000 else 0x20000; |
| 115 | /// create a huge page mapping | 116 | /// create a huge page mapping |
| 116 | pub const HUGETLB = 0x40000; | 117 | pub const HUGETLB = if (is_mips) 0x80000 else 0x40000; |
| 117 | /// perform synchronous page faults for the mapping | 118 | /// perform synchronous page faults for the mapping |
| 118 | pub const SYNC = 0x80000; | 119 | pub const SYNC = 0x80000; |
| 119 | /// FIXED which doesn't unmap underlying mapping | 120 | /// MAP_FIXED which doesn't unmap underlying mapping |
| 120 | pub const FIXED_NOREPLACE = 0x100000; | 121 | pub const FIXED_NOREPLACE = 0x100000; |
| 121 | /// For anonymous mmap, memory could be uninitialized | 122 | /// For anonymous mmap, memory could be uninitialized |
| 122 | pub const UNINITIALIZED = 0x4000000; | 123 | pub const UNINITIALIZED = 0x4000000; |
| ... | @@ -2111,154 +2112,92 @@ pub const AF = struct { | ... | @@ -2111,154 +2112,92 @@ pub const AF = struct { |
| 2111 | pub const MAX = PF.MAX; | 2112 | pub const MAX = PF.MAX; |
| 2112 | }; | 2113 | }; |
| 2113 | 2114 | ||
| 2114 | pub const SO = if (is_mips) struct { | 2115 | pub const SO = struct { |
| 2115 | pub const SECURITY_AUTHENTICATION = 22; | 2116 | pub usingnamespace if (is_mips) struct { |
| 2116 | pub const SECURITY_ENCRYPTION_TRANSPORT = 23; | 2117 | pub const DEBUG = 1; |
| 2117 | pub const SECURITY_ENCRYPTION_NETWORK = 24; | 2118 | pub const REUSEADDR = 0x0004; |
| 2118 | 2119 | pub const KEEPALIVE = 0x0008; | |
| 2119 | pub const BINDTODEVICE = 25; | 2120 | pub const DONTROUTE = 0x0010; |
| 2120 | 2121 | pub const BROADCAST = 0x0020; | |
| 2121 | pub const ATTACH_FILTER = 26; | 2122 | pub const LINGER = 0x0080; |
| 2122 | pub const DETACH_FILTER = 27; | 2123 | pub const OOBINLINE = 0x0100; |
| 2123 | pub const GET_FILTER = ATTACH_FILTER; | 2124 | pub const REUSEPORT = 0x0200; |
| 2124 | 2125 | pub const SNDBUF = 0x1001; | |
| 2125 | pub const PEERNAME = 28; | 2126 | pub const RCVBUF = 0x1002; |
| 2126 | pub const TIMESTAMP_OLD = 29; | 2127 | pub const SNDLOWAT = 0x1003; |
| 2127 | pub const PASSSEC = 34; | 2128 | pub const RCVLOWAT = 0x1004; |
| 2128 | pub const TIMESTAMPNS_OLD = 35; | 2129 | pub const RCVTIMEO = 0x1006; |
| 2129 | pub const MARK = 36; | 2130 | pub const SNDTIMEO = 0x1005; |
| 2130 | pub const TIMESTAMPING_OLD = 37; | 2131 | pub const ERROR = 0x1007; |
| 2131 | 2132 | pub const TYPE = 0x1008; | |
| 2132 | pub const RXQ_OVFL = 40; | 2133 | pub const ACCEPTCONN = 0x1009; |
| 2133 | pub const WIFI_STATUS = 41; | 2134 | pub const PROTOCOL = 0x1028; |
| 2134 | pub const PEEK_OFF = 42; | 2135 | pub const DOMAIN = 0x1029; |
| 2135 | pub const NOFCS = 43; | 2136 | pub const NO_CHECK = 11; |
| 2136 | pub const LOCK_FILTER = 44; | 2137 | pub const PRIORITY = 12; |
| 2137 | pub const SELECT_ERR_QUEUE = 45; | 2138 | pub const BSDCOMPAT = 14; |
| 2138 | pub const BUSY_POLL = 46; | 2139 | pub const PASSCRED = 17; |
| 2139 | pub const MAX_PACING_RATE = 47; | 2140 | pub const PEERCRED = 18; |
| 2140 | pub const BPF_EXTENSIONS = 48; | 2141 | pub const PEERSEC = 30; |
| 2141 | pub const INCOMING_CPU = 49; | 2142 | pub const SNDBUFFORCE = 31; |
| 2142 | pub const ATTACH_BPF = 50; | 2143 | pub const RCVBUFFORCE = 33; |
| 2143 | pub const DETACH_BPF = DETACH_FILTER; | 2144 | } else if (is_ppc or is_ppc64) struct { |
| 2144 | pub const ATTACH_REUSEPORT_CBPF = 51; | 2145 | pub const DEBUG = 1; |
| 2145 | pub const ATTACH_REUSEPORT_EBPF = 52; | 2146 | pub const REUSEADDR = 2; |
| 2146 | pub const CNX_ADVICE = 53; | 2147 | pub const TYPE = 3; |
| 2147 | pub const MEMINFO = 55; | 2148 | pub const ERROR = 4; |
| 2148 | pub const INCOMING_NAPI_ID = 56; | 2149 | pub const DONTROUTE = 5; |
| 2149 | pub const COOKIE = 57; | 2150 | pub const BROADCAST = 6; |
| 2150 | pub const PEERGROUPS = 59; | 2151 | pub const SNDBUF = 7; |
| 2151 | pub const ZEROCOPY = 60; | 2152 | pub const RCVBUF = 8; |
| 2152 | pub const TXTIME = 61; | 2153 | pub const KEEPALIVE = 9; |
| 2153 | pub const BINDTOIFINDEX = 62; | 2154 | pub const OOBINLINE = 10; |
| 2154 | pub const TIMESTAMP_NEW = 63; | 2155 | pub const NO_CHECK = 11; |
| 2155 | pub const TIMESTAMPNS_NEW = 64; | 2156 | pub const PRIORITY = 12; |
| 2156 | pub const TIMESTAMPING_NEW = 65; | 2157 | pub const LINGER = 13; |
| 2157 | pub const RCVTIMEO_NEW = 66; | 2158 | pub const BSDCOMPAT = 14; |
| 2158 | pub const SNDTIMEO_NEW = 67; | 2159 | pub const REUSEPORT = 15; |
| 2159 | pub const DETACH_REUSEPORT_BPF = 68; | 2160 | pub const RCVLOWAT = 16; |
| 2160 | } else if (is_ppc or is_ppc64) struct { | 2161 | pub const SNDLOWAT = 17; |
| 2161 | pub const DEBUG = 1; | 2162 | pub const RCVTIMEO = 18; |
| 2162 | pub const REUSEADDR = 2; | 2163 | pub const SNDTIMEO = 19; |
| 2163 | pub const TYPE = 3; | 2164 | pub const PASSCRED = 20; |
| 2164 | pub const ERROR = 4; | 2165 | pub const PEERCRED = 21; |
| 2165 | pub const DONTROUTE = 5; | 2166 | pub const ACCEPTCONN = 30; |
| 2166 | pub const BROADCAST = 6; | 2167 | pub const PEERSEC = 31; |
| 2167 | pub const SNDBUF = 7; | 2168 | pub const SNDBUFFORCE = 32; |
| 2168 | pub const RCVBUF = 8; | 2169 | pub const RCVBUFFORCE = 33; |
| 2169 | pub const KEEPALIVE = 9; | 2170 | pub const PROTOCOL = 38; |
| 2170 | pub const OOBINLINE = 10; | 2171 | pub const DOMAIN = 39; |
| 2171 | pub const NO_CHECK = 11; | 2172 | } else struct { |
| 2172 | pub const PRIORITY = 12; | 2173 | pub const DEBUG = 1; |
| 2173 | pub const LINGER = 13; | 2174 | pub const REUSEADDR = 2; |
| 2174 | pub const BSDCOMPAT = 14; | 2175 | pub const TYPE = 3; |
| 2175 | pub const REUSEPORT = 15; | 2176 | pub const ERROR = 4; |
| 2176 | pub const RCVLOWAT = 16; | 2177 | pub const DONTROUTE = 5; |
| 2177 | pub const SNDLOWAT = 17; | 2178 | pub const BROADCAST = 6; |
| 2178 | pub const RCVTIMEO = 18; | 2179 | pub const SNDBUF = 7; |
| 2179 | pub const SNDTIMEO = 19; | 2180 | pub const RCVBUF = 8; |
| 2180 | pub const PASSCRED = 20; | 2181 | pub const KEEPALIVE = 9; |
| 2181 | pub const PEERCRED = 21; | 2182 | pub const OOBINLINE = 10; |
| 2182 | pub const ACCEPTCONN = 30; | 2183 | pub const NO_CHECK = 11; |
| 2183 | pub const PEERSEC = 31; | 2184 | pub const PRIORITY = 12; |
| 2184 | pub const SNDBUFFORCE = 32; | 2185 | pub const LINGER = 13; |
| 2185 | pub const RCVBUFFORCE = 33; | 2186 | pub const BSDCOMPAT = 14; |
| 2186 | pub const PROTOCOL = 38; | 2187 | pub const REUSEPORT = 15; |
| 2187 | pub const DOMAIN = 39; | 2188 | pub const PASSCRED = 16; |
| 2188 | 2189 | pub const PEERCRED = 17; | |
| 2189 | pub const SECURITY_AUTHENTICATION = 22; | 2190 | pub const RCVLOWAT = 18; |
| 2190 | pub const SECURITY_ENCRYPTION_TRANSPORT = 23; | 2191 | pub const SNDLOWAT = 19; |
| 2191 | pub const SECURITY_ENCRYPTION_NETWORK = 24; | 2192 | pub const RCVTIMEO = 20; |
| 2192 | 2193 | pub const SNDTIMEO = 21; | |
| 2193 | pub const BINDTODEVICE = 25; | 2194 | pub const ACCEPTCONN = 30; |
| 2194 | 2195 | pub const PEERSEC = 31; | |
| 2195 | pub const ATTACH_FILTER = 26; | 2196 | pub const SNDBUFFORCE = 32; |
| 2196 | pub const DETACH_FILTER = 27; | 2197 | pub const RCVBUFFORCE = 33; |
| 2197 | pub const GET_FILTER = ATTACH_FILTER; | 2198 | pub const PROTOCOL = 38; |
| 2198 | 2199 | pub const DOMAIN = 39; | |
| 2199 | pub const PEERNAME = 28; | 2200 | }; |
| 2200 | pub const TIMESTAMP_OLD = 29; | ||
| 2201 | pub const PASSSEC = 34; | ||
| 2202 | pub const TIMESTAMPNS_OLD = 35; | ||
| 2203 | pub const MARK = 36; | ||
| 2204 | pub const TIMESTAMPING_OLD = 37; | ||
| 2205 | |||
| 2206 | pub const RXQ_OVFL = 40; | ||
| 2207 | pub const WIFI_STATUS = 41; | ||
| 2208 | pub const PEEK_OFF = 42; | ||
| 2209 | pub const NOFCS = 43; | ||
| 2210 | pub const LOCK_FILTER = 44; | ||
| 2211 | pub const SELECT_ERR_QUEUE = 45; | ||
| 2212 | pub const BUSY_POLL = 46; | ||
| 2213 | pub const MAX_PACING_RATE = 47; | ||
| 2214 | pub const BPF_EXTENSIONS = 48; | ||
| 2215 | pub const INCOMING_CPU = 49; | ||
| 2216 | pub const ATTACH_BPF = 50; | ||
| 2217 | pub const DETACH_BPF = DETACH_FILTER; | ||
| 2218 | pub const ATTACH_REUSEPORT_CBPF = 51; | ||
| 2219 | pub const ATTACH_REUSEPORT_EBPF = 52; | ||
| 2220 | pub const CNX_ADVICE = 53; | ||
| 2221 | pub const MEMINFO = 55; | ||
| 2222 | pub const INCOMING_NAPI_ID = 56; | ||
| 2223 | pub const COOKIE = 57; | ||
| 2224 | pub const PEERGROUPS = 59; | ||
| 2225 | pub const ZEROCOPY = 60; | ||
| 2226 | pub const TXTIME = 61; | ||
| 2227 | pub const BINDTOIFINDEX = 62; | ||
| 2228 | pub const TIMESTAMP_NEW = 63; | ||
| 2229 | pub const TIMESTAMPNS_NEW = 64; | ||
| 2230 | pub const TIMESTAMPING_NEW = 65; | ||
| 2231 | pub const RCVTIMEO_NEW = 66; | ||
| 2232 | pub const SNDTIMEO_NEW = 67; | ||
| 2233 | pub const DETACH_REUSEPORT_BPF = 68; | ||
| 2234 | } else struct { | ||
| 2235 | pub const DEBUG = 1; | ||
| 2236 | pub const REUSEADDR = 2; | ||
| 2237 | pub const TYPE = 3; | ||
| 2238 | pub const ERROR = 4; | ||
| 2239 | pub const DONTROUTE = 5; | ||
| 2240 | pub const BROADCAST = 6; | ||
| 2241 | pub const SNDBUF = 7; | ||
| 2242 | pub const RCVBUF = 8; | ||
| 2243 | pub const KEEPALIVE = 9; | ||
| 2244 | pub const OOBINLINE = 10; | ||
| 2245 | pub const NO_CHECK = 11; | ||
| 2246 | pub const PRIORITY = 12; | ||
| 2247 | pub const LINGER = 13; | ||
| 2248 | pub const BSDCOMPAT = 14; | ||
| 2249 | pub const REUSEPORT = 15; | ||
| 2250 | pub const PASSCRED = 16; | ||
| 2251 | pub const PEERCRED = 17; | ||
| 2252 | pub const RCVLOWAT = 18; | ||
| 2253 | pub const SNDLOWAT = 19; | ||
| 2254 | pub const RCVTIMEO = 20; | ||
| 2255 | pub const SNDTIMEO = 21; | ||
| 2256 | pub const ACCEPTCONN = 30; | ||
| 2257 | pub const PEERSEC = 31; | ||
| 2258 | pub const SNDBUFFORCE = 32; | ||
| 2259 | pub const RCVBUFFORCE = 33; | ||
| 2260 | pub const PROTOCOL = 38; | ||
| 2261 | pub const DOMAIN = 39; | ||
| 2262 | 2201 | ||
| 2263 | pub const SECURITY_AUTHENTICATION = 22; | 2202 | pub const SECURITY_AUTHENTICATION = 22; |
| 2264 | pub const SECURITY_ENCRYPTION_TRANSPORT = 23; | 2203 | pub const SECURITY_ENCRYPTION_TRANSPORT = 23; |
lib/std/os/linux/mips.zig-30| ... | @@ -696,36 +696,6 @@ pub const MAP = struct { | ... | @@ -696,36 +696,6 @@ pub const MAP = struct { |
| 696 | pub const @"32BIT" = 0x40; | 696 | pub const @"32BIT" = 0x40; |
| 697 | }; | 697 | }; |
| 698 | 698 | ||
| 699 | pub const SO = struct { | ||
| 700 | pub const DEBUG = 1; | ||
| 701 | pub const REUSEADDR = 0x0004; | ||
| 702 | pub const KEEPALIVE = 0x0008; | ||
| 703 | pub const DONTROUTE = 0x0010; | ||
| 704 | pub const BROADCAST = 0x0020; | ||
| 705 | pub const LINGER = 0x0080; | ||
| 706 | pub const OOBINLINE = 0x0100; | ||
| 707 | pub const REUSEPORT = 0x0200; | ||
| 708 | pub const SNDBUF = 0x1001; | ||
| 709 | pub const RCVBUF = 0x1002; | ||
| 710 | pub const SNDLOWAT = 0x1003; | ||
| 711 | pub const RCVLOWAT = 0x1004; | ||
| 712 | pub const RCVTIMEO = 0x1006; | ||
| 713 | pub const SNDTIMEO = 0x1005; | ||
| 714 | pub const ERROR = 0x1007; | ||
| 715 | pub const TYPE = 0x1008; | ||
| 716 | pub const ACCEPTCONN = 0x1009; | ||
| 717 | pub const PROTOCOL = 0x1028; | ||
| 718 | pub const DOMAIN = 0x1029; | ||
| 719 | pub const NO_CHECK = 11; | ||
| 720 | pub const PRIORITY = 12; | ||
| 721 | pub const BSDCOMPAT = 14; | ||
| 722 | pub const PASSCRED = 17; | ||
| 723 | pub const PEERCRED = 18; | ||
| 724 | pub const PEERSEC = 30; | ||
| 725 | pub const SNDBUFFORCE = 31; | ||
| 726 | pub const RCVBUFFORCE = 33; | ||
| 727 | }; | ||
| 728 | |||
| 729 | pub const VDSO = struct { | 699 | pub const VDSO = struct { |
| 730 | pub const CGT_SYM = "__kernel_clock_gettime"; | 700 | pub const CGT_SYM = "__kernel_clock_gettime"; |
| 731 | pub const CGT_VER = "LINUX_2.6.39"; | 701 | pub const CGT_VER = "LINUX_2.6.39"; |
lib/std/os/wasi.zig+5-3| ... | @@ -292,7 +292,7 @@ pub const EVENTTYPE_FD_WRITE: eventtype_t = 2; | ... | @@ -292,7 +292,7 @@ pub const EVENTTYPE_FD_WRITE: eventtype_t = 2; |
| 292 | 292 | ||
| 293 | pub const exitcode_t = u32; | 293 | pub const exitcode_t = u32; |
| 294 | 294 | ||
| 295 | pub const fd_t = u32; | 295 | pub const fd_t = i32; |
| 296 | 296 | ||
| 297 | pub const fdflags_t = u16; | 297 | pub const fdflags_t = u16; |
| 298 | pub const FDFLAG = struct { | 298 | pub const FDFLAG = struct { |
| ... | @@ -461,8 +461,10 @@ pub const RIGHT = struct { | ... | @@ -461,8 +461,10 @@ pub const RIGHT = struct { |
| 461 | }; | 461 | }; |
| 462 | 462 | ||
| 463 | pub const sdflags_t = u8; | 463 | pub const sdflags_t = u8; |
| 464 | pub const SHUT_RD: sdflags_t = 0x01; | 464 | pub const SHUT = struct { |
| 465 | pub const SHUT_WR: sdflags_t = 0x02; | 465 | pub const RD: sdflags_t = 0x01; |
| 466 | pub const WR: sdflags_t = 0x02; | ||
| 467 | }; | ||
| 466 | 468 | ||
| 467 | pub const siflags_t = u16; | 469 | pub const siflags_t = u16; |
| 468 | 470 |
test/compile_errors.zig+4-2| ... | @@ -243,9 +243,9 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -243,9 +243,9 @@ pub fn addCases(ctx: *TestContext) !void { |
| 243 | 243 | ||
| 244 | ctx.objErrStage1("array in c exported function", | 244 | ctx.objErrStage1("array in c exported function", |
| 245 | \\export fn zig_array(x: [10]u8) void { | 245 | \\export fn zig_array(x: [10]u8) void { |
| 246 | \\try expect(std.mem.eql(u8, &x, "1234567890")); | 246 | \\ try std.testing.expect(std.mem.eql(u8, &x, "1234567890")); |
| 247 | \\} | 247 | \\} |
| 248 | \\ | 248 | \\const std = @import("std"); |
| 249 | \\export fn zig_return_array() [10]u8 { | 249 | \\export fn zig_return_array() [10]u8 { |
| 250 | \\ return "1234567890".*; | 250 | \\ return "1234567890".*; |
| 251 | \\} | 251 | \\} |
| ... | @@ -2787,6 +2787,7 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -2787,6 +2787,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 2787 | \\ _ = msg; _ = error_return_trace; | 2787 | \\ _ = msg; _ = error_return_trace; |
| 2788 | \\ while (true) {} | 2788 | \\ while (true) {} |
| 2789 | \\} | 2789 | \\} |
| 2790 | \\const builtin = @import("std").builtin; | ||
| 2790 | , &[_][]const u8{ | 2791 | , &[_][]const u8{ |
| 2791 | "error: expected type 'fn([]const u8, ?*std.builtin.StackTrace) noreturn', found 'fn([]const u8,anytype) anytype'", | 2792 | "error: expected type 'fn([]const u8, ?*std.builtin.StackTrace) noreturn', found 'fn([]const u8,anytype) anytype'", |
| 2792 | "note: only one of the functions is generic", | 2793 | "note: only one of the functions is generic", |
| ... | @@ -2832,6 +2833,7 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -2832,6 +2833,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 2832 | \\ var s: Foo = Foo.E; | 2833 | \\ var s: Foo = Foo.E; |
| 2833 | \\ _ = s; | 2834 | \\ _ = s; |
| 2834 | \\} | 2835 | \\} |
| 2836 | \\const D = 1; | ||
| 2835 | , &[_][]const u8{ | 2837 | , &[_][]const u8{ |
| 2836 | "tmp.zig:1:17: error: enum 'Foo' depends on itself", | 2838 | "tmp.zig:1:17: error: enum 'Foo' depends on itself", |
| 2837 | }); | 2839 | }); |