From f80394a20254938142011855f2954b3f63fe5909 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Tue, 15 Sep 2020 08:00:00 +0200 Subject: New upstream version 3.0.2 --- dragonflybsd/Battery.h | 2 -- dragonflybsd/DragonFlyBSDCRT.h | 6 ---- dragonflybsd/DragonFlyBSDProcess.c | 28 ------------------ dragonflybsd/DragonFlyBSDProcess.h | 10 ------- dragonflybsd/DragonFlyBSDProcessList.c | 54 ++-------------------------------- dragonflybsd/DragonFlyBSDProcessList.h | 11 ++----- dragonflybsd/Platform.c | 12 -------- dragonflybsd/Platform.h | 7 ----- 8 files changed, 5 insertions(+), 125 deletions(-) (limited to 'dragonflybsd') diff --git a/dragonflybsd/Battery.h b/dragonflybsd/Battery.h index efb44a8..f764a2d 100644 --- a/dragonflybsd/Battery.h +++ b/dragonflybsd/Battery.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_Battery #define HEADER_Battery /* diff --git a/dragonflybsd/DragonFlyBSDCRT.h b/dragonflybsd/DragonFlyBSDCRT.h index b934ac3..2bf85f7 100644 --- a/dragonflybsd/DragonFlyBSDCRT.h +++ b/dragonflybsd/DragonFlyBSDCRT.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_DragonFlyBSDCRT #define HEADER_DragonFlyBSDCRT /* @@ -10,10 +8,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#ifdef HAVE_EXECINFO_H -#endif - void CRT_handleSIGSEGV(int sgn); - #endif diff --git a/dragonflybsd/DragonFlyBSDProcess.c b/dragonflybsd/DragonFlyBSDProcess.c index ffaf5eb..770143b 100644 --- a/dragonflybsd/DragonFlyBSDProcess.c +++ b/dragonflybsd/DragonFlyBSDProcess.c @@ -17,34 +17,6 @@ in the source distribution for its full text. #include #include -/*{ - -typedef enum DragonFlyBSDProcessFields { - // Add platform-specific fields here, with ids >= 100 - JID = 100, - JAIL = 101, - LAST_PROCESSFIELD = 102, -} DragonFlyBSDProcessField; - - -typedef struct DragonFlyBSDProcess_ { - Process super; - int kernel; - int jid; - char* jname; -} DragonFlyBSDProcess; - - -#ifndef Process_isKernelThread -#define Process_isKernelThread(_process) (_process->kernel == 1) -#endif - -#ifndef Process_isUserlandThread -//#define Process_isUserlandThread(_process) (_process->pid != _process->tgid) -#define Process_isUserlandThread(_process) (_process->nlwp > 1) -#endif - -}*/ ProcessClass DragonFlyBSDProcess_class = { .super = { diff --git a/dragonflybsd/DragonFlyBSDProcess.h b/dragonflybsd/DragonFlyBSDProcess.h index 4a0f9a5..d5e5a6e 100644 --- a/dragonflybsd/DragonFlyBSDProcess.h +++ b/dragonflybsd/DragonFlyBSDProcess.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_DragonFlyBSDProcess #define HEADER_DragonFlyBSDProcess /* @@ -10,7 +8,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - typedef enum DragonFlyBSDProcessFields { // Add platform-specific fields here, with ids >= 100 JID = 100, @@ -18,7 +15,6 @@ typedef enum DragonFlyBSDProcessFields { LAST_PROCESSFIELD = 102, } DragonFlyBSDProcessField; - typedef struct DragonFlyBSDProcess_ { Process super; int kernel; @@ -26,16 +22,10 @@ typedef struct DragonFlyBSDProcess_ { char* jname; } DragonFlyBSDProcess; - -#ifndef Process_isKernelThread #define Process_isKernelThread(_process) (_process->kernel == 1) -#endif -#ifndef Process_isUserlandThread //#define Process_isUserlandThread(_process) (_process->pid != _process->tgid) #define Process_isUserlandThread(_process) (_process->nlwp > 1) -#endif - extern ProcessClass DragonFlyBSDProcess_class; diff --git a/dragonflybsd/DragonFlyBSDProcessList.c b/dragonflybsd/DragonFlyBSDProcessList.c index 5bc4b38..cd5526a 100644 --- a/dragonflybsd/DragonFlyBSDProcessList.c +++ b/dragonflybsd/DragonFlyBSDProcessList.c @@ -21,54 +21,6 @@ in the source distribution for its full text. #include #include -/*{ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "Hashtable.h" -#include "DragonFlyBSDProcess.h" - -#define JAIL_ERRMSGLEN 1024 -char jail_errmsg[JAIL_ERRMSGLEN]; - -typedef struct CPUData_ { - - double userPercent; - double nicePercent; - double systemPercent; - double irqPercent; - double idlePercent; - double systemAllPercent; - -} CPUData; - -typedef struct DragonFlyBSDProcessList_ { - ProcessList super; - kvm_t* kd; - - unsigned long long int memWire; - unsigned long long int memActive; - unsigned long long int memInactive; - unsigned long long int memFree; - - CPUData* cpus; - - unsigned long *cp_time_o; - unsigned long *cp_time_n; - - unsigned long *cp_times_o; - unsigned long *cp_times_n; - - Hashtable *jails; -} DragonFlyBSDProcessList; - -}*/ #define _UNUSED_ __attribute__((unused)) @@ -89,12 +41,12 @@ static int MIB_kern_cp_time[2]; static int MIB_kern_cp_times[2]; static int kernelFScale; -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) { +ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId) { size_t len; char errbuf[_POSIX2_LINE_MAX]; DragonFlyBSDProcessList* dfpl = xCalloc(1, sizeof(DragonFlyBSDProcessList)); ProcessList* pl = (ProcessList*) dfpl; - ProcessList_init(pl, Class(DragonFlyBSDProcess), usersTable, pidWhiteList, userId); + ProcessList_init(pl, Class(DragonFlyBSDProcess), usersTable, pidMatchList, userId); // physical memory in system: hw.physmem // physical page size: hw.pagesize @@ -145,7 +97,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, ui sysctl(MIB_kern_cp_times, 2, dfpl->cp_times_o, &len, NULL, 0); } - pl->cpuCount = MAX(cpus, 1); + pl->cpuCount = MAXIMUM(cpus, 1); if (cpus == 1 ) { dfpl->cpus = xRealloc(dfpl->cpus, sizeof(CPUData)); diff --git a/dragonflybsd/DragonFlyBSDProcessList.h b/dragonflybsd/DragonFlyBSDProcessList.h index 816e66d..84ab1c5 100644 --- a/dragonflybsd/DragonFlyBSDProcessList.h +++ b/dragonflybsd/DragonFlyBSDProcessList.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_DragonFlyBSDProcessList #define HEADER_DragonFlyBSDProcessList /* @@ -10,7 +8,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - #include #include #include @@ -23,17 +20,15 @@ in the source distribution for its full text. #include "DragonFlyBSDProcess.h" #define JAIL_ERRMSGLEN 1024 -char jail_errmsg[JAIL_ERRMSGLEN]; +extern char jail_errmsg[JAIL_ERRMSGLEN]; typedef struct CPUData_ { - double userPercent; double nicePercent; double systemPercent; double irqPercent; double idlePercent; double systemAllPercent; - } CPUData; typedef struct DragonFlyBSDProcessList_ { @@ -56,11 +51,9 @@ typedef struct DragonFlyBSDProcessList_ { Hashtable *jails; } DragonFlyBSDProcessList; - #define _UNUSED_ __attribute__((unused)) - -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); +ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId); void ProcessList_delete(ProcessList* this); diff --git a/dragonflybsd/Platform.c b/dragonflybsd/Platform.c index 250e50e..3b8e1a0 100644 --- a/dragonflybsd/Platform.c +++ b/dragonflybsd/Platform.c @@ -27,18 +27,6 @@ in the source distribution for its full text. #include #include -/*{ -#include "Action.h" -#include "BatteryMeter.h" -#include "SignalsPanel.h" - -extern ProcessFieldData Process_fields[]; - -}*/ - -#ifndef CLAMP -#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) -#endif ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 }; diff --git a/dragonflybsd/Platform.h b/dragonflybsd/Platform.h index c2684f3..83c14f5 100644 --- a/dragonflybsd/Platform.h +++ b/dragonflybsd/Platform.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_Platform #define HEADER_Platform /* @@ -16,11 +14,6 @@ in the source distribution for its full text. extern ProcessFieldData Process_fields[]; - -#ifndef CLAMP -#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) -#endif - extern ProcessField Platform_defaultFields[]; extern int Platform_numberOfFields; -- cgit v1.2.3