Added initial support for NetBSD /proc

This commit is contained in:
Martti Kuparinen 2005-11-06 16:33:43 +00:00 committed by Thomas Klausner
parent cc48b38543
commit 7ccaf4a914
3 changed files with 40 additions and 2 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.2 2005/10/28 20:26:21 minskim Exp $
# $NetBSD: Makefile,v 1.3 2005/11/06 16:33:43 marttikuparinen Exp $
.include "../../meta-pkgs/xfce4/Makefile.common"
@ -9,6 +9,8 @@ CATEGORIES= sysutils
MASTER_SITES= http://download.berlios.de/xfce-goodies/
COMMENT= XFce4 task manager
PKGREVISION= 1
.include "../../textproc/intltool/buildlink3.mk"
.include "../../x11/libxfce4gui/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

View file

@ -1,5 +1,6 @@
$NetBSD: distinfo,v 1.1.1.1 2005/10/27 04:43:27 dhowland Exp $
$NetBSD: distinfo,v 1.2 2005/11/06 16:33:43 marttikuparinen Exp $
SHA1 (xfce4-taskmanager-0.3.1.tar.gz) = 05f4c17c743cfdf347a481ff466e9d2fcf2042fe
RMD160 (xfce4-taskmanager-0.3.1.tar.gz) = 137e881cc683a3d871cd7197ddac8c8b328fb74c
Size (xfce4-taskmanager-0.3.1.tar.gz) = 359673 bytes
SHA1 (patch-aa) = fbf3200e866768a5d47ecb220247d08867c0c8d8

View file

@ -0,0 +1,35 @@
$NetBSD: patch-aa,v 1.1 2005/11/06 16:33:43 marttikuparinen Exp $
--- src/functions.c.orig 2005-11-06 16:15:54.000000000 +0200
+++ src/functions.c 2005-11-06 16:23:30.000000000 +0200
@@ -61,10 +61,22 @@
struct task task;
struct passwd *passwdp;
+ memset(&task, 0, sizeof(task));
if((task_file_status = fopen(task_file_name_status,"r")) != NULL)
{
while(fgets(buffer_status, sizeof buffer_status, task_file_status) != NULL)
{
+#if defined(__NetBSD__)
+ /*
+ * NetBSD: /proc/number/status
+ * init 1 0 1 1 -1,-1 sldr 1131254603,930043 0,74940 0,87430 wait 0 0,0
+ */
+ gchar dummy[255];
+
+ sscanf(buffer_status, "%s %i %i %s %s %s %s %s %s %s %s %i %s",
+ &task.name, &task.pid, &task.ppid, &dummy, &dummy, &dummy,
+ &dummy, &dummy, &dummy, &dummy, &dummy, &task.uid, &dummy);
+#else
sscanf(buffer_status,"Uid: %i",&task.uid);
sscanf(buffer_status,"Pid: %i",&task.pid);
sscanf(buffer_status,"PPid: %i",&task.ppid);
@@ -74,6 +86,7 @@
// fix for freebsd with linux emo
sscanf(buffer_status,"VmRss: %i",&task.rss);
sscanf(buffer_status,"State: %c",&task.state);
+#endif
}
passwdp = getpwuid(task.uid);