aboutsummaryrefslogtreecommitdiffstats
path: root/unsupported/UnsupportedProcessTable.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2024-01-10 11:17:08 +0100
committerDaniel Lange <DLange@git.local>2024-01-10 11:17:08 +0100
commite7372d18a1a661d8c3dba9f51e1f17b5f94171a7 (patch)
treee8270dd60ec096bee8157dbadf029e15ed584592 /unsupported/UnsupportedProcessTable.c
parent937052b231259a47d881d539ad5748245ef55b99 (diff)
downloaddebian_htop-e7372d18a1a661d8c3dba9f51e1f17b5f94171a7.tar.gz
debian_htop-e7372d18a1a661d8c3dba9f51e1f17b5f94171a7.tar.bz2
debian_htop-e7372d18a1a661d8c3dba9f51e1f17b5f94171a7.zip
New upstream version 3.3.0
Diffstat (limited to 'unsupported/UnsupportedProcessTable.c')
-rw-r--r--unsupported/UnsupportedProcessTable.c90
1 files changed, 90 insertions, 0 deletions
diff --git a/unsupported/UnsupportedProcessTable.c b/unsupported/UnsupportedProcessTable.c
new file mode 100644
index 0000000..db43f1e
--- /dev/null
+++ b/unsupported/UnsupportedProcessTable.c
@@ -0,0 +1,90 @@
+/*
+htop - UnsupportedProcessTable.c
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPLv2+, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "config.h" // IWYU pragma: keep
+
+#include "UnsupportedProcessTable.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "ProcessTable.h"
+#include "UnsupportedProcess.h"
+
+
+ProcessTable* ProcessTable_new(Machine* host, Hashtable* pidMatchList) {
+ UnsupportedProcessTable* this = xCalloc(1, sizeof(UnsupportedProcessTable));
+ Object_setClass(this, Class(ProcessTable));
+
+ ProcessTable* super = &this->super;
+ ProcessTable_init(super, Class(Process), host, pidMatchList);
+
+ return this;
+}
+
+void ProcessTable_delete(Object* cast) {
+ UnsupportedProcessTable* this = (UnsupportedProcessTable*) cast;
+ ProcessTable_done(&this->super);
+ free(this);
+}
+
+void ProcessTable_goThroughEntries(ProcessTable* super) {
+ bool preExisting = true;
+ Process* proc;
+
+ proc = ProcessTable_getProcess(super, 1, &preExisting, UnsupportedProcess_new);
+
+ /* Empty values */
+ proc->time = proc->time + 10;
+ Process_setPid(proc, 1);
+ Process_setParent(proc, 1);
+ Process_setThreadGroup(proc, 0);
+
+ Process_updateComm(proc, "commof16char");
+ Process_updateCmdline(proc, "<unsupported architecture>", 0, 0);
+ Process_updateExe(proc, "/path/to/executable");
+
+ const Settings* settings = proc->host->settings;
+ if (settings->ss->flags & PROCESS_FLAG_CWD) {
+ free_and_xStrdup(&proc->procCwd, "/current/working/directory");
+ }
+
+ proc->super.updated = true;
+
+ proc->state = RUNNING;
+ proc->isKernelThread = false;
+ proc->isUserlandThread = false;
+ proc->super.show = true; /* Reflected in settings-> "hideXXX" really */
+ proc->pgrp = 0;
+ proc->session = 0;
+ proc->tty_nr = 0;
+ proc->tty_name = NULL;
+ proc->tpgid = 0;
+ proc->processor = 0;
+
+ proc->percent_cpu = 2.5;
+ proc->percent_mem = 2.5;
+ Process_updateCPUFieldWidths(proc->percent_cpu);
+
+ proc->st_uid = 0;
+ proc->user = "nobody"; /* Update whenever proc->st_uid is changed */
+
+ proc->priority = 0;
+ proc->nice = 0;
+ proc->nlwp = 1;
+ proc->starttime_ctime = 1433116800; // Jun 01, 2015
+ Process_fillStarttimeBuffer(proc);
+
+ proc->m_virt = 100;
+ proc->m_resident = 100;
+
+ proc->minflt = 20;
+ proc->majflt = 20;
+
+ if (!preExisting)
+ ProcessTable_add(super, proc);
+}

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