diff options
author | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:32 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:32 +0200 |
commit | 2004bbc3ef28ada3acca05f5d5fa9108121a6784 (patch) | |
tree | 4b032c0acba5f80caf8b2802aa175f472334a26c /Process.h | |
parent | e2b58f0ab81b2aafeb8c29a69abad7829fa21ab3 (diff) | |
download | debian_htop-2004bbc3ef28ada3acca05f5d5fa9108121a6784.tar.gz debian_htop-2004bbc3ef28ada3acca05f5d5fa9108121a6784.tar.bz2 debian_htop-2004bbc3ef28ada3acca05f5d5fa9108121a6784.zip |
Imported Upstream version 1.0.2upstream/1.0.2
Diffstat (limited to 'Process.h')
-rw-r--r-- | Process.h | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -21,6 +21,7 @@ in the source distribution for its full text. #include "Object.h" #include "Affinity.h" +#include "IOPriority.h" #include <sys/types.h> #ifndef Process_isKernelThread @@ -53,6 +54,7 @@ typedef enum ProcessField_ { #ifdef HAVE_CGROUP CGROUP, #endif + IO_PRIORITY, LAST_PROCESSFIELD } ProcessField; @@ -91,6 +93,7 @@ typedef struct Process_ { long int priority; long int nice; long int nlwp; + IOPriority ioPriority; char starttime_show[8]; time_t starttime_ctime; #ifdef DEBUG @@ -175,6 +178,22 @@ void Process_toggleTag(Process* this); bool Process_setPriority(Process* this, int priority); +bool Process_changePriorityBy(Process* this, size_t delta); + +IOPriority Process_updateIOPriority(Process* this); + +bool Process_setIOPriority(Process* this, IOPriority ioprio); + +/* +[1] Note that before kernel 2.6.26 a process that has not asked for +an io priority formally uses "none" as scheduling class, but the +io scheduler will treat such processes as if it were in the best +effort class. The priority within the best effort class will be +dynamically derived from the cpu nice level of the process: +extern io_priority; +*/ +#define Process_effectiveIOPriority(p_) (IOPriority_class(p_->ioPriority) == IOPRIO_CLASS_NONE ? IOPriority_tuple(IOPRIO_CLASS_BE, (p_->nice + 20) / 5) : p_->ioPriority) + #ifdef HAVE_LIBHWLOC Affinity* Process_getAffinity(Process* this); @@ -189,7 +208,7 @@ bool Process_setAffinity(Process* this, Affinity* affinity); #endif -void Process_sendSignal(Process* this, int sgn); +void Process_sendSignal(Process* this, size_t sgn); int Process_pidCompare(const void* v1, const void* v2); |