netbsd: Add dyanmicMeters stubs to fix the build

Signed-off-by: Nia Alarie <nia@NetBSD.org>
This commit is contained in:
nia 2021-07-13 17:46:04 +02:00 committed by BenBE
parent e7aaf79166
commit 67ca214cbe
3 changed files with 11 additions and 3 deletions

View File

@ -38,7 +38,7 @@ static long fscale;
static int pageSize; static int pageSize;
static int pageSizeKB; static int pageSizeKB;
ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId) { ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* pidMatchList, uid_t userId) {
const int mib[] = { CTL_HW, HW_NCPU }; const int mib[] = { CTL_HW, HW_NCPU };
const int fmib[] = { CTL_KERN, KERN_FSCALE }; const int fmib[] = { CTL_KERN, KERN_FSCALE };
int r; int r;
@ -47,7 +47,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, ui
NetBSDProcessList* npl = xCalloc(1, sizeof(NetBSDProcessList)); NetBSDProcessList* npl = xCalloc(1, sizeof(NetBSDProcessList));
ProcessList* pl = (ProcessList*) npl; ProcessList* pl = (ProcessList*) npl;
ProcessList_init(pl, Class(NetBSDProcess), usersTable, pidMatchList, userId); ProcessList_init(pl, Class(NetBSDProcess), usersTable, dynamicMeters, pidMatchList, userId);
size = sizeof(pl->cpuCount); size = sizeof(pl->cpuCount);
r = sysctl(mib, 2, &pl->cpuCount, &size, NULL, 0); r = sysctl(mib, 2, &pl->cpuCount, &size, NULL, 0);

View File

@ -47,7 +47,7 @@ typedef struct NetBSDProcessList_ {
} NetBSDProcessList; } NetBSDProcessList;
ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId); ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* pidMatchList, uid_t userId);
void ProcessList_delete(ProcessList* this); void ProcessList_delete(ProcessList* this);

View File

@ -94,4 +94,12 @@ static inline void Platform_gettime_monotonic(uint64_t* msec) {
Generic_gettime_monotonic(msec); Generic_gettime_monotonic(msec);
} }
static inline Hashtable* Platform_dynamicMeters(void) { return NULL; }
static inline void Platform_dynamicMeterInit(ATTR_UNUSED Meter* meter) { }
static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* meter) { }
static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter* meter, ATTR_UNUSED RichString* out) { }
#endif #endif