diff options
| author | Al Hoang <3811822-hoanga@users.noreply.gitlab.com> | 2021-10-31 21:27:04 -0500 |
|---|---|---|
| committer | Al Hoang <3811822-hoanga@users.noreply.gitlab.com> | 2021-11-15 00:29:26 -0600 |
| commit | 426f54026bed049cfd40839a8b432c2892fc8212 (patch) | |
| tree | 3ffd079e7fbed9099db68753afe6182e9a1e488b /lib/std/Thread.zig | |
| parent | b875f79dd8807fee1aec8bf443b43ec4f3b53fa9 (diff) | |
| download | zig-426f54026bed049cfd40839a8b432c2892fc8212.tar.gz zig-426f54026bed049cfd40839a8b432c2892fc8212.zip | |
updates for haiku stdc
* add team_info, area_info
* update signature for get_next_image_info
* add error checks for haiku system calls
* update and cleanup of haiku constants
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; |
