pkgsrc/sysutils/libgtop/patches/patch-df
2009-07-11 13:14:13 +00:00

50 lines
1.1 KiB
Text

$NetBSD: patch-df,v 1.1 2009/07/11 13:14:13 hasso Exp $
--- sysdeps/freebsd/procstate.c.orig 2008-05-24 01:13:23 +0300
+++ sysdeps/freebsd/procstate.c 2009-07-11 15:26:10 +0300
@@ -64,6 +64,37 @@ glibtop_get_proc_state_p (glibtop *serve
return;
}
+#ifdef __DragonFly__
+ buf->uid = pinfo[0].kp_ruid;
+ buf->gid = pinfo[0].kp_rgid;
+
+ g_strlcpy (buf->cmd, pinfo[0].kp_comm, sizeof (buf->cmd));
+
+ switch (pinfo[0].kp_stat) {
+ case SACTIVE:
+ switch (pinfo[0].kp_lwp.kl_stat) {
+ case LSRUN:
+ buf->state = GLIBTOP_PROCESS_RUNNING;
+ break;
+ case LSSLEEP:
+ buf->state = GLIBTOP_PROCESS_INTERRUPTIBLE;
+ break;
+ case LSSTOP:
+ buf->state = GLIBTOP_PROCESS_STOPPED;
+ break;
+ default:
+ buf->state = 0;
+ break;
+ }
+ case SZOMB:
+ buf->state = GLIBTOP_PROCESS_ZOMBIE;
+ break;
+ case SIDL:
+ default:
+ buf->state = 0;
+ break;
+ }
+#else
buf->uid = pinfo[0].ki_ruid;
buf->gid = pinfo[0].ki_rgid;
@@ -91,6 +122,7 @@ glibtop_get_proc_state_p (glibtop *serve
buf->state = 0;
break;
}
+#endif
buf->flags = _glibtop_sysdeps_proc_state;
}