| author | |
| committer | |
| log | 4dafdc00d5c0d73511d64c5edf7481c8fe254a61 |
| tree | 0271d2f18d8044027610e5fb328be84ef54ae08d |
| parent | 9493738e5448ca166344a2d57abc44b29bb00081 |
| signature | Commit is signed but in an unrecognized format. |
6 files changed, 18 insertions(+), 29 deletions(-)
std/c/freebsd.zig+2-5| ... | ... | @@ -1,4 +1,3 @@ |
| 1 | ||
| 2 | 1 | const timespec = @import("../os/freebsd/index.zig").timespec; |
| 3 | 2 | |
| 4 | 3 | extern "c" fn __error() *c_int; |
| ... | ... | @@ -18,7 +17,7 @@ pub extern "c" fn sysctlbyname(name: [*]const u8, oldp: ?*c_void, oldlenp: ?*usi |
| 18 | 17 | pub extern "c" fn sysctlnametomib(name: [*]const u8, mibp: ?*c_int, sizep: ?*usize) c_int; |
| 19 | 18 | |
| 20 | 19 | /// Renamed from `kevent` to `Kevent` to avoid conflict with function name. |
| 21 | pub const Kevent = extern struct.{ | |
| 20 | pub const Kevent = extern struct { | |
| 22 | 21 | ident: usize, |
| 23 | 22 | filter: i16, |
| 24 | 23 | flags: u16, |
| ... | ... | @@ -28,9 +27,7 @@ pub const Kevent = extern struct.{ |
| 28 | 27 | // TODO ext |
| 29 | 28 | }; |
| 30 | 29 | |
| 31 | ||
| 32 | pub const pthread_attr_t = extern struct.{ | |
| 30 | pub const pthread_attr_t = extern struct { | |
| 33 | 31 | __size: [56]u8, |
| 34 | 32 | __align: c_long, |
| 35 | 33 | }; |
| 36 |
std/debug/index.zig+1-2| ... | ... | @@ -1101,8 +1101,7 @@ pub const DebugInfo = switch (builtin.os) { |
| 1101 | 1101 | self.elf.close(); |
| 1102 | 1102 | } |
| 1103 | 1103 | }, |
| 1104 | builtin.Os.freebsd => struct.{ | |
| 1105 | }, | |
| 1104 | builtin.Os.freebsd => struct {}, | |
| 1106 | 1105 | else => @compileError("Unsupported OS"), |
| 1107 | 1106 | }; |
| 1108 | 1107 |
std/mem.zig+4-4| ... | ... | @@ -475,8 +475,8 @@ test "readIntBE/LE" { |
| 475 | 475 | assert(readIntBE(u8, []u8{0x32}) == 0x32); |
| 476 | 476 | assert(readIntLE(u8, []u8{0x12}) == 0x12); |
| 477 | 477 | |
| 478 | assert(readIntBE(u16, []u8{0x12, 0x34}) == 0x1234); | |
| 479 | assert(readIntLE(u16, []u8{0x12, 0x34}) == 0x3412); | |
| 478 | assert(readIntBE(u16, []u8{ 0x12, 0x34 }) == 0x1234); | |
| 479 | assert(readIntLE(u16, []u8{ 0x12, 0x34 }) == 0x3412); | |
| 480 | 480 | |
| 481 | 481 | assert(readIntBE(u72, []u8{ 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x24 }) == 0x123456789abcdef024); |
| 482 | 482 | assert(readIntLE(u72, []u8{ 0xec, 0x10, 0x32, 0x54, 0x76, 0x98, 0xba, 0xdc, 0xfe }) == 0xfedcba9876543210ec); |
| ... | ... | @@ -484,8 +484,8 @@ test "readIntBE/LE" { |
| 484 | 484 | assert(readIntBE(i8, []u8{0xff}) == -1); |
| 485 | 485 | assert(readIntLE(i8, []u8{0xfe}) == -2); |
| 486 | 486 | |
| 487 | assert(readIntBE(i16, []u8{0xff, 0xfd}) == -3); | |
| 488 | assert(readIntLE(i16, []u8{0xfc, 0xff}) == -4); | |
| 487 | assert(readIntBE(i16, []u8{ 0xff, 0xfd }) == -3); | |
| 488 | assert(readIntLE(i16, []u8{ 0xfc, 0xff }) == -4); | |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | /// Writes an integer to memory with size equal to bytes.len. Pads with zeroes |
std/os/freebsd/index.zig+7-14| ... | ... | @@ -377,7 +377,6 @@ pub const NOTE_FFCOPY = 0xc0000000; |
| 377 | 377 | pub const NOTE_FFCTRLMASK = 0xc0000000; |
| 378 | 378 | pub const NOTE_FFLAGSMASK = 0x00ffffff; |
| 379 | 379 | |
| 380 | ||
| 381 | 380 | /// low water mark |
| 382 | 381 | pub const NOTE_LOWAT = 0x00000001; |
| 383 | 382 | |
| ... | ... | @@ -445,8 +444,6 @@ pub const NOTE_NSECONDS = 0x00000008; |
| 445 | 444 | /// timeout is absolute |
| 446 | 445 | pub const NOTE_ABSTIME = 0x00000010; |
| 447 | 446 | |
| 448 | ||
| 449 | ||
| 450 | 447 | pub const TCGETS = 0x5401; |
| 451 | 448 | pub const TCSETS = 0x5402; |
| 452 | 449 | pub const TCSETSW = 0x5403; |
| ... | ... | @@ -528,7 +525,7 @@ pub fn WIFSIGNALED(s: i32) bool { |
| 528 | 525 | return (unsigned(s) & 0xffff) -% 1 < 0xff; |
| 529 | 526 | } |
| 530 | 527 | |
| 531 | pub const winsize = extern struct.{ | |
| 528 | pub const winsize = extern struct { | |
| 532 | 529 | ws_row: u16, |
| 533 | 530 | ws_col: u16, |
| 534 | 531 | ws_xpixel: u16, |
| ... | ... | @@ -703,11 +700,11 @@ pub fn sigaction(sig: u6, noalias act: *const Sigaction, noalias oact: ?*Sigacti |
| 703 | 700 | |
| 704 | 701 | const NSIG = 65; |
| 705 | 702 | const sigset_t = [128 / @sizeOf(usize)]usize; |
| 706 | const all_mask = []usize.{@maxValue(usize)}; | |
| 707 | const app_mask = []usize.{0xfffffffc7fffffff}; | |
| 703 | const all_mask = []usize{@maxValue(usize)}; | |
| 704 | const app_mask = []usize{0xfffffffc7fffffff}; | |
| 708 | 705 | |
| 709 | 706 | /// Renamed from `sigaction` to `Sigaction` to avoid conflict with the syscall. |
| 710 | pub const Sigaction = struct.{ | |
| 707 | pub const Sigaction = struct { | |
| 711 | 708 | // TODO: Adjust to use freebsd struct layout |
| 712 | 709 | handler: extern fn (i32) void, |
| 713 | 710 | mask: sigset_t, |
| ... | ... | @@ -717,7 +714,7 @@ pub const Sigaction = struct.{ |
| 717 | 714 | pub const SIG_ERR = @intToPtr(extern fn (i32) void, @maxValue(usize)); |
| 718 | 715 | pub const SIG_DFL = @intToPtr(extern fn (i32) void, 0); |
| 719 | 716 | pub const SIG_IGN = @intToPtr(extern fn (i32) void, 1); |
| 720 | pub const empty_sigset = []usize.{0} ** sigset_t.len; | |
| 717 | pub const empty_sigset = []usize{0} ** sigset_t.len; | |
| 721 | 718 | |
| 722 | 719 | pub fn raise(sig: i32) usize { |
| 723 | 720 | // TODO implement, see linux equivalent for what we want to try and do |
| ... | ... | @@ -753,12 +750,12 @@ pub fn fstat(fd: i32, stat_buf: *Stat) usize { |
| 753 | 750 | return arch.syscall2(SYS_fstat, @intCast(usize, fd), @ptrToInt(stat_buf)); |
| 754 | 751 | } |
| 755 | 752 | |
| 756 | pub const iovec = extern struct.{ | |
| 753 | pub const iovec = extern struct { | |
| 757 | 754 | iov_base: [*]u8, |
| 758 | 755 | iov_len: usize, |
| 759 | 756 | }; |
| 760 | 757 | |
| 761 | pub const iovec_const = extern struct.{ | |
| 758 | pub const iovec_const = extern struct { | |
| 762 | 759 | iov_base: [*]const u8, |
| 763 | 760 | iov_len: usize, |
| 764 | 761 | }; |
| ... | ... | @@ -790,13 +787,9 @@ pub fn sysctlnametomib(name: [*]const u8, mibp: ?*c_int, sizep: ?*usize) usize { |
| 790 | 787 | return errnoWrap(c.sysctlnametomib(name, wibp, sizep)); |
| 791 | 788 | } |
| 792 | 789 | |
| 793 | ||
| 794 | ||
| 795 | 790 | /// Takes the return value from a syscall and formats it back in the way |
| 796 | 791 | /// that the kernel represents it to libc. Errno was a mistake, let's make |
| 797 | 792 | /// it go away forever. |
| 798 | 793 | fn errnoWrap(value: isize) usize { |
| 799 | 794 | return @bitCast(usize, if (value == -1) -isize(c._errno().*) else value); |
| 800 | 795 | } |
| 801 | ||
| 802 |
std/os/freebsd/x86_64.zig+3-3| ... | ... | @@ -97,7 +97,7 @@ pub nakedcc fn restore_rt() void { |
| 97 | 97 | ); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | pub const msghdr = extern struct.{ | |
| 100 | pub const msghdr = extern struct { | |
| 101 | 101 | msg_name: &u8, |
| 102 | 102 | msg_namelen: socklen_t, |
| 103 | 103 | msg_iov: &iovec, |
| ... | ... | @@ -110,7 +110,7 @@ pub const msghdr = extern struct.{ |
| 110 | 110 | }; |
| 111 | 111 | |
| 112 | 112 | /// Renamed to Stat to not conflict with the stat function. |
| 113 | pub const Stat = extern struct.{ | |
| 113 | pub const Stat = extern struct { | |
| 114 | 114 | dev: u64, |
| 115 | 115 | ino: u64, |
| 116 | 116 | nlink: usize, |
| ... | ... | @@ -130,7 +130,7 @@ pub const Stat = extern struct.{ |
| 130 | 130 | __unused: [3]isize, |
| 131 | 131 | }; |
| 132 | 132 | |
| 133 | pub const timespec = extern struct.{ | |
| 133 | pub const timespec = extern struct { | |
| 134 | 134 | tv_sec: isize, |
| 135 | 135 | tv_nsec: isize, |
| 136 | 136 | }; |
std/special/bootstrap.zig+1-1| ... | ... | @@ -23,7 +23,7 @@ nakedcc fn _start() noreturn { |
| 23 | 23 | builtin.Arch.x86_64 => switch (builtin.os) { |
| 24 | 24 | builtin.Os.freebsd => { |
| 25 | 25 | argc_ptr = asm ("lea (%%rdi), %[argc]" |
| 26 | : [argc] "=r" (-> [*]usize) | |
| 26 | : [argc] "=r" (-> [*]usize) | |
| 27 | 27 | ); |
| 28 | 28 | }, |
| 29 | 29 | else => { |