summaryrefslogtreecommitdiffstats
path: root/darwin
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2023-02-05 02:53:28 +0100
committercgzones <cgzones@googlemail.com>2023-02-19 17:56:50 +0100
commit3b6019725defb5b5f516d1abd61906c2398d4bfa (patch)
treefc1ad5b2e6bce65a3e6245c10da1dfb617db9067 /darwin
parent7a8c01f304b673dd89923e05d242aebb9cd0a500 (diff)
Implement File Descriptor Meter support for Darwin
Diffstat (limited to 'darwin')
-rw-r--r--darwin/Platform.c7
-rw-r--r--darwin/Platform.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/darwin/Platform.c b/darwin/Platform.c
index 332752b2..27bce551 100644
--- a/darwin/Platform.c
+++ b/darwin/Platform.c
@@ -24,6 +24,7 @@ in the source distribution for its full text.
#include "CRT.h"
#include "DateMeter.h"
#include "DateTimeMeter.h"
+#include "FileDescriptorMeter.h"
#include "HostnameMeter.h"
#include "LoadAverageMeter.h"
#include "Macros.h"
@@ -36,6 +37,7 @@ in the source distribution for its full text.
#include "UptimeMeter.h"
#include "darwin/DarwinProcessList.h"
#include "darwin/PlatformHelpers.h"
+#include "generic/fdstat_sysctl.h"
#include "zfs/ZfsArcMeter.h"
#include "zfs/ZfsCompressedArcMeter.h"
@@ -126,6 +128,7 @@ const MeterClass* const Platform_meterTypes[] = {
&RightCPUs8Meter_class,
&ZfsArcMeter_class,
&ZfsCompressedArcMeter_class,
+ &FileDescriptorMeter_class,
&BlankMeter_class,
NULL
};
@@ -349,6 +352,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) {
// TODO
(void)data;
diff --git a/darwin/Platform.h b/darwin/Platform.h
index 66362072..5cd67297 100644
--- a/darwin/Platform.h
+++ b/darwin/Platform.h
@@ -70,6 +70,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