authorgravatar for ypsvlq@gmail.comElaine Gibson <ypsvlq@gmail.com> 2026-04-14 12:01:14+01:00
committergravatar for ypsvlq@gmail.comElaine Gibson <ypsvlq@gmail.com> 2026-04-14 12:04:41+01:00
logc94ea1ea2da328ec7dcbd79f376d4283dddb79b7
tree03ef2c59bbf7511840eab7895257b05559fc166e
parentf0666586f609ff45457d9ee776cfd0604e8b5906

std.Io.Threaded: haiku fixes


1 files changed, 11 insertions(+), 5 deletions(-)

lib/std/Io/Threaded.zig+11-5
......@@ -5345,7 +5345,7 @@ fn dirOpenDirHaiku(
53455345 .NOMEM => return error.SystemResources,
53465346 .NOTDIR => return error.NotDir,
53475347 .PERM => return error.PermissionDenied,
5348 .BUSY => return error.DeviceBusy,
5348 .BUSY => |err| return errnoBug(err),
53495349 else => |err| return posix.unexpectedErrno(err),
53505350 }
53515351 },
......@@ -9812,7 +9812,10 @@ fn fileReadPositionalPosix(file: File, data: []const []u8, offset: u64) File.Rea
98129812 if (have_preadv) {
98139813 const syscall: Syscall = try .start();
98149814 while (true) {
9815 const rc = preadv_sym(file.handle, dest.ptr, @intCast(dest.len), @bitCast(offset));
9815 const rc = if (native_os == .haiku)
9816 posix.system.readv_pos(file.handle, @bitCast(offset), dest.ptr, @intCast(dest.len))
9817 else
9818 preadv_sym(file.handle, dest.ptr, @intCast(dest.len), @bitCast(offset));
98169819 switch (posix.errno(rc)) {
98179820 .SUCCESS => {
98189821 syscall.finish();
......@@ -9846,7 +9849,7 @@ fn fileReadPositionalPosix(file: File, data: []const []u8, offset: u64) File.Rea
98469849
98479850 const syscall: Syscall = try .start();
98489851 while (true) {
9849 const rc = posix.pread(file.handle, dest[0].ptr, @intCast(dest[0].len), @bitCast(offset));
9852 const rc = pread_sym(file.handle, dest[0].base, @intCast(dest[0].len), @bitCast(offset));
98509853 switch (posix.errno(rc)) {
98519854 .SUCCESS => {
98529855 syscall.finish();
......@@ -10550,7 +10553,10 @@ fn fileWritePositional(
1055010553
1055110554 const syscall: Syscall = try .start();
1055210555 while (true) {
10553 const rc = pwritev_sym(file.handle, &iovecs, @intCast(iovlen), @bitCast(offset));
10556 const rc = if (native_os == .haiku)
10557 posix.system.writev_pos(file.handle, @bitCast(offset), &iovecs, @intCast(iovlen))
10558 else
10559 pwritev_sym(file.handle, &iovecs, @intCast(iovlen), @bitCast(offset));
1055410560 switch (posix.errno(rc)) {
1055510561 .SUCCESS => {
1055610562 syscall.finish();
......@@ -14063,7 +14069,7 @@ pub fn posixSocketModeProtocol(family: posix.sa_family_t, mode: net.Socket.Mode,
1406314069 .dgram => posix.SOCK.DGRAM,
1406414070 .seqpacket => posix.SOCK.SEQPACKET,
1406514071 .raw => posix.SOCK.RAW,
14066 .rdm => posix.SOCK.RDM,
14072 .rdm => if (@hasDecl(posix.SOCK, "RDM")) posix.SOCK.RDM else return error.OptionUnsupported,
1406714073 },
1406814074 if (protocol) |p| @intFromEnum(p) else if (is_windows) switch (family) {
1406914075 posix.AF.UNIX => switch (mode) {