aboutsummaryrefslogtreecommitdiffstats
path: root/freebsd
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2020-09-15 08:00:00 +0200
committerDaniel Lange <DLange@git.local>2020-09-15 08:00:00 +0200
commitf80394a20254938142011855f2954b3f63fe5909 (patch)
treeb777de460977f21a6257540d6a687c86882850dc /freebsd
parent59eeadec918a955b40427a1b012992161050c939 (diff)
downloaddebian_htop-f80394a20254938142011855f2954b3f63fe5909.tar.gz
debian_htop-f80394a20254938142011855f2954b3f63fe5909.tar.bz2
debian_htop-f80394a20254938142011855f2954b3f63fe5909.zip
New upstream version 3.0.2upstream/3.0.2
Diffstat (limited to 'freebsd')
-rw-r--r--freebsd/Battery.h2
-rw-r--r--freebsd/FreeBSDCRT.h3
-rw-r--r--freebsd/FreeBSDProcess.c27
-rw-r--r--freebsd/FreeBSDProcess.h12
-rw-r--r--freebsd/FreeBSDProcessList.c52
-rw-r--r--freebsd/FreeBSDProcessList.h11
-rw-r--r--freebsd/Platform.c12
-rw-r--r--freebsd/Platform.h7
8 files changed, 6 insertions, 120 deletions
diff --git a/freebsd/Battery.h b/freebsd/Battery.h
index cc5b1fe..6987d78 100644
--- a/freebsd/Battery.h
+++ b/freebsd/Battery.h
@@ -1,5 +1,3 @@
-/* Do not edit this file. It was automatically generated. */
-
#ifndef HEADER_Battery
#define HEADER_Battery
/*
diff --git a/freebsd/FreeBSDCRT.h b/freebsd/FreeBSDCRT.h
index eb1091a..eb88fcc 100644
--- a/freebsd/FreeBSDCRT.h
+++ b/freebsd/FreeBSDCRT.h
@@ -1,5 +1,3 @@
-/* Do not edit this file. It was automatically generated. */
-
#ifndef HEADER_FreeBSDCRT
#define HEADER_FreeBSDCRT
/*
@@ -11,5 +9,4 @@ in the source distribution for its full text.
void CRT_handleSIGSEGV(int sgn);
-
#endif
diff --git a/freebsd/FreeBSDProcess.c b/freebsd/FreeBSDProcess.c
index c8d30f6..33dc751 100644
--- a/freebsd/FreeBSDProcess.c
+++ b/freebsd/FreeBSDProcess.c
@@ -16,33 +16,6 @@ in the source distribution for its full text.
#include <unistd.h>
#include <sys/syscall.h>
-/*{
-
-typedef enum FreeBSDProcessFields {
- // Add platform-specific fields here, with ids >= 100
- JID = 100,
- JAIL = 101,
- LAST_PROCESSFIELD = 102,
-} FreeBSDProcessField;
-
-
-typedef struct FreeBSDProcess_ {
- Process super;
- int kernel;
- int jid;
- char* jname;
-} FreeBSDProcess;
-
-
-#ifndef Process_isKernelThread
-#define Process_isKernelThread(_process) (_process->kernel == 1)
-#endif
-
-#ifndef Process_isUserlandThread
-#define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
-#endif
-
-}*/
ProcessClass FreeBSDProcess_class = {
.super = {
diff --git a/freebsd/FreeBSDProcess.h b/freebsd/FreeBSDProcess.h
index 23d298a..897c532 100644
--- a/freebsd/FreeBSDProcess.h
+++ b/freebsd/FreeBSDProcess.h
@@ -1,5 +1,3 @@
-/* Do not edit this file. It was automatically generated. */
-
#ifndef HEADER_FreeBSDProcess
#define HEADER_FreeBSDProcess
/*
@@ -9,15 +7,13 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
-
-typedef enum FreeBSDProcessFields {
+typedef enum FreeBSDProcessFields_ {
// Add platform-specific fields here, with ids >= 100
JID = 100,
JAIL = 101,
LAST_PROCESSFIELD = 102,
} FreeBSDProcessField;
-
typedef struct FreeBSDProcess_ {
Process super;
int kernel;
@@ -25,15 +21,9 @@ typedef struct FreeBSDProcess_ {
char* jname;
} FreeBSDProcess;
-
-#ifndef Process_isKernelThread
#define Process_isKernelThread(_process) (_process->kernel == 1)
-#endif
-#ifndef Process_isUserlandThread
#define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
-#endif
-
extern ProcessClass FreeBSDProcess_class;
diff --git a/freebsd/FreeBSDProcessList.c b/freebsd/FreeBSDProcessList.c
index 8c892a0..6318d42 100644
--- a/freebsd/FreeBSDProcessList.c
+++ b/freebsd/FreeBSDProcessList.c
@@ -22,54 +22,8 @@ in the source distribution for its full text.
#include <string.h>
#include <time.h>
-/*{
-
-#include "zfs/ZfsArcStats.h"
-
-#include <kvm.h>
-#include <sys/param.h>
-#include <sys/jail.h>
-#include <sys/uio.h>
-#include <sys/resource.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 FreeBSDProcessList_ {
- 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;
-
- ZfsArcStats zfs;
-
- CPUData* cpus;
-
- unsigned long *cp_time_o;
- unsigned long *cp_time_n;
-
- unsigned long *cp_times_o;
- unsigned long *cp_times_n;
-
-} FreeBSDProcessList;
-
-}*/
-
-
static int MIB_hw_physmem[2];
static int MIB_vm_stats_vm_v_page_count[4];
static int pageSize;
@@ -87,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];
FreeBSDProcessList* fpl = xCalloc(1, sizeof(FreeBSDProcessList));
ProcessList* pl = (ProcessList*) fpl;
- ProcessList_init(pl, Class(FreeBSDProcess), usersTable, pidWhiteList, userId);
+ ProcessList_init(pl, Class(FreeBSDProcess), usersTable, pidMatchList, userId);
// physical memory in system: hw.physmem
// physical page size: hw.pagesize
@@ -157,7 +111,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, ui
sysctl(MIB_kern_cp_times, 2, fpl->cp_times_o, &len, NULL, 0);
}
- pl->cpuCount = MAX(cpus, 1);
+ pl->cpuCount = MAXIMUM(cpus, 1);
if (cpus == 1 ) {
fpl->cpus = xRealloc(fpl->cpus, sizeof(CPUData));
diff --git a/freebsd/FreeBSDProcessList.h b/freebsd/FreeBSDProcessList.h
index 7c1b7ad..281bf3e 100644
--- a/freebsd/FreeBSDProcessList.h
+++ b/freebsd/FreeBSDProcessList.h
@@ -1,5 +1,3 @@
-/* Do not edit this file. It was automatically generated. */
-
#ifndef HEADER_FreeBSDProcessList
#define HEADER_FreeBSDProcessList
/*
@@ -9,7 +7,6 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
-
#include "zfs/ZfsArcStats.h"
#include <kvm.h>
@@ -19,17 +16,15 @@ in the source distribution for its full text.
#include <sys/resource.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 FreeBSDProcessList_ {
@@ -53,9 +48,7 @@ typedef struct FreeBSDProcessList_ {
} FreeBSDProcessList;
-
-
-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/freebsd/Platform.c b/freebsd/Platform.c
index e6acebd..c51b37c 100644
--- a/freebsd/Platform.c
+++ b/freebsd/Platform.c
@@ -28,18 +28,6 @@ in the source distribution for its full text.
#include <time.h>
#include <math.h>
-/*{
-#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/freebsd/Platform.h b/freebsd/Platform.h
index 0268f2c..1a18055 100644
--- a/freebsd/Platform.h
+++ b/freebsd/Platform.h
@@ -1,5 +1,3 @@
-/* Do not edit this file. It was automatically generated. */
-
#ifndef HEADER_Platform
#define HEADER_Platform
/*
@@ -15,11 +13,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;

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