diff options
author | nia <nia@NetBSD.org> | 2021-08-09 14:11:56 +0200 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2021-08-09 14:17:06 +0200 |
commit | 6d3b4a0f2ef7f85cccc2b01db39d7eea2c10dd23 (patch) | |
tree | 01f7b69de7bd09237e03bbc3d4a6d3e99145222b /netbsd | |
parent | c31fd3c691019e438a2bfdbf1abe9bb895aefc83 (diff) |
netbsd: handle repeated ENOMEM from HW_IOSTATS safely
Diffstat (limited to 'netbsd')
-rw-r--r-- | netbsd/Platform.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/netbsd/Platform.c b/netbsd/Platform.c index c0783518..9d57b149 100644 --- a/netbsd/Platform.c +++ b/netbsd/Platform.c @@ -347,6 +347,8 @@ bool Platform_getDiskIO(DiskIOData* data) { iostats = xRealloc(iostats, size); + errno = 0; + if (sysctl(mib, __arraycount(mib), iostats, &size, NULL, 0) == 0) break; @@ -354,6 +356,9 @@ bool Platform_getDiskIO(DiskIOData* data) { CRT_fatalError("Unable to get disk IO statistics"); } + if (errno == ENOMEM) + CRT_fatalError("Unable to get disk IO statistics"); + uint64_t bytesReadSum = 0; uint64_t bytesWriteSum = 0; uint64_t busyTimeSum = 0; |