summaryrefslogtreecommitdiffstats
path: root/openbsd
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2021-03-01 11:55:15 +1100
committerNathan Scott <nathans@redhat.com>2021-03-01 11:55:15 +1100
commit2d1839289eca016893b898dc713cbf1a1df92fc1 (patch)
tree70990056703220405da20a7c97e66e3d53dff59c /openbsd
parent379421d3b2a5a1cf718b555663ec873ef7ea90d8 (diff)
Fix integer sizing issues in the NetworkIO Meter
On Linux kernels the size of the values exported for network device bytes and packets has used a 64 bit integer for quite some time (2.6+ IIRC). Make the procfs value extraction use correct types and change internal types used to rate convert these counters (within the NetworkIO Meter) 64 bit integers, where appropriate.
Diffstat (limited to 'openbsd')
-rw-r--r--openbsd/Platform.c10
-rw-r--r--openbsd/Platform.h6
2 files changed, 4 insertions, 12 deletions
diff --git a/openbsd/Platform.c b/openbsd/Platform.c
index a50aa345..606869a5 100644
--- a/openbsd/Platform.c
+++ b/openbsd/Platform.c
@@ -283,15 +283,9 @@ bool Platform_getDiskIO(DiskIOData* data) {
return false;
}
-bool Platform_getNetworkIO(unsigned long int* bytesReceived,
- unsigned long int* packetsReceived,
- unsigned long int* bytesTransmitted,
- unsigned long int* packetsTransmitted) {
+bool Platform_getNetworkIO(NetworkIOData* data) {
// TODO
- *bytesReceived = 0;
- *packetsReceived = 0;
- *bytesTransmitted = 0;
- *packetsTransmitted = 0;
+ (void)data;
return false;
}
diff --git a/openbsd/Platform.h b/openbsd/Platform.h
index e7a59662..66b804de 100644
--- a/openbsd/Platform.h
+++ b/openbsd/Platform.h
@@ -15,6 +15,7 @@ in the source distribution for its full text.
#include "BatteryMeter.h"
#include "DiskIOMeter.h"
#include "Meter.h"
+#include "NetworkIOMeter.h"
#include "Process.h"
#include "ProcessLocksScreen.h"
#include "SignalsPanel.h"
@@ -55,10 +56,7 @@ FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid);
bool Platform_getDiskIO(DiskIOData* data);
-bool Platform_getNetworkIO(unsigned long int* bytesReceived,
- unsigned long int* packetsReceived,
- unsigned long int* bytesTransmitted,
- unsigned long int* packetsTransmitted);
+bool Platform_getNetworkIO(NetworkIOData* data);
void Platform_getBattery(double* percent, ACPresence* isOnAC);

© 2014-2024 Faster IT GmbH | imprint | privacy policy