From c74c38760df69bb87e93dff18cf91464e5d02f37 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Mon, 11 Apr 2016 13:00:22 +0200 Subject: Imported Upstream version 0.8.1 --- Process.h | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) (limited to 'Process.h') diff --git a/Process.h b/Process.h index 778d464..3cac731 100644 --- a/Process.h +++ b/Process.h @@ -14,6 +14,7 @@ in the source distribution for its full text. #include "Object.h" #include "CRT.h" #include "String.h" +#include "RichString.h" #include "debug.h" @@ -30,6 +31,8 @@ in the source distribution for its full text. #include #include +#include + // This works only with glibc 2.1+. On earlier versions // the behavior is similar to have a hardcoded page size. #ifndef PAGE_SIZE @@ -48,6 +51,12 @@ typedef enum ProcessField_ { #ifdef HAVE_OPENVZ VEID, VPID, #endif + #ifdef HAVE_VSERVER + VXID, + #endif + #ifdef HAVE_TASKSTATS + RCHAR, WCHAR, SYSCR, SYSCW, RBYTES, WBYTES, CNCLWB, IO_READ_RATE, IO_WRITE_RATE, IO_RATE, + #endif LAST_PROCESSFIELD } ProcessField; @@ -120,6 +129,22 @@ typedef struct Process_ { unsigned int veid; unsigned int vpid; #endif + #ifdef HAVE_VSERVER + unsigned int vxid; + #endif + #ifdef HAVE_TASKSTATS + unsigned long long io_rchar; + unsigned long long io_wchar; + unsigned long long io_syscr; + unsigned long long io_syscw; + unsigned long long io_read_bytes; + unsigned long long io_write_bytes; + unsigned long long io_cancelled_write_bytes; + double io_rate_read_bps; + unsigned long long io_rate_read_time; + double io_rate_write_bps; + unsigned long long io_rate_write_time; + #endif } Process; @@ -131,34 +156,30 @@ extern char* PROCESS_CLASS; extern char *Process_fieldNames[]; -Process* Process_new(struct ProcessList_ *pl); +extern char *Process_fieldTitles[]; -Process* Process_clone(Process* this); +#define ONE_K 1024 +#define ONE_M (ONE_K * ONE_K) +#define ONE_G (ONE_M * ONE_K) void Process_delete(Object* cast); -void Process_display(Object* cast, RichString* out); +Process* Process_new(struct ProcessList_ *pl); + +Process* Process_clone(Process* this); void Process_toggleTag(Process* this); -void Process_setPriority(Process* this, int priority); +bool Process_setPriority(Process* this, int priority); unsigned long Process_getAffinity(Process* this); -void Process_setAffinity(Process* this, unsigned long mask); +bool Process_setAffinity(Process* this, unsigned long mask); void Process_sendSignal(Process* this, int signal); -#define ONE_K 1024 -#define ONE_M (ONE_K * ONE_K) -#define ONE_G (ONE_M * ONE_K) - -void Process_writeField(Process* this, RichString* str, ProcessField field); - int Process_pidCompare(const void* v1, const void* v2); int Process_compare(const void* v1, const void* v2); -char* Process_printField(ProcessField field); - #endif -- cgit v1.2.3