From 69f439eff387a6ecb52734e400b297a3c85f2285 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Tue, 21 Sep 2021 08:35:19 +0200 Subject: New upstream version 3.1.0 --- unsupported/UnsupportedProcessList.c | 44 ++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 9 deletions(-) (limited to 'unsupported/UnsupportedProcessList.c') diff --git a/unsupported/UnsupportedProcessList.c b/unsupported/UnsupportedProcessList.c index 098eb48..0486e49 100644 --- a/unsupported/UnsupportedProcessList.c +++ b/unsupported/UnsupportedProcessList.c @@ -5,16 +5,21 @@ Released under the GNU GPLv2, see the COPYING file in the source distribution for its full text. */ -#include "ProcessList.h" -#include "UnsupportedProcess.h" +#include "UnsupportedProcessList.h" #include #include +#include "ProcessList.h" +#include "UnsupportedProcess.h" + -ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId) { +ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* dynamicMeters, Hashtable* dynamicColumns, Hashtable* pidMatchList, uid_t userId) { ProcessList* this = xCalloc(1, sizeof(ProcessList)); - ProcessList_init(this, Class(Process), usersTable, pidMatchList, userId); + ProcessList_init(this, Class(Process), usersTable, dynamicMeters, dynamicColumns, pidMatchList, userId); + + this->existingCPUs = 1; + this->activeCPUs = 1; return this; } @@ -41,23 +46,33 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { proc->pid = 1; proc->ppid = 1; proc->tgid = 0; - proc->comm = ""; - proc->basenameOffset = 0; + + Process_updateComm(proc, "commof16char"); + Process_updateCmdline(proc, "", 0, 0); + Process_updateExe(proc, "/path/to/executable"); + + if (proc->settings->flags & PROCESS_FLAG_CWD) { + free_and_xStrdup(&proc->procCwd, "/current/working/directory"); + } + proc->updated = true; proc->state = 'R'; + proc->isKernelThread = false; + proc->isUserlandThread = false; proc->show = true; /* Reflected in proc->settings-> "hideXXX" really */ proc->pgrp = 0; proc->session = 0; proc->tty_nr = 0; + proc->tty_name = NULL; 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->st_uid = 0; + proc->user = "nobody"; /* Update whenever proc->st_uid is changed */ proc->priority = 0; proc->nice = 0; @@ -70,4 +85,15 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { proc->minflt = 20; proc->majflt = 20; + + if (!preExisting) + ProcessList_add(super, proc); +} + +bool ProcessList_isCPUonline(const ProcessList* super, unsigned int id) { + assert(id < super->existingCPUs); + + (void) super; (void) id; + + return true; } -- cgit v1.2.3