commit d370005d344507fc7ca548dcf488d29d3faad865 (tree)
parent 9e0a34f329caec5711e1a1492ff7c78caf5da10b
Author: Kitty-Cricket Piapiac <kitty@piapiac.org>
Date: Mon, 31 Jul 2023 22:10:42 -0700
std.process.totalSystemMemory: return correct error type on FreeBSD
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/std/process.zig b/lib/std/process.zig
@@ -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));
},