summaryrefslogtreecommitdiff
path: root/sysutils/libgtop/patches/patch-ao
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/libgtop/patches/patch-ao')
-rw-r--r--sysutils/libgtop/patches/patch-ao94
1 files changed, 48 insertions, 46 deletions
diff --git a/sysutils/libgtop/patches/patch-ao b/sysutils/libgtop/patches/patch-ao
index 72637764a62..8f75d1e6e87 100644
--- a/sysutils/libgtop/patches/patch-ao
+++ b/sysutils/libgtop/patches/patch-ao
@@ -1,74 +1,76 @@
-$NetBSD: patch-ao,v 1.3 2007/09/20 21:12:11 wiz Exp $
+$NetBSD: patch-ao,v 1.4 2007/11/05 19:06:05 drochner Exp $
---- sysdeps/freebsd/procuid.c.orig 2005-12-12 10:09:39.000000000 +0000
-+++ sysdeps/freebsd/procuid.c
-@@ -53,11 +53,16 @@ void
+--- sysdeps/bsd/procuid.c.orig 2007-04-27 00:27:34.000000000 +0200
++++ sysdeps/bsd/procuid.c
+@@ -28,6 +28,7 @@
+
+ static const unsigned long _glibtop_sysdeps_proc_uid =
+ (1L << GLIBTOP_PROC_UID_UID) + (1L << GLIBTOP_PROC_UID_EUID) +
++(1L << GLIBTOP_PROC_UID_GID) +
+ (1L << GLIBTOP_PROC_UID_EGID) + (1L << GLIBTOP_PROC_UID_PID) +
+ (1L << GLIBTOP_PROC_UID_PPID) + (1L << GLIBTOP_PROC_UID_PGRP) +
+ (1L << GLIBTOP_PROC_UID_TPGID) + (1L << GLIBTOP_PROC_UID_PRIORITY) +
+@@ -51,15 +52,21 @@ void
glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf,
pid_t pid)
{
-+#if defined(KERN_PROC2)
++#if defined (__NetBSD__)
+ struct kinfo_proc2 *pinfo;
+#else
struct kinfo_proc *pinfo;
+#endif
int count = 0;
++#if 0
#if LIBGTOP_VERSION_CODE >= 1001000
--#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
-+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) \
-+ && !defined(KERN_PROC2)
+ #if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
struct ucred ucred;
void *ucred_ptr;
#endif
-@@ -71,7 +76,12 @@ glibtop_get_proc_uid_p (glibtop *server,
+ #endif
++#endif /* 0 */
+
+ glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_UID), 0);
+
+@@ -69,7 +76,12 @@ glibtop_get_proc_uid_p (glibtop *server,
if (pid == 0) return;
/* Get the process information */
-+#if defined(KERN_PROC2)
++#if defined (__NetBSD__)
+ pinfo = kvm_getproc2 (server->machine.kd, KERN_PROC_PID, pid,
-+ sizeof(struct kinfo_proc2), &count);
++ sizeof (*pinfo), &count);
+#else
pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count);
+#endif
if ((pinfo == NULL) || (count != 1)) {
glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid);
return;
-@@ -92,8 +102,28 @@ glibtop_get_proc_uid_p (glibtop *server,
- #else
- #define PROC_PRIORITY ki_priority
- #endif
--#else
-+#elif defined(__DragonFly__)
-+#define PROC_RUID kp_eproc.e_ucred.cr_ruid
-+#define PROC_SVUID kp_eproc.e_ucred.cr_svuid
-+#define PROC_RGID kp_eproc.e_ucred.cr_rgid
-+#define PROC_SVGID kp_eproc.e_ucred.cr_svgid
-+#define PROC_PPID kp_eproc.e_ppid
-+#define PROC_PGID kp_eproc.e_pgid
-+#define PROC_TPGID kp_eproc.e_tpgid
-+#define PROC_NICE kp_proc.p_nice
+@@ -86,6 +98,20 @@ glibtop_get_proc_uid_p (glibtop *server,
+ #define PROC_TPGID ki_tpgid
+ #define PROC_NICE ki_nice
+ #define PROC_PRIORITY ki_pri.pri_user
++
++#elif defined (__NetBSD__)
+
-+#elif defined(KERN_PROC2) /* && defined(__NetBSD__) ? */
-+#define PROC_RUID p_ruid
-+#define PROC_SVUID p_svuid
-+#define PROC_RGID p_rgid
-+#define PROC_SVGID p_svgid
-+#define PROC_PPID p_ppid
-+#define PROC_PGID p__pgid
-+#define PROC_TPGID p_tpgid
-+#define PROC_NICE p_nice
-+#define PROC_PRIORITY p_priority
++#define PROC_RUID p_ruid
++#define PROC_SVUID p_svuid
++#define PROC_RGID p_rgid
++#define PROC_SVGID p_svgid
++#define PROC_PID p_pid
++#define PROC_PPID p_ppid
++#define PROC_PGID p__pgid
++#define PROC_TPGID p_tpgid
++#define PROC_NICE p_nice
++#define PROC_PRIORITY p_priority
++
+ #else
-+#else
#define PROC_RUID kp_eproc.e_pcred.p_ruid
- #define PROC_SVUID kp_eproc.e_pcred.p_svuid
- #define PROC_RGID kp_eproc.e_pcred.p_rgid
-@@ -116,7 +146,7 @@ glibtop_get_proc_uid_p (glibtop *server,
- buf->tpgid = pinfo [0].PROC_TPGID;
+@@ -105,6 +131,7 @@ glibtop_get_proc_uid_p (glibtop *server,
+ buf->gid = pinfo [0].PROC_RGID;
+ buf->egid = pinfo [0].PROC_SVGID;
- buf->nice = pinfo [0].PROC_NICE;
--#if defined(__NetBSD__) && defined(SACTIVE)
-+#if defined(__DragonFly__) || (defined(__NetBSD__) && defined(SACTIVE))
- buf->priority = 0;
- #else
- buf->priority = pinfo [0].PROC_PRIORITY;
++ buf->pid = pinfo [0].PROC_PID;
+ buf->ppid = pinfo [0].PROC_PPID;
+ buf->pgrp = pinfo [0].PROC_PGID;
+ buf->tpgid = pinfo [0].PROC_TPGID;