kdebase patch

Dave Leimbach leimySPAM2k at mac.com
Tue Dec 16 21:31:47 PST 2003


This patch builds kdebase out of CVS.

Thanks to Dave Rhodus for his help on it and the other fine folks hanging
out in #dragonflybsd on Efnet.
----------------------------------------------------------------------

? configure.lineno
Index: kcontrol/kfontinst/lib/GetPid.c
===================================================================
RCS file: /home/kde/kdebase/kcontrol/kfontinst/lib/GetPid.c,v
retrieving revision 1.8
diff -u -r1.8 GetPid.c
--- kcontrol/kfontinst/lib/GetPid.c     15 Dec 2003 14:05:16 -0000      1.8
+++ kcontrol/kfontinst/lib/GetPid.c     17 Dec 2003 05:24:10 -0000
@@ -31,7 +31,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/param.h>
 #include <sys/types.h>
+#include <sys/user.h>

 #ifndef __cplusplus
 #define bool unsigned int
@@ -210,7 +212,8 @@
                 else
                     pid=p[num].ki_pid;
 #else
-            if(proc_p.kp_eproc.e_ppid==ppid && p[num].kp_proc.p_comm && 0==str
cmp(p[num].kp_proc.p_comm, proc))
+/*            if(proc_p.kp_eproc.e_ppid==ppid && p[num].kp_proc.p_comm && 0==s
trcmp(p[num].kp_proc.p_comm, proc))*/
+               if(proc_p.kp_eproc.e_ppid==ppid && p[num].kp_thread.td_comm &&
0==strcmp(p[num].kp_thread.td_comm, proc))
                 if(pid)
                     error=true;
                 else
Index: ksysguard/ksysguardd/FreeBSD/ProcessList.c
===================================================================
RCS file: /home/kde/kdebase/ksysguard/ksysguardd/FreeBSD/ProcessList.c,v
retrieving revision 1.15
diff -u -r1.15 ProcessList.c
--- ksysguard/ksysguardd/FreeBSD/ProcessList.c  28 Jun 2003 10:31:38 -0000
1.15
+++ ksysguard/ksysguardd/FreeBSD/ProcessList.c  17 Dec 2003 05:24:19 -0000
@@ -30,6 +30,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/param.h>
+#include <sys/user.h>
+#include <sys/resourcevar.h>
 #if __FreeBSD_version > 500015
 #include <sys/priority.h>
 #endif
@@ -110,7 +112,7 @@
         * good idea. I never thought that the stability of UNIX could get me
         * into trouble! ;)
         */
-       unsigned int userTime;
+       long userTime;

        /*
         * The number of 1/100 of a second the process has spend in system spac
e.
@@ -169,6 +171,7 @@
        struct passwd* pwent;
        int mib[4];
        struct kinfo_proc p;
+       struct rusage pru;
        size_t len;

        if ((ps = findProcessInList(pid)) == 0)
@@ -211,7 +214,11 @@
 #if __FreeBSD_version >= 500015
         ps->userTime = p.ki_runtime / 10000;
 #elif __FreeBSD_version >= 300000
-        ps->userTime = p.kp_proc.p_runtime / 10000;
+       if (!getrusage(p.kp_proc.p_pid,&pru))
+       {
+               errx(1, "failed to get rusage info");
+       }
+       ps->userTime = pru.ru_utime.tv_usec / 1000; /*p_runtime / 1000*/
 #else
        ps->userTime = p.kp_proc.p_rtime.tv_sec*100+p.kp_proc.p_rtime.tv_usec/1
00;
 #endif
@@ -238,7 +245,8 @@
                        p.kp_eproc.e_vm.vm_dsize +
                        p.kp_eproc.e_vm.vm_ssize) * getpagesize();
        ps->vmRss    = p.kp_eproc.e_vm.vm_rssize * getpagesize();
-       strlcpy(ps->name,p.kp_proc.p_comm ? p.kp_proc.p_comm : "????", sizeof(p
s->name));
+       /*strlcpy(ps->name,p.kp_proc.p_comm ? p.kp_proc.p_comm : "????", sizeof
(ps->name));*/
+       strncpy(ps->name,p.kp_thread.td_comm ? p.kp_thread.td_comm : "????", si
zeof(ps->name));
        strcpy(ps->status,(p.kp_proc.p_stat>=1)&&(p.kp_proc.p_stat<=5)? statuse
s[p.kp_proc.p_stat-1]:"????");
 #endif
----------------------------------------------------------------------

Thanks again... Its working well here. :)

Dave






More information about the Kernel mailing list