commit afdd04356cbf7821e1f992d1f3aedf7226a7e564 (tree)
parent bf9082518c32ce7d53d011777bf8d8056472cbf9
Author: Linus Groh <mail@linusgroh.de>
Date: Sat, 1 Nov 2025 11:32:35 +0100
std: serenity has preadv now
https://github.com/SerenityOS/serenity/commit/2a9154e77c61d79d4b96b5f957aca2d70325ac6d
Diffstat:
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig
@@ -356,7 +356,7 @@ pub fn ioBasic(t: *Threaded) Io {
};
}
-pub const socket_flags_unsupported = native_os.isDarwin() or native_os == .haiku; // 💩💩
+pub const socket_flags_unsupported = native_os.isDarwin() or native_os == .haiku;
const have_accept4 = !socket_flags_unsupported;
const have_flock_open_flags = @hasField(posix.O, "EXLOCK");
const have_networking = native_os != .wasi;
@@ -367,7 +367,7 @@ const have_futex = switch (builtin.cpu.arch) {
else => true,
};
const have_preadv = switch (native_os) {
- .windows, .haiku, .serenity => false, // 💩💩💩
+ .windows, .haiku => false,
else => true,
};
const have_sig_io = posix.SIG != void and @hasField(posix.SIG, "IO");
diff --git a/lib/std/posix.zig b/lib/std/posix.zig
@@ -1114,9 +1114,8 @@ 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, .serenity => true,
+ .windows, .macos, .ios, .watchos, .tvos, .visionos, .haiku => true,
else => false,
};
if (have_pread_but_not_preadv) {