From 3b6019725defb5b5f516d1abd61906c2398d4bfa Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Sun, 5 Feb 2023 02:53:28 +0100 Subject: Implement File Descriptor Meter support for Darwin --- darwin/Platform.c | 7 +++++++ darwin/Platform.h | 2 ++ 2 files changed, 9 insertions(+) (limited to 'darwin') 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); -- cgit v1.2.3