aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Thread.zig
diff options
context:
space:
mode:
authorAl Hoang <3811822-hoanga@users.noreply.gitlab.com>2021-10-31 21:27:04 -0500
committerAl Hoang <3811822-hoanga@users.noreply.gitlab.com>2021-11-15 00:29:26 -0600
commit426f54026bed049cfd40839a8b432c2892fc8212 (patch)
tree3ffd079e7fbed9099db68753afe6182e9a1e488b /lib/std/Thread.zig
parentb875f79dd8807fee1aec8bf443b43ec4f3b53fa9 (diff)
downloadzig-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.zig11
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;