summaryrefslogtreecommitdiffstats
path: root/ProcessList.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2007-08-10 05:07:14 +0000
committerHisham Muhammad <hisham@gobolinux.org>2007-08-10 05:07:14 +0000
commit4c51ad0e3549a12215c98e8fa011557fc6889b65 (patch)
treec074c69432b324827825a25bdc7710f7406b42c7 /ProcessList.c
parentd357c677178f173575ac09d70f84a3e0c19e4329 (diff)
OpenVZ support, contributed by Sergey Lychko
Diffstat (limited to 'ProcessList.c')
-rw-r--r--ProcessList.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/ProcessList.c b/ProcessList.c
index 0b02d6aa..fa550cb5 100644
--- a/ProcessList.c
+++ b/ProcessList.c
@@ -580,6 +580,28 @@ void ProcessList_processEntries(ProcessList* this, char* dirname, int parent, fl
if(!existingProcess) {
process->user = UsersTable_getRef(this->usersTable, process->st_uid);
+
+ #ifdef HAVE_OPENVZ
+ if (access("/proc/vz", R_OK) != 0) {
+ process->vpid = process->pid;
+ process->veid = 0;
+ } else {
+ snprintf(statusfilename, MAX_NAME, "%s/%s/stat", dirname, name);
+ status = ProcessList_fopen(this, statusfilename, "r");
+ if (status == NULL)
+ goto errorReadingProcess;
+ num = ProcessList_fread(this, status,
+ "%*u %*s %*c %*u %*u %*u %*u %*u %*u %*u "
+ "%*u %*u %*u %*u %*u %*u %*u %*u "
+ "%*u %*u %*u %*u %*u %*u %*u %*u "
+ "%*u %*u %*u %*u %*u %*u %*u %*u "
+ "%*u %*u %*u %*u %*u %*u %*u %*u "
+ "%*u %*u %*u %*u %*u %*u %*u "
+ "%u %u",
+ &process->vpid, &process->veid);
+ fclose(status);
+ }
+ #endif
snprintf(statusfilename, MAX_NAME, "%s/%s/cmdline", dirname, name);
status = ProcessList_fopen(this, statusfilename, "r");

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