authorgravatar for kitty@piapiac.orgKitty-Cricket Piapiac <kitty@piapiac.org> 2023-07-31 22:10:42-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-08-01 19:27:04-07:00
logd370005d344507fc7ca548dcf488d29d3faad865
tree384ddbe354a7b1a67c5763298ec512ba40c63ed6
parent9e0a34f329caec5711e1a1492ff7c78caf5da10b

std.process.totalSystemMemory: return correct error type on FreeBSD


1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/process.zig+1-1
...@@ -1168,7 +1168,7 @@ pub fn totalSystemMemory() TotalSystemMemoryError!usize {...@@ -1168,7 +1168,7 @@ pub fn totalSystemMemory() TotalSystemMemoryError!usize {
1168 var len: usize = @sizeOf(c_ulong);1168 var len: usize = @sizeOf(c_ulong);
1169 os.sysctlbynameZ("hw.physmem", &physmem, &len, null, 0) catch |err| switch (err) {1169 os.sysctlbynameZ("hw.physmem", &physmem, &len, null, 0) catch |err| switch (err) {
1170 error.NameTooLong, error.UnknownName => unreachable,1170 error.NameTooLong, error.UnknownName => unreachable,
1171 else => |e| return e,1171 else => return error.UnknownTotalSystemMemory,
1172 };1172 };
1173 return @as(usize, @intCast(physmem));1173 return @as(usize, @intCast(physmem));
1174 },1174 },