diff options
author | gdt <gdt@pkgsrc.org> | 2007-04-04 18:53:44 +0000 |
---|---|---|
committer | gdt <gdt@pkgsrc.org> | 2007-04-04 18:53:44 +0000 |
commit | 89f83020ea5293f3136eb7f295a3940ca3687315 (patch) | |
tree | 700eee8b5937f9f3fa93bf861669885450a10ef1 /sysutils/libgtop2 | |
parent | 767230c407b25ab4ad4294aaaca18763d4cd07eb (diff) | |
download | pkgsrc-89f83020ea5293f3136eb7f295a3940ca3687315.tar.gz |
Fix compilation under post-newlock2 NetBSD-current. Now
gnome-system-monitor applet seems to work. (Patch from Blair Sadewitz
on pkgsrc-users (maybe really from apb@).)
Caveat:
Switching on KERN_PROC2 sysctl define seems somewhat unclean.
All of this needs to be merged upstream.
Diffstat (limited to 'sysutils/libgtop2')
-rw-r--r-- | sysutils/libgtop2/Makefile | 4 | ||||
-rw-r--r-- | sysutils/libgtop2/distinfo | 6 | ||||
-rw-r--r-- | sysutils/libgtop2/patches/patch-am | 103 | ||||
-rw-r--r-- | sysutils/libgtop2/patches/patch-ao | 50 |
4 files changed, 136 insertions, 27 deletions
diff --git a/sysutils/libgtop2/Makefile b/sysutils/libgtop2/Makefile index 19d4f701db2..cb3ea9de625 100644 --- a/sysutils/libgtop2/Makefile +++ b/sysutils/libgtop2/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.40 2006/09/22 15:57:47 drochner Exp $ +# $NetBSD: Makefile,v 1.41 2007/04/04 18:53:44 gdt Exp $ DISTNAME= libgtop-2.14.2 PKGNAME= ${DISTNAME:S/-/2-/} -PKGREVISION= 2 +PKGREVISION= 3 CATEGORIES= sysutils gnome MASTER_SITES= ${MASTER_SITE_GNOME:=sources/libgtop/2.14/} EXTRACT_SUFX= .tar.bz2 diff --git a/sysutils/libgtop2/distinfo b/sysutils/libgtop2/distinfo index b58386e9b25..4c4b4413c5e 100644 --- a/sysutils/libgtop2/distinfo +++ b/sysutils/libgtop2/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.27 2006/09/22 15:57:47 drochner Exp $ +$NetBSD: distinfo,v 1.28 2007/04/04 18:53:44 gdt Exp $ SHA1 (libgtop-2.14.2.tar.bz2) = 20e79a58c08e06e5f5e68d8ebbd575471f754e96 RMD160 (libgtop-2.14.2.tar.bz2) = cb51f7252e015e17dcf3f1f991b36bf3e5496efe @@ -15,9 +15,9 @@ SHA1 (patch-ai) = 57d891785a45ec532757a48e77adafec091f3953 SHA1 (patch-aj) = c244b5c60e61594c3d2c0bc95e05e12ad68938db SHA1 (patch-ak) = 0a29c6b7daf1ae34b528dbb2535d05009ad61b84 SHA1 (patch-al) = cda2af81f098924be5f1fa1975c684257fc233ff -SHA1 (patch-am) = 2e10fd8096449ebc3428ef493e1ae4fe61a98e00 +SHA1 (patch-am) = 42bfab5f3e65734e98cee0c4035b17dc515514cf SHA1 (patch-an) = 57a79bddc3f0e8237b72486aa8f8906f318ca38d -SHA1 (patch-ao) = 72aa455cbc10afc6a744fd0684ec2d7a2e2c19c7 +SHA1 (patch-ao) = 456feb151050332f1bc6577363329da175499dbc SHA1 (patch-ap) = 1b842a59b821b2703b68935f59a65ffb6db3a68f SHA1 (patch-aq) = bb44484df341a009aa269fbaf5039e351e105e6c SHA1 (patch-ba) = fc99c68ec9765439bc82a38223a74bde319d26d5 diff --git a/sysutils/libgtop2/patches/patch-am b/sysutils/libgtop2/patches/patch-am index 74634680cc4..62843127ce3 100644 --- a/sysutils/libgtop2/patches/patch-am +++ b/sysutils/libgtop2/patches/patch-am @@ -1,44 +1,111 @@ -$NetBSD: patch-am,v 1.1 2006/02/28 23:48:12 joerg Exp $ +$NetBSD: patch-am,v 1.2 2007/04/04 18:53:45 gdt Exp $ ---- sysdeps/freebsd/procsignal.c.orig 2005-07-08 19:25:18.000000000 +0000 +--- sysdeps/freebsd/procsignal.c.orig 2005-12-12 10:09:39.000000000 +0000 +++ sysdeps/freebsd/procsignal.c -@@ -91,7 +91,8 @@ glibtop_get_proc_signal_p (glibtop *serv - #if defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) - buf->signal [0] = pinfo [0].kp_proc.p_sigctx.ps_siglist.__bits[0]; - #elif (defined(__NetBSD__) && (NSIG > 32)) || \ +@@ -53,7 +53,11 @@ glibtop_get_proc_signal_p (glibtop *serv + glibtop_proc_signal *buf, + pid_t pid) + { ++#if defined(KERN_PROC2) ++ struct kinfo_proc2 *pinfo; ++#else + struct kinfo_proc *pinfo; ++#endif + int count = 0; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0); +@@ -64,7 +68,12 @@ glibtop_get_proc_signal_p (glibtop *serv + if (pid == 0) return; + + /* Get the process information */ ++#if defined(KERN_PROC2) ++ pinfo = kvm_getproc2 (server->machine.kd, KERN_PROC_PID, pid, ++ sizeof(struct kinfo_proc2), &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; +@@ -77,6 +86,13 @@ glibtop_get_proc_signal_p (glibtop *serv + #define PROC_SIGIGNORE ki_sigignore + #define PROC_SIGCATCH ki_sigcatch + ++#elif defined(KERN_PROC2) ++ ++#define PROC_SIGLIST p_siglist ++#define PROC_SIGMASK p_sigmask ++#define PROC_SIGIGNORE p_sigignore ++#define PROC_SIGCATCH p_sigcatch ++ + #else + + #define PROC_SIGLIST kp_proc.p_siglist +@@ -89,11 +105,12 @@ glibtop_get_proc_signal_p (glibtop *serv + /* signal: mask of pending signals. + * pinfo [0].kp_proc.p_siglist + */ +-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) +- buf->signal [0] = pinfo [0].kp_proc.p_sigctx.ps_siglist.__bits[0]; +-#elif (defined(__NetBSD__) && (NSIG > 32)) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 400011)) ++#if (defined(__NetBSD__) && (NSIG > 32)) || \ + (defined(__FreeBSD__) && (__FreeBSD_version >= 400011)) || \ + defined(__DragonFly__) buf->signal [0] = pinfo [0].PROC_SIGLIST.__bits[0]; ++#elif defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) ++ buf->signal [0] = pinfo [0].kp_proc.p_sigctx.ps_siglist.__bits[0]; #else buf->signal [0] = pinfo [0].kp_proc.p_siglist; -@@ -103,7 +104,8 @@ glibtop_get_proc_signal_p (glibtop *serv - #if defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) - buf->blocked [0] = pinfo [0].kp_proc.p_sigctx.ps_sigmask.__bits[0]; - #elif (defined(__NetBSD__) && (NSIG > 32)) || \ + #endif +@@ -101,11 +118,12 @@ glibtop_get_proc_signal_p (glibtop *serv + /* blocked: mask of blocked signals. + * pinfo [0].kp_proc.p_sigmask + */ +-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) +- buf->blocked [0] = pinfo [0].kp_proc.p_sigctx.ps_sigmask.__bits[0]; +-#elif (defined(__NetBSD__) && (NSIG > 32)) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 400011)) ++#if (defined(__NetBSD__) && (NSIG > 32)) || \ + (defined(__FreeBSD__) && (__FreeBSD_version >= 400011)) || \ + defined(__DragonFly__) buf->blocked [0] = pinfo [0].PROC_SIGMASK.__bits[0]; ++#elif defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) ++ buf->blocked [0] = pinfo [0].kp_proc.p_sigctx.ps_sigmask.__bits[0]; #else buf->blocked [0] = pinfo [0].kp_proc.p_sigmask; -@@ -115,7 +117,8 @@ glibtop_get_proc_signal_p (glibtop *serv - #if defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) - buf->sigignore [0] = pinfo [0].kp_proc.p_sigctx.ps_sigignore.__bits[0]; - #elif (defined(__NetBSD__) && (NSIG > 32)) || \ + #endif +@@ -113,11 +131,12 @@ glibtop_get_proc_signal_p (glibtop *serv + /* sigignore: mask of ignored signals. + * pinfo [0].kp_proc.p_sigignore + */ +-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) +- buf->sigignore [0] = pinfo [0].kp_proc.p_sigctx.ps_sigignore.__bits[0]; +-#elif (defined(__NetBSD__) && (NSIG > 32)) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 400011)) ++#if (defined(__NetBSD__) && (NSIG > 32)) || \ + (defined(__FreeBSD__) && (__FreeBSD_version >= 400011)) || \ + defined(__DragonFly__) buf->sigignore [0] = pinfo [0].PROC_SIGIGNORE.__bits[0]; ++#elif defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) ++ buf->sigignore [0] = pinfo [0].kp_proc.p_sigctx.ps_sigignore.__bits[0]; #else buf->sigignore [0] = pinfo [0].kp_proc.p_sigignore; -@@ -127,7 +130,8 @@ glibtop_get_proc_signal_p (glibtop *serv - #if defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) - buf->sigcatch [0] = pinfo [0].kp_proc.p_sigctx.ps_sigcatch.__bits[0]; - #elif (defined(__NetBSD__) && (NSIG > 32)) || \ + #endif +@@ -125,11 +144,12 @@ glibtop_get_proc_signal_p (glibtop *serv + /* sigcatch: mask of caught signals. + * pinfo [0].kp_proc.p_sigcatch + */ +-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) +- buf->sigcatch [0] = pinfo [0].kp_proc.p_sigctx.ps_sigcatch.__bits[0]; +-#elif (defined(__NetBSD__) && (NSIG > 32)) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 400011)) ++#if (defined(__NetBSD__) && (NSIG > 32)) || \ + (defined(__FreeBSD__) && (__FreeBSD_version >= 400011)) || \ + defined(__DragonFly__) buf->sigcatch [0] = pinfo [0].PROC_SIGCATCH.__bits[0]; ++#elif defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) ++ buf->sigcatch [0] = pinfo [0].kp_proc.p_sigctx.ps_sigcatch.__bits[0]; #else buf->sigcatch [0] = pinfo [0].kp_proc.p_sigcatch; + #endif diff --git a/sysutils/libgtop2/patches/patch-ao b/sysutils/libgtop2/patches/patch-ao index 00f9475c55c..0edb4a6a71d 100644 --- a/sysutils/libgtop2/patches/patch-ao +++ b/sysutils/libgtop2/patches/patch-ao @@ -1,8 +1,39 @@ -$NetBSD: patch-ao,v 1.1 2006/02/28 23:48:12 joerg Exp $ +$NetBSD: patch-ao,v 1.2 2007/04/04 18:53:45 gdt Exp $ ---- sysdeps/freebsd/procuid.c.orig 2004-09-23 22:44:19.000000000 +0000 +--- sysdeps/freebsd/procuid.c.orig 2005-12-12 10:09:39.000000000 +0000 +++ sysdeps/freebsd/procuid.c -@@ -91,8 +91,17 @@ glibtop_get_proc_uid_p (glibtop *server, +@@ -53,11 +53,16 @@ void + glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, + pid_t pid) + { ++#if defined(KERN_PROC2) ++ struct kinfo_proc2 *pinfo; ++#else + struct kinfo_proc *pinfo; ++#endif + int count = 0; + + #if LIBGTOP_VERSION_CODE >= 1001000 +-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) ++#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) \ ++ && !defined(KERN_PROC2) + struct ucred ucred; + void *ucred_ptr; + #endif +@@ -71,7 +76,12 @@ glibtop_get_proc_uid_p (glibtop *server, + if (pid == 0) return; + + /* Get the process information */ ++#if defined(KERN_PROC2) ++ pinfo = kvm_getproc2 (server->machine.kd, KERN_PROC_PID, pid, ++ sizeof(struct kinfo_proc2), &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 @@ -16,12 +47,23 @@ $NetBSD: patch-ao,v 1.1 2006/02/28 23:48:12 joerg Exp $ +#define PROC_PGID kp_eproc.e_pgid +#define PROC_TPGID kp_eproc.e_tpgid +#define PROC_NICE kp_proc.p_nice ++ ++#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 +#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 -@@ -115,7 +124,7 @@ glibtop_get_proc_uid_p (glibtop *server, +@@ -116,7 +146,7 @@ glibtop_get_proc_uid_p (glibtop *server, buf->tpgid = pinfo [0].PROC_TPGID; buf->nice = pinfo [0].PROC_NICE; |