diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-11-24 18:42:30 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-24 18:42:30 -0800 |
| commit | 36c8adf58922d8e357bbaf7ce914cfd4b7b56354 (patch) | |
| tree | d2be6015196ab16e6029304b032df1468fb69973 /lib/std/Thread.zig | |
| parent | e266ede6e310b64adcf3912b8ef2b9e2397fde7b (diff) | |
| parent | be541ca5e102614c8d86b86affcda44df828d8fb (diff) | |
| download | zig-36c8adf58922d8e357bbaf7ce914cfd4b7b56354.tar.gz zig-36c8adf58922d8e357bbaf7ce914cfd4b7b56354.zip | |
Merge pull request #10073 from hoanga/haiku-support-build2
more haiku support
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; |
