diff --git a/lib/compiler/build_runner.zig b/lib/compiler/build_runner.zig index 1a019c80d968..d73fb6d29dc6 100644 --- a/lib/compiler/build_runner.zig +++ b/lib/compiler/build_runner.zig @@ -415,7 +415,7 @@ pub fn main() !void { else => return err, }; - var w = if (watch) try Watch.init() else undefined; + var w: Watch = if (watch and Watch.have_impl) try Watch.init() else undefined; try run.thread_pool.init(thread_pool_options); defer run.thread_pool.deinit(); @@ -435,6 +435,9 @@ pub fn main() !void { else => return err, }; if (fuzz) { + if (builtin.single_threaded) { + fatal("--fuzz not yet implemented for single-threaded builds", .{}); + } switch (builtin.os.tag) { // Current implementation depends on two things that need to be ported to Windows: // * Memory-mapping to share data between the fuzzer and build runner. diff --git a/lib/std/Build/Watch.zig b/lib/std/Build/Watch.zig index 13540a2b36cf..bae3af1f63bd 100644 --- a/lib/std/Build/Watch.zig +++ b/lib/std/Build/Watch.zig @@ -600,7 +600,7 @@ const Os = switch (builtin.os.tag) { }; } }, - .dragonfly, .freebsd, .netbsd, .openbsd, .ios, .macos, .tvos, .visionos, .watchos, .haiku => struct { + .dragonfly, .freebsd, .netbsd, .openbsd, .ios, .macos, .tvos, .visionos, .watchos => struct { const posix = std.posix; kq_fd: i32, diff --git a/lib/std/c.zig b/lib/std/c.zig index 25d45ae8a6f7..390d5f89c3cd 100644 --- a/lib/std/c.zig +++ b/lib/std/c.zig @@ -5703,6 +5703,9 @@ pub const SOCK = switch (native_os) { pub const RAW = 3; pub const SEQPACKET = 5; pub const MISC = 255; + + pub const NONBLOCK = 0x40000; + pub const CLOEXEC = 0x80000; }, .openbsd => struct { pub const STREAM = 1; @@ -10824,8 +10827,8 @@ pub const LC = enum(c_int) { pub extern "c" fn setlocale(category: LC, locale: ?[*:0]const u8) ?[*:0]const u8; -pub const getcontext = if (builtin.target.abi.isAndroid() or builtin.target.os.tag == .openbsd) -{} // android bionic and openbsd libc does not implement getcontext +pub const getcontext = if (builtin.target.abi.isAndroid() or builtin.target.os.tag == .openbsd or builtin.target.os.tag == .haiku) +{} // libc does not implement getcontext else if (native_os == .linux and builtin.target.abi.isMusl()) linux.getcontext else diff --git a/lib/std/c/haiku.zig b/lib/std/c/haiku.zig index a9877d07e3fc..bfac0cfa559b 100644 --- a/lib/std/c/haiku.zig +++ b/lib/std/c/haiku.zig @@ -23,6 +23,11 @@ pub extern "root" fn get_system_info(system_info: *system_info) usize; pub extern "root" fn _get_team_info(team: i32, team_info: *team_info, size: usize) i32; pub extern "root" fn _get_next_area_info(team: i32, cookie: *i64, area_info: *area_info, size: usize) i32; pub extern "root" fn _get_next_image_info(team: i32, cookie: *i32, image_info: *image_info, size: usize) i32; +pub extern "root" fn _kern_get_current_team() team_id; +pub extern "root" fn _kern_open_dir(fd: fd_t, path: [*:0]const u8) fd_t; +pub extern "root" fn _kern_read_dir(fd: fd_t, buffer: [*]u8, bufferSize: usize, maxCount: u32) isize; +pub extern "root" fn _kern_rewind_dir(fd: fd_t) status_t; +pub extern "root" fn _kern_read_stat(fd: fd_t, path: [*:0]const u8, traverseLink: bool, stat: *std.c.Stat, statSize: usize) status_t; pub const area_info = extern struct { area: u32, diff --git a/lib/std/crypto/Certificate/Bundle.zig b/lib/std/crypto/Certificate/Bundle.zig index a74eb44a9174..437f7a224c36 100644 --- a/lib/std/crypto/Certificate/Bundle.zig +++ b/lib/std/crypto/Certificate/Bundle.zig @@ -64,6 +64,7 @@ pub fn rescan(cb: *Bundle, gpa: Allocator) RescanError!void { .netbsd => return rescanWithPath(cb, gpa, "/etc/openssl/certs/ca-certificates.crt"), .dragonfly => return rescanWithPath(cb, gpa, "/usr/local/etc/ssl/cert.pem"), .solaris, .illumos => return rescanWithPath(cb, gpa, "/etc/ssl/cacert.pem"), + .haiku => return rescanWithPath(cb, gpa, "/boot/system/data/ssl/CARootCertificates.pem"), // https://github.com/SerenityOS/serenity/blob/222acc9d389bc6b490d4c39539761b043a4bfcb0/Ports/ca-certificates/package.sh#L19 .serenity => return rescanWithPath(cb, gpa, "/etc/ssl/certs/ca-certificates.crt"), .windows => return rescanWindows(cb, gpa), diff --git a/lib/std/fs/Dir.zig b/lib/std/fs/Dir.zig index 6075c8ca0fe1..90c46740ca25 100644 --- a/lib/std/fs/Dir.zig +++ b/lib/std/fs/Dir.zig @@ -13,6 +13,7 @@ pub const Entry = struct { const IteratorError = error{ AccessDenied, + PermissionDenied, SystemResources, /// WASI-only. The path of an entry could not be encoded as valid UTF-8. /// WASI is unable to handle paths that cannot be encoded as well-formed UTF-8. @@ -287,7 +288,7 @@ pub const Iterator = switch (native_os) { name, false, &stat_info, - 0, + @sizeOf(posix.Stat), )))) { .SUCCESS => {}, .INVAL => unreachable,