summaryrefslogtreecommitdiffstats
path: root/unsupported/UnsupportedProcessList.c
diff options
context:
space:
mode:
authorDavid Hunt <dhunt@iolanthe.attlocal.net>2015-07-12 11:26:33 -0500
committerHisham Muhammad <hisham@gobolinux.org>2015-08-19 13:46:41 -0300
commitfeb7a01fd32d4a63b9cfb178c67cc95c05c9dc00 (patch)
tree0d82a9640e852046724daabeea1a0f9f0633530e /unsupported/UnsupportedProcessList.c
parent5e602f18d5f619f7dba6d9fccefacdb991db391d (diff)
Make unsupported run
Diffstat (limited to 'unsupported/UnsupportedProcessList.c')
-rw-r--r--unsupported/UnsupportedProcessList.c56
1 files changed, 47 insertions, 9 deletions
diff --git a/unsupported/UnsupportedProcessList.c b/unsupported/UnsupportedProcessList.c
index fca9a760..b049398d 100644
--- a/unsupported/UnsupportedProcessList.c
+++ b/unsupported/UnsupportedProcessList.c
@@ -6,22 +6,18 @@ in the source distribution for its full text.
*/
#include "ProcessList.h"
+#include "UnsupportedProcess.h"
#include <stdlib.h>
+#include <string.h>
/*{
}*/
-ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList) {
+ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) {
ProcessList* this = calloc(1, sizeof(ProcessList));
- ProcessList_init(this, usersTable, pidWhiteList);
-
- // Update CPU count:
- this->cpuCount = 1;
- this->cpus = calloc(1, sizeof(CPUData));
- this->cpus[0].totalTime = 1;
- this->cpus[0].totalPeriod = 1;
+ ProcessList_init(this, Class(Process), usersTable, pidWhiteList, userId);
return this;
}
@@ -31,7 +27,49 @@ void ProcessList_delete(ProcessList* this) {
free(this);
}
-void ProcessList_scan(ProcessList* this) {
+void ProcessList_goThroughEntries(ProcessList* super) {
+ bool preExisting = true;
+ Process *proc;
+
+ proc = ProcessList_getProcess(super, 1, &preExisting, UnsupportedProcess_new);
+
+ /* Empty values */
+ proc->time = proc->time + 10;
+ proc->pid = 1;
+ proc->ppid = 1;
+ proc->tgid = 0;
+ proc->comm = "<unsupported architecture>";
+ proc->basenameOffset = 0;
+ proc->updated = true;
+
+ proc->state = 'R';
+ proc->show = true; /* Reflected in proc->settings-> "hideXXX" really */
+ proc->pgrp = 0;
+ proc->session = 0;
+ proc->tty_nr = 0;
+ proc->tpgid = 0;
+ proc->st_uid = 0;
+ proc->flags = 0;
+ proc->processor = 0;
+
+ proc->percent_cpu = 2.5;
+ proc->percent_mem = 2.5;
+ proc->user = "nobody";
+
+ proc->priority = 0;
+ proc->nice = 0;
+ proc->nlwp = 1;
+ strncpy(proc->starttime_show, "Jun 01 ", sizeof(proc->starttime_show));
+ proc->starttime_ctime = 1433116800; // Jun 01, 2015
+
+ proc->m_size = 100;
+ proc->m_resident = 100;
+
+ proc->minflt = 20;
+ proc->majflt = 20;
+}
+
+void UnsupportedProcessList_scan(ProcessList* this) {
(void) this;
// stub!
}

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