mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-26 09:46:09 +00:00
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
This commit is contained in:
parent
6ffeb34bef
commit
8fdc4ba31e
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=37671
80
x11/kde4-baseapps/files/patch-Processlist.c
Normal file
80
x11/kde4-baseapps/files/patch-Processlist.c
Normal file
@ -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();
|
||||
|
80
x11/kde4-runtime/files/patch-Processlist.c
Normal file
80
x11/kde4-runtime/files/patch-Processlist.c
Normal file
@ -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();
|
||||
|
80
x11/kde4-workspace/files/patch-Processlist.c
Normal file
80
x11/kde4-workspace/files/patch-Processlist.c
Normal file
@ -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();
|
||||
|
80
x11/kdebase2/files/patch-Processlist.c
Normal file
80
x11/kdebase2/files/patch-Processlist.c
Normal file
@ -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();
|
||||
|
80
x11/kdebase3/files/patch-Processlist.c
Normal file
80
x11/kdebase3/files/patch-Processlist.c
Normal file
@ -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();
|
||||
|
80
x11/kdebase4-runtime/files/patch-Processlist.c
Normal file
80
x11/kdebase4-runtime/files/patch-Processlist.c
Normal file
@ -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();
|
||||
|
80
x11/kdebase4-workspace/files/patch-Processlist.c
Normal file
80
x11/kdebase4-workspace/files/patch-Processlist.c
Normal file
@ -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();
|
||||
|
80
x11/kdebase4/files/patch-Processlist.c
Normal file
80
x11/kdebase4/files/patch-Processlist.c
Normal file
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user