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 /netbsd | |
parent | 377a06db0de3850573f2a8e2c33152cf3483ea61 (diff) |
Implement File Descriptor Meter support for DragonflyBSD/FreeBSD/NetBSD
Diffstat (limited to 'netbsd')
-rw-r--r-- | netbsd/Platform.c | 7 | ||||
-rw-r--r-- | netbsd/Platform.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/netbsd/Platform.c b/netbsd/Platform.c index ad6050c0..c5c42d0a 100644 --- a/netbsd/Platform.c +++ b/netbsd/Platform.c @@ -38,6 +38,7 @@ in the source distribution for its full text. #include "ClockMeter.h" #include "DateMeter.h" #include "DateTimeMeter.h" +#include "FileDescriptorMeter.h" #include "HostnameMeter.h" #include "LoadAverageMeter.h" #include "Macros.h" @@ -52,6 +53,7 @@ in the source distribution for its full text. #include "TasksMeter.h" #include "UptimeMeter.h" #include "XUtils.h" +#include "generic/fdstat_sysctl.h" #include "netbsd/NetBSDProcess.h" #include "netbsd/NetBSDProcessList.h" @@ -179,6 +181,7 @@ const MeterClass* const Platform_meterTypes[] = { &BlankMeter_class, &DiskIOMeter_class, &NetworkIOMeter_class, + &FileDescriptorMeter_class, NULL }; @@ -343,6 +346,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) { const int mib[] = { CTL_HW, HW_IOSTATS, sizeof(struct io_sysctl) }; struct io_sysctl* iostats = NULL; diff --git a/netbsd/Platform.h b/netbsd/Platform.h index 0e53b457..a75c766c 100644 --- a/netbsd/Platform.h +++ b/netbsd/Platform.h @@ -67,6 +67,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); |