From ce776d32455f5ac43f91cc8904765836c00605cf Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 30 Jul 2025 23:28:58 +0100 Subject: [PATCH] std: Add serenity to more OS checks --- lib/std/Progress.zig | 1 + lib/std/heap.zig | 2 +- lib/std/posix.zig | 3 ++- lib/std/start.zig | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/std/Progress.zig b/lib/std/Progress.zig index 2806c1a09c..8b741187e7 100644 --- a/lib/std/Progress.zig +++ b/lib/std/Progress.zig @@ -1548,6 +1548,7 @@ const have_sigwinch = switch (builtin.os.tag) { .visionos, .dragonfly, .freebsd, + .serenity, => true, else => false, diff --git a/lib/std/heap.zig b/lib/std/heap.zig index 51e4fe44a2..a39cf5e1cb 100644 --- a/lib/std/heap.zig +++ b/lib/std/heap.zig @@ -146,7 +146,7 @@ const CAllocator = struct { else {}; pub const supports_posix_memalign = switch (builtin.os.tag) { - .dragonfly, .netbsd, .freebsd, .solaris, .openbsd, .linux, .macos, .ios, .tvos, .watchos, .visionos => true, + .dragonfly, .netbsd, .freebsd, .solaris, .openbsd, .linux, .macos, .ios, .tvos, .watchos, .visionos, .serenity => true, else => false, }; diff --git a/lib/std/posix.zig b/lib/std/posix.zig index e10023f6b1..fefb57de1c 100644 --- a/lib/std/posix.zig +++ b/lib/std/posix.zig @@ -1129,8 +1129,9 @@ pub fn ftruncate(fd: fd_t, length: u64) TruncateError!void { /// * Windows /// On these systems, the read races with concurrent writes to the same file descriptor. pub fn preadv(fd: fd_t, iov: []const iovec, offset: u64) PReadError!usize { + // NOTE: serenity does not have preadv but it *does* have pwritev. const have_pread_but_not_preadv = switch (native_os) { - .windows, .macos, .ios, .watchos, .tvos, .visionos, .haiku => true, + .windows, .macos, .ios, .watchos, .tvos, .visionos, .haiku, .serenity => true, else => false, }; if (have_pread_but_not_preadv) { diff --git a/lib/std/start.zig b/lib/std/start.zig index f889885c84..30543ead8a 100644 --- a/lib/std/start.zig +++ b/lib/std/start.zig @@ -699,6 +699,7 @@ fn maybeIgnoreSigpipe() void { .visionos, .dragonfly, .freebsd, + .serenity, => true, else => false,