summaryrefslogtreecommitdiff
path: root/x11/kdebase3
diff options
context:
space:
mode:
authorColeman Kane <cokane@FreeBSD.org>2001-01-28 08:46:22 +0000
committerColeman Kane <cokane@FreeBSD.org>2001-01-28 08:46:22 +0000
commit8fdc4ba31e06ffccde135a9acb1fad76576c992a (patch)
tree9dc30944b12b46b7c414fa454f43eb6d65d87f50 /x11/kdebase3
parentReorganize .o installed (diff)
Update to allow ksysguard to compile from KDE 2.0 using -CURRENT
500015+. The kinfo_proc struct changed, and this accomidates that change on -current. KDE 2.0 now compiles again. Approved by: kevlo
Notes
Notes: svn path=/head/; revision=37671
Diffstat (limited to 'x11/kdebase3')
-rw-r--r--x11/kdebase3/files/patch-Processlist.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/x11/kdebase3/files/patch-Processlist.c b/x11/kdebase3/files/patch-Processlist.c
new file mode 100644
index 000000000000..863d56e7ec72
--- /dev/null
+++ b/x11/kdebase3/files/patch-Processlist.c
@@ -0,0 +1,80 @@
+--- ksysguard/ksysguardd/FreeBSD/ProcessList.c.old Tue Jan 23 19:44:29 2001
++++ ksysguard/ksysguardd/FreeBSD/ProcessList.c Tue Jan 23 20:19:24 2001
+@@ -186,7 +186,20 @@
+ if (sysctl(mib, 4, &p, &len, NULL, 0) == -1 || !len)
+ return -1;
+
+- /* ?? */
++#if __FreeBSD_version >= 500015
++ /* Getting runtime process info */
++ ps->pid = p.ki_pid;
++ ps->ppid = p.ki_ppid;
++ strcpy(ps->name, p.ki_comm);
++ ps->uid = p.ki_uid;
++ ps->gid = p.ki_pgid;
++
++ pwent = getpwuid(ps->uid);
++ strcpy(ps->userName, pwent ? pwent->pw_name : "????");
++ ps->priority = p.ki_priority;
++ ps->niceLevel = p.ki_nice;
++
++#else
+ ps->pid = p.kp_proc.p_pid;
+ ps->ppid = p.kp_eproc.e_ppid;
+ strcpy(ps->name, p.kp_proc.p_comm);
+@@ -198,16 +211,30 @@
+ strcpy(ps->userName, pwent ? pwent->pw_name : "????");
+ ps->priority = p.kp_proc.p_priority;
+ ps->niceLevel = p.kp_proc.p_nice;
++#endif
+
+ /* this isn't usertime -- it's total time (??) */
+-#if __FreeBSD_version >= 300000
++#if __FreeBSD_version >= 500015
++ ps->userTime = p.ki_runtime / 10000;
++#elif __FreeBSD_version >= 300000
+ ps->userTime = p.kp_proc.p_runtime / 10000;
+ #else
+ ps->userTime = p.kp_proc.p_rtime.tv_sec*100+p.kp_proc.p_rtime.tv_usec/100
+ #endif
++
+ ps->sysTime = 0;
+- ps->userLoad = p.kp_proc.p_pctcpu / 100;
+ ps->sysLoad = 0;
++#if __FreeBSD_version >= 500015
++ ps->userLoad = p.ki_pctcpu / 100;
++
++ /* memory */
++ ps->vmSize = p.ki_size * getpagesize();
++
++ ps->vmRss = p.ki_rssize * getpagesize();
++
++ ps->status = p.ki_stat;
++#else
++ ps->userLoad = p.kp_proc.p_pctcpu / 100;
+
+ /* memory */
+ ps->vmSize = (p.kp_eproc.e_vm.vm_tsize +
+@@ -216,7 +243,7 @@
+ ps->vmRss = p.kp_eproc.e_vm.vm_rssize * getpagesize();
+
+ ps->status = p.kp_proc.p_stat;
+-
++#endif
+ return (0);
+ }
+
+@@ -284,8 +311,13 @@
+ p = malloc(len);
+ sysctl(mib, 3, p, &len, NULL, 0);
+
++#if __FreeBSD_version >= 500015
++ for (num = 0; num < len / sizeof(struct kinfo_proc); num++)
++ updateProcess(p[num].ki_pid);
++#else
+ for (num = 0; num < len / sizeof(struct kinfo_proc); num++)
+ updateProcess(p[num].kp_proc.p_pid);
++#endif
+
+ cleanupProcessList();
+