mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 07:32:44 +00:00
std.process.totalSystemMemory: return correct error type on FreeBSD
This commit is contained in:
parent
9e0a34f329
commit
d370005d34
@ -1168,7 +1168,7 @@ pub fn totalSystemMemory() TotalSystemMemoryError!usize {
|
||||
var len: usize = @sizeOf(c_ulong);
|
||||
os.sysctlbynameZ("hw.physmem", &physmem, &len, null, 0) catch |err| switch (err) {
|
||||
error.NameTooLong, error.UnknownName => unreachable,
|
||||
else => |e| return e,
|
||||
else => return error.UnknownTotalSystemMemory,
|
||||
};
|
||||
return @as(usize, @intCast(physmem));
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user