summaryrefslogtreecommitdiffstats
path: root/freebsd/FreeBSDProcess.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-03-16 23:01:48 -0300
committerHisham Muhammad <hisham@gobolinux.org>2015-03-16 23:02:03 -0300
commit272e2d9b3459ceb3fe2f5ae34a07e44df6c45997 (patch)
treeb7a7c2c68c3ebbe3b91f23a86da73ac352910cf5 /freebsd/FreeBSDProcess.c
parent9ff5d2b243472ae73d10dafdd7c0e24dc5052f6d (diff)
Major advances in FreeBSD port.
Diffstat (limited to 'freebsd/FreeBSDProcess.c')
-rw-r--r--freebsd/FreeBSDProcess.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/freebsd/FreeBSDProcess.c b/freebsd/FreeBSDProcess.c
index 614a6b8e..ab99ef7e 100644
--- a/freebsd/FreeBSDProcess.c
+++ b/freebsd/FreeBSDProcess.c
@@ -26,6 +26,14 @@ typedef struct FreeBSDProcess_ {
Process super;
} FreeBSDProcess;
+#ifndef Process_isKernelThread
+#define Process_isKernelThread(_process) (_process->pgrp == 0)
+#endif
+
+#ifndef Process_isUserlandThread
+#define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
+#endif
+
}*/
ProcessFieldData Process_fields[] = {
@@ -44,6 +52,7 @@ ProcessFieldData Process_fields[] = {
[NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, },
[STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, },
+ [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, },
[M_SIZE] = { .name = "M_SIZE", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, },
[M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, },
[ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, },
@@ -128,7 +137,5 @@ long Process_compare(const void* v1, const void* v2) {
}
bool Process_isThread(Process* this) {
- (void) this;
- // TODO
- return false;
+ return (Process_isKernelThread(this));
}

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