diff options
Diffstat (limited to 'lib/std/Thread.zig')
| -rw-r--r-- | lib/std/Thread.zig | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig index 625255d411..13dc708dfc 100644 --- a/lib/std/Thread.zig +++ b/lib/std/Thread.zig @@ -577,11 +577,12 @@ const PosixThreadImpl = struct { }; }, .haiku => { - var count: u32 = undefined; - var system_info: os.system_info = undefined; - _ = os.system.get_system_info(&system_info); // always returns B_OK - count = system_info.cpu_count; - return @intCast(usize, count); + var system_info: os.system.system_info = undefined; + const rc = os.system.get_system_info(&system_info); // always returns B_OK + return switch (os.errno(rc)) { + .SUCCESS => @intCast(usize, system_info.cpu_count), + else => |err| os.unexpectedErrno(err), + }; }, else => { var count: c_int = undefined; |
