diff options
author | Benny Baumann <BenBE@geshi.org> | 2023-02-05 02:40:42 +0100 |
---|---|---|
committer | cgzones <cgzones@googlemail.com> | 2023-02-19 17:56:50 +0100 |
commit | 7a8c01f304b673dd89923e05d242aebb9cd0a500 (patch) | |
tree | c9b21f30b3acf18f6ca8e4b1b404015ca3c2ba9a /dragonflybsd | |
parent | 377a06db0de3850573f2a8e2c33152cf3483ea61 (diff) |
Implement File Descriptor Meter support for DragonflyBSD/FreeBSD/NetBSD
Diffstat (limited to 'dragonflybsd')
-rw-r--r-- | dragonflybsd/Platform.c | 8 | ||||
-rw-r--r-- | dragonflybsd/Platform.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/dragonflybsd/Platform.c b/dragonflybsd/Platform.c index 8a684d86..277f1876 100644 --- a/dragonflybsd/Platform.c +++ b/dragonflybsd/Platform.c @@ -20,6 +20,7 @@ in the source distribution for its full text. #include "CPUMeter.h" #include "DateMeter.h" #include "DateTimeMeter.h" +#include "FileDescriptorMeter.h" #include "HostnameMeter.h" #include "LoadAverageMeter.h" #include "MemoryMeter.h" @@ -31,6 +32,8 @@ in the source distribution for its full text. #include "UptimeMeter.h" #include "dragonflybsd/DragonFlyBSDProcess.h" #include "dragonflybsd/DragonFlyBSDProcessList.h" +#include "generic/fdstat_sysctl.h" + const ScreenDefaults Platform_defaultScreens[] = { { @@ -108,6 +111,7 @@ const MeterClass* const Platform_meterTypes[] = { &RightCPUs4Meter_class, &LeftCPUs8Meter_class, &RightCPUs8Meter_class, + &FileDescriptorMeter_class, &BlankMeter_class, NULL }; @@ -233,6 +237,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/dragonflybsd/Platform.h b/dragonflybsd/Platform.h index cf693562..b37cea2a 100644 --- a/dragonflybsd/Platform.h +++ b/dragonflybsd/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); |