2014-11-24 20:55:49 +00:00
|
|
|
/*
|
|
|
|
htop - UnsupportedProcessList.c
|
|
|
|
(C) 2014 Hisham H. Muhammad
|
|
|
|
Released under the GNU GPL, see the COPYING file
|
|
|
|
in the source distribution for its full text.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ProcessList.h"
|
2015-07-12 16:26:33 +00:00
|
|
|
#include "UnsupportedProcess.h"
|
2014-11-24 20:55:49 +00:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
2015-07-12 16:26:33 +00:00
|
|
|
#include <string.h>
|
2014-11-24 20:55:49 +00:00
|
|
|
|
|
|
|
/*{
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
2015-07-12 16:26:33 +00:00
|
|
|
ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) {
|
2016-02-02 14:53:02 +00:00
|
|
|
ProcessList* this = xCalloc(1, sizeof(ProcessList));
|
2015-07-12 16:26:33 +00:00
|
|
|
ProcessList_init(this, Class(Process), usersTable, pidWhiteList, userId);
|
2014-11-24 20:55:49 +00:00
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2014-11-27 19:48:38 +00:00
|
|
|
void ProcessList_delete(ProcessList* this) {
|
|
|
|
ProcessList_done(this);
|
|
|
|
free(this);
|
|
|
|
}
|
|
|
|
|
2015-07-12 16:26:33 +00:00
|
|
|
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) {
|
2014-11-24 20:55:49 +00:00
|
|
|
(void) this;
|
|
|
|
// stub!
|
|
|
|
}
|