authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-06-10 17:54:19+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-06-10 17:54:19+02:00
log6810ffa424fccae0ecbf2f9e3db80069d8e7543b
tree1c975b3c85032c7ea5e3ea8c876aaed71edebd35
parent4d79806459618f1830772ed6dfbb82059589aaa4
parent7f7318700427875d5b0ec2f8601c12e5bc21cebe
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #24031 from ypsvlq/master

Haiku fixes

6 files changed, 18 insertions(+), 5 deletions(-)

lib/compiler/build_runner.zig+4-1
......@@ -415,7 +415,7 @@ pub fn main() !void {
415415 else => return err,
416416 };
417417
418 var w = if (watch) try Watch.init() else undefined;
418 var w: Watch = if (watch and Watch.have_impl) try Watch.init() else undefined;
419419
420420 try run.thread_pool.init(thread_pool_options);
421421 defer run.thread_pool.deinit();
......@@ -435,6 +435,9 @@ pub fn main() !void {
435435 else => return err,
436436 };
437437 if (fuzz) {
438 if (builtin.single_threaded) {
439 fatal("--fuzz not yet implemented for single-threaded builds", .{});
440 }
438441 switch (builtin.os.tag) {
439442 // Current implementation depends on two things that need to be ported to Windows:
440443 // * Memory-mapping to share data between the fuzzer and build runner.
lib/std/Build/Watch.zig+1-1
......@@ -600,7 +600,7 @@ const Os = switch (builtin.os.tag) {
600600 };
601601 }
602602 },
603 .dragonfly, .freebsd, .netbsd, .openbsd, .ios, .macos, .tvos, .visionos, .watchos, .haiku => struct {
603 .dragonfly, .freebsd, .netbsd, .openbsd, .ios, .macos, .tvos, .visionos, .watchos => struct {
604604 const posix = std.posix;
605605
606606 kq_fd: i32,
lib/std/c.zig+5-2
......@@ -5703,6 +5703,9 @@ pub const SOCK = switch (native_os) {
57035703 pub const RAW = 3;
57045704 pub const SEQPACKET = 5;
57055705 pub const MISC = 255;
5706
5707 pub const NONBLOCK = 0x40000;
5708 pub const CLOEXEC = 0x80000;
57065709 },
57075710 .openbsd => struct {
57085711 pub const STREAM = 1;
......@@ -10824,8 +10827,8 @@ pub const LC = enum(c_int) {
1082410827
1082510828pub extern "c" fn setlocale(category: LC, locale: ?[*:0]const u8) ?[*:0]const u8;
1082610829
10827pub const getcontext = if (builtin.target.abi.isAndroid() or builtin.target.os.tag == .openbsd)
10828{} // android bionic and openbsd libc does not implement getcontext
10830pub const getcontext = if (builtin.target.abi.isAndroid() or builtin.target.os.tag == .openbsd or builtin.target.os.tag == .haiku)
10831{} // libc does not implement getcontext
1082910832 else if (native_os == .linux and builtin.target.abi.isMusl())
1083010833 linux.getcontext
1083110834 else
lib/std/c/haiku.zig+5
......@@ -23,6 +23,11 @@ pub extern "root" fn get_system_info(system_info: *system_info) usize;
2323pub extern "root" fn _get_team_info(team: i32, team_info: *team_info, size: usize) i32;
2424pub extern "root" fn _get_next_area_info(team: i32, cookie: *i64, area_info: *area_info, size: usize) i32;
2525pub extern "root" fn _get_next_image_info(team: i32, cookie: *i32, image_info: *image_info, size: usize) i32;
26pub extern "root" fn _kern_get_current_team() team_id;
27pub extern "root" fn _kern_open_dir(fd: fd_t, path: [*:0]const u8) fd_t;
28pub extern "root" fn _kern_read_dir(fd: fd_t, buffer: [*]u8, bufferSize: usize, maxCount: u32) isize;
29pub extern "root" fn _kern_rewind_dir(fd: fd_t) status_t;
30pub extern "root" fn _kern_read_stat(fd: fd_t, path: [*:0]const u8, traverseLink: bool, stat: *std.c.Stat, statSize: usize) status_t;
2631
2732pub const area_info = extern struct {
2833 area: u32,
lib/std/crypto/Certificate/Bundle.zig+1
......@@ -64,6 +64,7 @@ pub fn rescan(cb: *Bundle, gpa: Allocator) RescanError!void {
6464 .netbsd => return rescanWithPath(cb, gpa, "/etc/openssl/certs/ca-certificates.crt"),
6565 .dragonfly => return rescanWithPath(cb, gpa, "/usr/local/etc/ssl/cert.pem"),
6666 .solaris, .illumos => return rescanWithPath(cb, gpa, "/etc/ssl/cacert.pem"),
67 .haiku => return rescanWithPath(cb, gpa, "/boot/system/data/ssl/CARootCertificates.pem"),
6768 // https://github.com/SerenityOS/serenity/blob/222acc9d389bc6b490d4c39539761b043a4bfcb0/Ports/ca-certificates/package.sh#L19
6869 .serenity => return rescanWithPath(cb, gpa, "/etc/ssl/certs/ca-certificates.crt"),
6970 .windows => return rescanWindows(cb, gpa),
lib/std/fs/Dir.zig+2-1
......@@ -13,6 +13,7 @@ pub const Entry = struct {
1313
1414const IteratorError = error{
1515 AccessDenied,
16 PermissionDenied,
1617 SystemResources,
1718 /// WASI-only. The path of an entry could not be encoded as valid UTF-8.
1819 /// 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) {
287288 name,
288289 false,
289290 &stat_info,
290 0,
291 @sizeOf(posix.Stat),
291292 )))) {
292293 .SUCCESS => {},
293294 .INVAL => unreachable,