aboutsummaryrefslogtreecommitdiffstats
path: root/openbsd/OpenBSDProcessList.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2020-09-15 08:00:01 +0200
committerDaniel Lange <DLange@git.local>2020-09-15 08:00:01 +0200
commit8e8165109aca4e3c2a8558653df088d674061c78 (patch)
treed68c91ced3a78c65be9ae262ea84676e73cac68d /openbsd/OpenBSDProcessList.c
parente9302ddfaeaad62b12bdd352958fb194a26f3c74 (diff)
parentf80394a20254938142011855f2954b3f63fe5909 (diff)
downloaddebian_htop-8e8165109aca4e3c2a8558653df088d674061c78.tar.gz
debian_htop-8e8165109aca4e3c2a8558653df088d674061c78.tar.bz2
debian_htop-8e8165109aca4e3c2a8558653df088d674061c78.zip
Update upstream source from tag 'upstream/3.0.2'
Update to upstream version '3.0.2' with Debian dir 26e1b8d7612e50e81b8325506c1ce54f71cba270
Diffstat (limited to 'openbsd/OpenBSDProcessList.c')
-rw-r--r--openbsd/OpenBSDProcessList.c53
1 files changed, 2 insertions, 51 deletions
diff --git a/openbsd/OpenBSDProcessList.c b/openbsd/OpenBSDProcessList.c
index ea40fe1..c5d79f5 100644
--- a/openbsd/OpenBSDProcessList.c
+++ b/openbsd/OpenBSDProcessList.c
@@ -27,58 +27,9 @@ in the source distribution for its full text.
#include <string.h>
#include <unistd.h>
-/*{
-
-#include <kvm.h>
-
-typedef struct CPUData_ {
- unsigned long long int totalTime;
- unsigned long long int userTime;
- unsigned long long int niceTime;
- unsigned long long int sysTime;
- unsigned long long int sysAllTime;
- unsigned long long int spinTime;
- unsigned long long int intrTime;
- unsigned long long int idleTime;
-
- unsigned long long int totalPeriod;
- unsigned long long int userPeriod;
- unsigned long long int nicePeriod;
- unsigned long long int sysPeriod;
- unsigned long long int sysAllPeriod;
- unsigned long long int spinPeriod;
- unsigned long long int intrPeriod;
- unsigned long long int idlePeriod;
-} CPUData;
-
-typedef struct OpenBSDProcessList_ {
- ProcessList super;
- kvm_t* kd;
-
- CPUData* cpus;
-
-} OpenBSDProcessList;
-
-}*/
-
-/*
- * avoid relying on or conflicting with MIN() and MAX() in sys/param.h
- */
-#ifndef MINIMUM
-#define MINIMUM(x, y) ((x) > (y) ? (y) : (x))
-#endif
-
-#ifndef MAXIMUM
-#define MAXIMUM(x, y) ((x) > (y) ? (x) : (y))
-#endif
-
-#ifndef CLAMP
-#define CLAMP(x, low, high) (((x) > (high)) ? (high) : MAXIMUM(x, low))
-#endif
-
static long fscale;
-ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) {
+ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId) {
int mib[] = { CTL_HW, HW_NCPU };
int fmib[] = { CTL_KERN, KERN_FSCALE };
int i, e;
@@ -90,7 +41,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, ui
opl = xCalloc(1, sizeof(OpenBSDProcessList));
pl = (ProcessList*) opl;
size = sizeof(pl->cpuCount);
- ProcessList_init(pl, Class(OpenBSDProcess), usersTable, pidWhiteList, userId);
+ ProcessList_init(pl, Class(OpenBSDProcess), usersTable, pidMatchList, userId);
e = sysctl(mib, 2, &pl->cpuCount, &size, NULL, 0);
if (e == -1 || pl->cpuCount < 1) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy