std: Add serenity to more OS checks

This commit is contained in:
Linus Groh 2025-07-30 23:28:58 +01:00
parent 813a0f125e
commit ce776d3245
4 changed files with 5 additions and 2 deletions

View File

@ -1548,6 +1548,7 @@ const have_sigwinch = switch (builtin.os.tag) {
.visionos,
.dragonfly,
.freebsd,
.serenity,
=> true,
else => false,

View File

@ -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,
};

View File

@ -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) {

View File

@ -699,6 +699,7 @@ fn maybeIgnoreSigpipe() void {
.visionos,
.dragonfly,
.freebsd,
.serenity,
=> true,
else => false,