Commit ce776d3245

Linus Groh <mail@linusgroh.de>
2025-07-31 00:28:58
std: Add serenity to more OS checks
1 parent 813a0f1
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,
     };
 
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) {
lib/std/Progress.zig
@@ -1548,6 +1548,7 @@ const have_sigwinch = switch (builtin.os.tag) {
     .visionos,
     .dragonfly,
     .freebsd,
+    .serenity,
     => true,
 
     else => false,
lib/std/start.zig
@@ -699,6 +699,7 @@ fn maybeIgnoreSigpipe() void {
         .visionos,
         .dragonfly,
         .freebsd,
+        .serenity,
         => true,
 
         else => false,