aboutsummaryrefslogtreecommitdiffstats
path: root/openbsd
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 /openbsd
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 'openbsd')
-rw-r--r--openbsd/Battery.h2
-rw-r--r--openbsd/OpenBSDCRT.h3
-rw-r--r--openbsd/OpenBSDProcess.c20
-rw-r--r--openbsd/OpenBSDProcess.h10
-rw-r--r--openbsd/OpenBSDProcessList.c53
-rw-r--r--openbsd/OpenBSDProcessList.h24
-rw-r--r--openbsd/Platform.c8
-rw-r--r--openbsd/Platform.h14
8 files changed, 5 insertions, 129 deletions
diff --git a/openbsd/Battery.h b/openbsd/Battery.h
index 0f05af3..e858b15 100644
--- a/openbsd/Battery.h
+++ b/openbsd/Battery.h
@@ -1,5 +1,3 @@
-/* Do not edit this file. It was automatically generated. */
-
#ifndef HEADER_Battery
#define HEADER_Battery
/*
diff --git a/openbsd/OpenBSDCRT.h b/openbsd/OpenBSDCRT.h
index c48309a..85860a9 100644
--- a/openbsd/OpenBSDCRT.h
+++ b/openbsd/OpenBSDCRT.h
@@ -1,5 +1,3 @@
-/* Do not edit this file. It was automatically generated. */
-
#ifndef HEADER_OpenBSDCRT
#define HEADER_OpenBSDCRT
/*
@@ -12,5 +10,4 @@ in the source distribution for its full text.
void CRT_handleSIGSEGV(int sgn);
-
#endif
diff --git a/openbsd/OpenBSDProcess.c b/openbsd/OpenBSDProcess.c
index f54c911..1a80784 100644
--- a/openbsd/OpenBSDProcess.c
+++ b/openbsd/OpenBSDProcess.c
@@ -16,26 +16,6 @@ in the source distribution for its full text.
#include <unistd.h>
#include <sys/syscall.h>
-/*{
-
-typedef enum OpenBSDProcessFields {
- // Add platform-specific fields here, with ids >= 100
- LAST_PROCESSFIELD = 100,
-} OpenBSDProcessField;
-
-typedef struct OpenBSDProcess_ {
- Process super;
-} OpenBSDProcess;
-
-#ifndef Process_isKernelThread
-#define Process_isKernelThread(_process) (_process->pgrp == 0)
-#endif
-
-#ifndef Process_isUserlandThread
-#define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
-#endif
-
-}*/
ProcessClass OpenBSDProcess_class = {
.super = {
diff --git a/openbsd/OpenBSDProcess.h b/openbsd/OpenBSDProcess.h
index ba55e5e..fede6f8 100644
--- a/openbsd/OpenBSDProcess.h
+++ b/openbsd/OpenBSDProcess.h
@@ -1,5 +1,3 @@
-/* Do not edit this file. It was automatically generated. */
-
#ifndef HEADER_OpenBSDProcess
#define HEADER_OpenBSDProcess
/*
@@ -10,8 +8,7 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
-
-typedef enum OpenBSDProcessFields {
+typedef enum OpenBSDProcessFields_ {
// Add platform-specific fields here, with ids >= 100
LAST_PROCESSFIELD = 100,
} OpenBSDProcessField;
@@ -20,14 +17,9 @@ typedef struct OpenBSDProcess_ {
Process super;
} OpenBSDProcess;
-#ifndef Process_isKernelThread
#define Process_isKernelThread(_process) (_process->pgrp == 0)
-#endif
-#ifndef Process_isUserlandThread
#define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
-#endif
-
extern ProcessClass OpenBSDProcess_class;
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) {
diff --git a/openbsd/OpenBSDProcessList.h b/openbsd/OpenBSDProcessList.h
index ec9fab2..0d9defb 100644
--- a/openbsd/OpenBSDProcessList.h
+++ b/openbsd/OpenBSDProcessList.h
@@ -1,5 +1,3 @@
-/* Do not edit this file. It was automatically generated. */
-
#ifndef HEADER_OpenBSDProcessList
#define HEADER_OpenBSDProcessList
/*
@@ -10,7 +8,6 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
-
#include <kvm.h>
typedef struct CPUData_ {
@@ -42,31 +39,12 @@ typedef struct OpenBSDProcessList_ {
} 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
-
-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);
char *OpenBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kproc, int* basenameEnd);
-/*
- * Taken from OpenBSD's ps(1).
- */
void ProcessList_goThroughEntries(ProcessList* this);
-
#endif
diff --git a/openbsd/Platform.c b/openbsd/Platform.c
index 0f5279e..cb16207 100644
--- a/openbsd/Platform.c
+++ b/openbsd/Platform.c
@@ -37,14 +37,6 @@ in the source distribution for its full text.
#include <limits.h>
#include <math.h>
-/*{
-#include "Action.h"
-#include "BatteryMeter.h"
-#include "SignalsPanel.h"
-
-extern ProcessFieldData Process_fields[];
-
-}*/
ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 };
diff --git a/openbsd/Platform.h b/openbsd/Platform.h
index 56e4c40..f51d6bc 100644
--- a/openbsd/Platform.h
+++ b/openbsd/Platform.h
@@ -1,5 +1,3 @@
-/* Do not edit this file. It was automatically generated. */
-
#ifndef HEADER_Platform
#define HEADER_Platform
/*
@@ -16,14 +14,11 @@ in the source distribution for its full text.
extern ProcessFieldData Process_fields[];
-
extern ProcessField Platform_defaultFields[];
extern int Platform_numberOfFields;
-/*
- * See /usr/include/sys/signal.h
- */
+/* see /usr/include/sys/signal.h */
extern const SignalItem Platform_signals[];
extern const unsigned int Platform_numberOfSignals;
@@ -32,7 +27,6 @@ void Platform_setBindings(Htop_Action* keys);
extern MeterClass* Platform_meterTypes[];
-// preserved from FreeBSD port
int Platform_getUptime();
void Platform_getLoadAverage(double* one, double* five, double* fifteen);
@@ -43,12 +37,6 @@ double Platform_setCPUValues(Meter* this, int cpu);
void Platform_setMemoryValues(Meter* this);
-/*
- * Copyright (c) 1994 Thorsten Lockert <tholo@sigmasoft.com>
- * All rights reserved.
- *
- * Taken almost directly from OpenBSD's top(1)
- */
void Platform_setSwapValues(Meter* this);
void Platform_setTasksValues(Meter* this);

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