DragonFly users List (threaded) for 2007-02
DragonFly BSD
DragonFly users List (threaded) for 2007-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: x11/kdebase-3.5.6 compiled


From: ejc <eric.j.christeson@xxxxxxxxx>
Date: Thu, 22 Feb 2007 16:38:48 -0600

On 2/22/07, ejc <eric.j.christeson@gmail.com> wrote:
I just finished hacking my local copy so it will work with the new
structures -- it compiles anyway :-)
Let me know if you want a patch after I test it out.

Patch attached. It's against 3.5.5, but ProcessList.c didn't change for 3.5.6


Eric
--- ksysguard/ksysguardd/FreeBSD/ProcessList.c.orig	2007-02-22 16:31:59.000000000 -0600
+++ ksysguard/ksysguardd/FreeBSD/ProcessList.c	2007-02-22 16:31:39.000000000 -0600
@@ -213,23 +213,42 @@
         ps->priority  = p.ki_pri.pri_user;
         ps->niceLevel = p.ki_nice;
 #else
+#if __DragonFly_version >= 190000
+        ps->pid       = p.kp_pid;
+        ps->ppid      = p.kp_ppid;
+        ps->gid       = p.kp_pgid;
+        ps->uid       = p.kp_uid;
+#else
         ps->pid       = p.kp_proc.p_pid;
         ps->ppid      = p.kp_eproc.e_ppid;
         ps->uid       = p.kp_eproc.e_ucred.cr_uid;
         ps->gid       = p.kp_eproc.e_pgid;
+#endif  /* DFly version */
 #if defined(__DragonFly__)
+#if __DragonFly_version >= 190000
+        ps->priority  = p.kp_lwp.kl_prio;
+#else
         ps->priority  = p.kp_thread.td_pri;
+#endif  /* DFly version */
 #else
         ps->priority  = p.kp_proc.p_priority;
 #endif
+#if __DragonFly_version >= 190000
+        ps->niceLevel = p.kp_nice;
+#else
         ps->niceLevel = p.kp_proc.p_nice;
+#endif  /* DFly version */
 #endif
 
         /* this isn't usertime -- it's total time (??) */
 #if __FreeBSD_version >= 500015
         ps->userTime = p.ki_runtime / 10000;
 #elif defined(__DragonFly__)
+#if __DragonFly_version >= 190000
+	if (!getrusage(p.kp_pid, &pru))
+#else
 	if (!getrusage(p.kp_proc.p_pid, &pru))
+#endif  /* DFly version */
 	{
 		errx(1, "failed to get rusage info");
 	}
@@ -258,16 +277,31 @@
 	strlcpy(ps->name,p.ki_comm? p.ki_comm:"????",sizeof(ps->name));
 	strcpy(ps->status,(p.ki_stat>=1)&&(p.ki_stat<=5)? statuses[p.ki_stat-1]:"????");
 #else
+#if __DragonFly_version >= 190000
+		ps->userLoad = 100.0 * (double) p.kp_lwp.kl_pctcpu / fscale;
+	ps->vmSize   = p.kp_vm_map_size;
+	ps->vmRss    = p.kp_vm_rssize * getpagesize();
+#else
 		ps->userLoad = 100.0 * (double) p.kp_proc.p_pctcpu / fscale;
 	ps->vmSize   = p.kp_eproc.e_vm.vm_map.size;
 	ps->vmRss    = p.kp_eproc.e_vm.vm_rssize * getpagesize();
+#endif  /* DFly version */
 #if defined (__DragonFly__)
+#if __DragonFly_version >= 190000
+	strlcpy(ps->name,p.kp_comm ? p.kp_comm : "????", 
+		sizeof(ps->name));
+#else
 	strlcpy(ps->name,p.kp_thread.td_comm ? p.kp_thread.td_comm : "????", 
 		sizeof(ps->name));
+#endif  /* DFly version */
 #else
 	strlcpy(ps->name,p.kp_proc.p_comm ? p.kp_proc.p_comm : "????", sizeof(ps->name));
 #endif
+#if __DragonFly_version >= 190000
+	strcpy(ps->status,(p.kp_stat>=1)&&(p.kp_stat<=5)? statuses[p.kp_stat-1]:"????");
+#else
 	strcpy(ps->status,(p.kp_proc.p_stat>=1)&&(p.kp_proc.p_stat<=5)? statuses[p.kp_proc.p_stat-1]:"????");
+#endif  /* DFly version */
 #endif
 
         /* process command line */
@@ -368,7 +402,11 @@
 #if __FreeBSD_version >= 500015
 		updateProcess(p[num].ki_pid);
 #else
+#if __DragonFly_version >= 190000
+		updateProcess(p[num].kp_pid);
+#else
 		updateProcess(p[num].kp_proc.p_pid);
+#endif  /* DFly version */
 #endif
 	free(p);
 	cleanupProcessList();


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]