summaryrefslogtreecommitdiffstats
path: root/freebsd
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2023-02-05 02:40:42 +0100
committercgzones <cgzones@googlemail.com>2023-02-19 17:56:50 +0100
commit7a8c01f304b673dd89923e05d242aebb9cd0a500 (patch)
treec9b21f30b3acf18f6ca8e4b1b404015ca3c2ba9a /freebsd
parent377a06db0de3850573f2a8e2c33152cf3483ea61 (diff)
Implement File Descriptor Meter support for DragonflyBSD/FreeBSD/NetBSD
Diffstat (limited to 'freebsd')
-rw-r--r--freebsd/Platform.c7
-rw-r--r--freebsd/Platform.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/freebsd/Platform.c b/freebsd/Platform.c
index 646163af..061de70b 100644
--- a/freebsd/Platform.c
+++ b/freebsd/Platform.c
@@ -31,6 +31,7 @@ in the source distribution for its full text.
#include "DateMeter.h"
#include "DateTimeMeter.h"
#include "DiskIOMeter.h"
+#include "FileDescriptorMeter.h"
#include "HostnameMeter.h"
#include "LoadAverageMeter.h"
#include "Macros.h"
@@ -47,6 +48,7 @@ in the source distribution for its full text.
#include "XUtils.h"
#include "freebsd/FreeBSDProcess.h"
#include "freebsd/FreeBSDProcessList.h"
+#include "generic/fdstat_sysctl.h"
#include "zfs/ZfsArcMeter.h"
#include "zfs/ZfsCompressedArcMeter.h"
@@ -130,6 +132,7 @@ const MeterClass* const Platform_meterTypes[] = {
&ZfsArcMeter_class,
&ZfsCompressedArcMeter_class,
&DiskIOMeter_class,
+ &FileDescriptorMeter_class,
&NetworkIOMeter_class,
NULL
};
@@ -292,6 +295,10 @@ FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) {
return NULL;
}
+void Platform_getFileDescriptors(double* used, double* max) {
+ Generic_getFileDescriptors_sysctl(used, max);
+}
+
bool Platform_getDiskIO(DiskIOData* data) {
if (devstat_checkversion(NULL) < 0)
diff --git a/freebsd/Platform.h b/freebsd/Platform.h
index 51269c09..849f7ddf 100644
--- a/freebsd/Platform.h
+++ b/freebsd/Platform.h
@@ -61,6 +61,8 @@ char* Platform_getProcessEnv(pid_t pid);
FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid);
+void Platform_getFileDescriptors(double* used, double* max);
+
bool Platform_getDiskIO(DiskIOData* data);
bool Platform_getNetworkIO(NetworkIOData* data);

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