aboutsummaryrefslogtreecommitdiffstats
path: root/Process.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2018-04-11 01:26:28 +0200
committerDaniel Lange <DLange@git.local>2018-04-11 01:26:28 +0200
commit097fb9e4a3460fe1b6b3fc645ef97acb44946141 (patch)
tree58ba6c6459b926f555a539fab1ec01ff4e93d9ce /Process.c
parent2f3c2439d8d88cf7c1ecef0bcb2b33f747f3ed06 (diff)
parentc60f4cf3c1d91bd786db8e081699f420f44631f3 (diff)
downloaddebian_htop-097fb9e4a3460fe1b6b3fc645ef97acb44946141.tar.gz
debian_htop-097fb9e4a3460fe1b6b3fc645ef97acb44946141.tar.bz2
debian_htop-097fb9e4a3460fe1b6b3fc645ef97acb44946141.zip
Updated version 2.2.0 from 'upstream/2.2.0'
with Debian dir ed195b175f9cd34e0ba2b22dfecc727ab25e1463
Diffstat (limited to 'Process.c')
-rw-r--r--Process.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/Process.c b/Process.c
index 1836080..471f529 100644
--- a/Process.c
+++ b/Process.c
@@ -28,6 +28,12 @@ in the source distribution for its full text.
#include <time.h>
#include <assert.h>
#include <math.h>
+#ifdef MAJOR_IN_MKDEV
+#include <sys/mkdev.h>
+#elif defined(MAJOR_IN_SYSMACROS) || \
+ (defined(HAVE_SYS_SYSMACROS_H) && HAVE_SYS_SYSMACROS_H)
+#include <sys/sysmacros.h>
+#endif
#ifdef __ANDROID__
#define SYS_ioprio_get __NR_ioprio_get
@@ -172,6 +178,8 @@ typedef struct ProcessClass_ {
#define As_Process(this_) ((ProcessClass*)((this_)->super.klass))
+#define Process_getParentPid(process_) (process_->tgid == process_->pid ? process_->ppid : process_->tgid)
+
#define Process_isChildOf(process_, pid_) (process_->tgid == pid_ || (process_->tgid == process_->pid && process_->ppid == pid_))
#define Process_sortState(state) ((state) == 'I' ? 0x100 : (state))
@@ -536,11 +544,11 @@ bool Process_setPriority(Process* this, int priority) {
return (err == 0);
}
-bool Process_changePriorityBy(Process* this, size_t delta) {
+bool Process_changePriorityBy(Process* this, int delta) {
return Process_setPriority(this, this->nice + delta);
}
-void Process_sendSignal(Process* this, size_t sgn) {
+void Process_sendSignal(Process* this, int sgn) {
CRT_dropPrivileges();
kill(this->pid, (int) sgn);
CRT_restorePrivileges();

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