diff --git a/devel/libgtop2/Makefile b/devel/libgtop2/Makefile index 14d7afd3174..678cb09162f 100644 --- a/devel/libgtop2/Makefile +++ b/devel/libgtop2/Makefile @@ -1,11 +1,11 @@ -# $OpenBSD: Makefile,v 1.29 2007/12/28 14:31:52 jasper Exp $ +# $OpenBSD: Makefile,v 1.30 2008/02/09 16:52:24 ajacoutot Exp $ COMMENT= portable library for obtaining system information -GNOME_VERSION= 2.14.6 +GNOME_VERSION= 2.20.1 GNOME_PROJECT= libgtop -PKGNAME= libgtop2-${VERSION}p3 -SHARED_LIBS= gtop-2.0 7.0 # .7.0 +PKGNAME= libgtop2-${VERSION} +SHARED_LIBS= gtop-2.0 8.0 # .7.0 CATEGORIES= devel @@ -14,18 +14,18 @@ PERMIT_PACKAGE_CDROM= Yes PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes + WANTLIB= Xau c kvm pcre MODULES= devel/gettext \ x11/gnome -LIB_DEPENDS= glib-2.0::devel/glib2 \ - popt::devel/popt +LIB_DEPENDS= glib-2.0::devel/glib2 -USE_GMAKE= Yes USE_X11= Yes CONFIGURE_STYLE= gnu -CONFIGURE_ARGS+= ${CONFIGURE_SHARED} +CONFIGURE_ARGS+= ${CONFIGURE_SHARED} \ + --without-libgtop-smp CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ LDFLAGS="-L${LOCALBASE}/lib" \ GMSGFMT="${LOCALBASE}/bin/msgfmt" diff --git a/devel/libgtop2/distinfo b/devel/libgtop2/distinfo index 0ffde6e082d..d2e55bd204a 100644 --- a/devel/libgtop2/distinfo +++ b/devel/libgtop2/distinfo @@ -1,5 +1,5 @@ -MD5 (libgtop-2.14.6.tar.bz2) = SqQlprZrl2vm82SQTu2nig== -RMD160 (libgtop-2.14.6.tar.bz2) = gcBUTUO2gNszupLlTvRoim7UBjs= -SHA1 (libgtop-2.14.6.tar.bz2) = v0NpfYuavNy+HZqf7tSI1v0TDr8= -SHA256 (libgtop-2.14.6.tar.bz2) = LT/GFOKknjJwEDezJF0jO1tErF3Q9h258J18hjV5Lzk= -SIZE (libgtop-2.14.6.tar.bz2) = 758165 +MD5 (libgtop-2.20.1.tar.bz2) = tvpnHoMlvY285oRSd5EiWg== +RMD160 (libgtop-2.20.1.tar.bz2) = Jz+s/g6sSTlEXLCt27cZz+AsJDQ= +SHA1 (libgtop-2.20.1.tar.bz2) = fzHabLZ624+2f4z1qrLjlfwMHDs= +SHA256 (libgtop-2.20.1.tar.bz2) = Hk2c3t7lEFyZp78zY+m8N1v/gpI+JPVeR1BQk39IITU= +SIZE (libgtop-2.20.1.tar.bz2) = 770145 diff --git a/devel/libgtop2/patches/patch-Makefile_in b/devel/libgtop2/patches/patch-Makefile_in index 4e7a73bcab1..e86cc51825c 100644 --- a/devel/libgtop2/patches/patch-Makefile_in +++ b/devel/libgtop2/patches/patch-Makefile_in @@ -1,6 +1,6 @@ -$OpenBSD: patch-Makefile_in,v 1.1 2007/01/18 19:31:34 jasper Exp $ ---- Makefile.in.orig Thu Jan 11 21:37:47 2007 -+++ Makefile.in Wed Jan 17 08:48:30 2007 +$OpenBSD: patch-Makefile_in,v 1.2 2008/02/09 16:52:25 ajacoutot Exp $ +--- Makefile.in.orig Sat Jan 5 14:50:07 2008 ++++ Makefile.in Mon Jan 28 10:12:34 2008 @@ -804,8 +804,8 @@ uninstall-info: uninstall-info-recursive dist-hook: cp libgtop.spec $(distdir) diff --git a/devel/libgtop2/patches/patch-configure b/devel/libgtop2/patches/patch-configure index ec975365104..415acf2a32f 100644 --- a/devel/libgtop2/patches/patch-configure +++ b/devel/libgtop2/patches/patch-configure @@ -1,14 +1,14 @@ -$OpenBSD: patch-configure,v 1.3 2007/12/28 14:31:52 jasper Exp $ ---- configure.orig Thu Jan 11 21:37:51 2007 -+++ configure Fri Dec 28 15:29:17 2007 -@@ -6185,6 +6185,16 @@ freebsd* | dragonfly*) +$OpenBSD: patch-configure,v 1.4 2008/02/09 16:52:25 ajacoutot Exp $ +--- configure.orig Sat Jan 5 14:49:53 2008 ++++ configure Sat Feb 2 00:21:13 2008 +@@ -6192,6 +6192,16 @@ freebsd* | dragonfly*) fi ;; +openbsd*) + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` -+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then ++ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' + else + lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' @@ -18,23 +18,15 @@ $OpenBSD: patch-configure,v 1.3 2007/12/28 14:31:52 jasper Exp $ gnu*) lt_cv_deplibs_check_method=pass_all ;; -@@ -20874,7 +20884,6 @@ echo $ECHO_N "checking for libgtop sysdeps directory.. - libgtop_sysdeps_dir=freebsd +@@ -21132,7 +21142,6 @@ echo $ECHO_N "checking for libgtop sysdeps directory.. + libgtop_sysdeps_dir=bsd libgtop_use_machine_h=yes libgtop_need_server=yes -- libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server && chmod 2755 $(bindir)/libgtop_server' +- libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server2 && chmod 2755 $(bindir)/libgtop_server2' ;; - solaris*) - libgtop_sysdeps_dir=solaris -@@ -21382,6 +21391,7 @@ else - for def in nothing KERNEL _KERNEL; do - cat >conftest.$ac_ext <<_ACEOF - #define $def -+#include - #include - #include - #include -@@ -26161,7 +26171,7 @@ if test "${ac_cv_lib_intl_strftime+set}" = set; then + freebsd*|kfreebsd*) + libgtop_sysdeps_dir=freebsd +@@ -26192,7 +26201,7 @@ if test "${ac_cv_lib_intl_strftime+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS @@ -43,39 +35,50 @@ $OpenBSD: patch-configure,v 1.3 2007/12/28 14:31:52 jasper Exp $ cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF -@@ -26221,7 +26231,7 @@ if test $ac_cv_lib_intl_strftime = yes; then - #define HAVE_STRFTIME 1 - _ACEOF - --LIBS="-lintl $LIBS" -+LIBS="-lintl -liconv $LIBS" - fi - - fi -@@ -27365,7 +27375,7 @@ if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; +@@ -27368,7 +27377,7 @@ if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $LIBS" -+LIBS="-lintl -liconv $LIBS" ++LIBS="-lintl -liconv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF -@@ -27701,7 +27711,7 @@ fi - # - if test "$gt_cv_func_dgettext_libintl" = "yes" ; then - glib_save_LIBS="$LIBS" -- LIBS="$LIBS -lintl $libintl_extra_libs" -+ LIBS="$LIBS -lintl -liconv $libintl_extra_libs" - unset ac_cv_func_bind_textdomain_codeset - - for ac_func in bind_textdomain_codeset -@@ -27816,7 +27826,7 @@ done - fi - - if test "$gt_cv_func_dgettext_libintl" = "yes"; then -- INTLLIBS="-lintl $libintl_extra_libs" -+ INTLLIBS="-lintl -liconv $libintl_extra_libs" - fi - - if test "$gt_cv_have_gettext" = "yes"; then +@@ -27430,7 +27439,7 @@ if test "${ac_cv_lib_intl_ngettext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lintl $LIBS" ++LIBS="-lintl -liconv $LIBS" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +@@ -27492,7 +27501,7 @@ if test "${ac_cv_lib_intl_dgettext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lintl $LIBS" ++LIBS="-lintl -liconv $LIBS" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +@@ -28326,11 +28335,7 @@ glib_save_datarootdir="$datarootdir" + test "x$prefix" = xNONE && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix=$prefix + datarootdir=`eval echo "${datarootdir}"` +-if test "x$CATOBJEXT" = "x.mo" ; then +- localedir=`eval echo "${libdir}/locale"` +-else + localedir=`eval echo "${datadir}/locale"` +-fi + prefix="$glib_save_prefix" + exec_prefix="$glib_save_exec_prefix" + datarootdir="$glib_save_datarootdir" +@@ -30388,6 +30393,7 @@ _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ ++#include + $ac_includes_default + #include <$ac_header> + _ACEOF diff --git a/devel/libgtop2/patches/patch-lib_open_c b/devel/libgtop2/patches/patch-lib_open_c index c26ab6830a4..200071008b1 100644 --- a/devel/libgtop2/patches/patch-lib_open_c +++ b/devel/libgtop2/patches/patch-lib_open_c @@ -1,7 +1,7 @@ -$OpenBSD: patch-lib_open_c,v 1.5 2007/12/28 14:31:52 jasper Exp $ ---- lib/open.c.orig Tue Jan 2 23:50:29 2007 -+++ lib/open.c Fri Dec 28 15:29:17 2007 -@@ -112,7 +112,7 @@ glibtop_open_l (glibtop *server, const char *program_n +$OpenBSD: patch-lib_open_c,v 1.6 2008/02/09 16:52:25 ajacoutot Exp $ +--- lib/open.c.orig Sun Sep 16 15:04:03 2007 ++++ lib/open.c Fri Dec 28 18:53:16 2007 +@@ -110,7 +110,7 @@ glibtop_open_l (glibtop *server, const char *program_n close (server->input [0]); close (server->output [1]); dup2 (server->input [1], 1); dup2 (server->output [0], 0); diff --git a/devel/libgtop2/patches/patch-src_daemon_gnuserv_c b/devel/libgtop2/patches/patch-src_daemon_gnuserv_c index 4152eff3bde..af4400fca2f 100644 --- a/devel/libgtop2/patches/patch-src_daemon_gnuserv_c +++ b/devel/libgtop2/patches/patch-src_daemon_gnuserv_c @@ -1,7 +1,7 @@ -$OpenBSD: patch-src_daemon_gnuserv_c,v 1.2 2007/02/21 17:27:54 steven Exp $ ---- src/daemon/gnuserv.c.orig Tue Jan 2 23:50:27 2007 -+++ src/daemon/gnuserv.c Sun Feb 18 20:23:18 2007 -@@ -207,6 +207,12 @@ permitted (u_long host_addr, int fd) +$OpenBSD: patch-src_daemon_gnuserv_c,v 1.3 2008/02/09 16:52:25 ajacoutot Exp $ +--- src/daemon/gnuserv.c.orig Sat May 12 23:54:57 2007 ++++ src/daemon/gnuserv.c Fri Dec 28 18:53:17 2007 +@@ -206,6 +206,12 @@ permitted (u_long host_addr, int fd) return FALSE; } diff --git a/devel/libgtop2/patches/patch-sysdeps_bsd_fsusage_c b/devel/libgtop2/patches/patch-sysdeps_bsd_fsusage_c new file mode 100644 index 00000000000..52402e222c8 --- /dev/null +++ b/devel/libgtop2/patches/patch-sysdeps_bsd_fsusage_c @@ -0,0 +1,13 @@ +$OpenBSD: patch-sysdeps_bsd_fsusage_c,v 1.1 2008/02/09 16:52:25 ajacoutot Exp $ +--- sysdeps/bsd/fsusage.c.orig Sat Feb 2 21:06:25 2008 ++++ sysdeps/bsd/fsusage.c Sat Feb 2 21:07:11 2008 +@@ -55,7 +55,8 @@ _glibtop_bsd_get_fsusage_read_write(glibtop *server, + + #if !defined(__OpenBSD__) + buf->read = sfs.f_syncreads + sfs.f_asyncreads; ++ buf->flags |= (1 << GLIBTOP_FSUSAGE_READ); + #endif + buf->write = sfs.f_syncwrites + sfs.f_asyncwrites; +- buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE); ++ buf->flags |= (1 << GLIBTOP_FSUSAGE_WRITE); + } diff --git a/devel/libgtop2/patches/patch-sysdeps_bsd_glibtop_server_h b/devel/libgtop2/patches/patch-sysdeps_bsd_glibtop_server_h new file mode 100644 index 00000000000..7c19e010d7d --- /dev/null +++ b/devel/libgtop2/patches/patch-sysdeps_bsd_glibtop_server_h @@ -0,0 +1,11 @@ +$OpenBSD: patch-sysdeps_bsd_glibtop_server_h,v 1.1 2008/02/09 16:52:25 ajacoutot Exp $ +--- sysdeps/bsd/glibtop_server.h.orig Sun Dec 30 19:35:57 2007 ++++ sysdeps/bsd/glibtop_server.h Sun Dec 30 19:36:12 2007 +@@ -42,6 +42,7 @@ G_BEGIN_DECLS + #define GLIBTOP_SUID_PROC_SEGMENT (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT) + #define GLIBTOP_SUID_PROC_ARGS (1 << GLIBTOP_SYSDEPS_PROC_ARGS) + #define GLIBTOP_SUID_PROC_MAP (1 << GLIBTOP_SYSDEPS_PROC_MAP) ++#define GLIBTOP_SUID_PROC_WD 0 + #define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) + #define GLIBTOP_SUID_NETLIST 0 + #define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP) diff --git a/devel/libgtop2/patches/patch-sysdeps_bsd_mem_c b/devel/libgtop2/patches/patch-sysdeps_bsd_mem_c new file mode 100644 index 00000000000..68dcdcc644f --- /dev/null +++ b/devel/libgtop2/patches/patch-sysdeps_bsd_mem_c @@ -0,0 +1,11 @@ +$OpenBSD: patch-sysdeps_bsd_mem_c,v 1.1 2008/02/09 16:52:25 ajacoutot Exp $ +--- sysdeps/bsd/mem.c.orig Fri Dec 28 16:31:10 2007 ++++ sysdeps/bsd/mem.c Fri Dec 28 16:31:45 2007 +@@ -34,6 +34,7 @@ + + #if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__) + #include ++#include + #endif + + static const unsigned long _glibtop_sysdeps_mem = diff --git a/devel/libgtop2/patches/patch-sysdeps_bsd_procargs_c b/devel/libgtop2/patches/patch-sysdeps_bsd_procargs_c new file mode 100644 index 00000000000..e7f736fa4af --- /dev/null +++ b/devel/libgtop2/patches/patch-sysdeps_bsd_procargs_c @@ -0,0 +1,54 @@ +$OpenBSD: patch-sysdeps_bsd_procargs_c,v 1.1 2008/02/09 16:52:25 ajacoutot Exp $ +--- sysdeps/bsd/procargs.c.orig Mon Jan 28 14:59:01 2008 ++++ sysdeps/bsd/procargs.c Mon Jan 28 15:01:26 2008 +@@ -47,12 +47,16 @@ char * + glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf, + pid_t pid, unsigned max_len) + { ++#if defined(__OpenBSD__) ++ struct kinfo_proc2 *pinfo; ++#else + struct kinfo_proc *pinfo; ++#endif + char *retval, **args, **ptr; + size_t size = 0, pos = 0; + int count; + +-#ifndef __bsdi__ ++#if !defined(__bsdi__) && !defined(__OpenBSD__) + char filename [BUFSIZ]; + struct stat statb; + #endif +@@ -64,7 +68,7 @@ glibtop_get_proc_args_p (glibtop *server, glibtop_proc + /* swapper, init, pagedaemon, vmdaemon, update - this doen't work. */ + if (pid < 5) return NULL; + +-#ifndef __bsdi__ ++#if !defined(__bsdi__) && !defined(__OpenBSD__) + sprintf (filename, "/proc/%d/mem", pid); + if (stat (filename, &statb)) return NULL; + #endif +@@ -72,14 +76,23 @@ glibtop_get_proc_args_p (glibtop *server, glibtop_proc + glibtop_suid_enter (server); + + /* Get the process data */ ++#if defined(__OpenBSD__) ++ pinfo = kvm_getproc2 (server->machine.kd, KERN_PROC_PID, pid, ++ sizeof (*pinfo), &count); ++#else + pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count); ++#endif + if ((pinfo == NULL) || (count < 1)) { + glibtop_suid_leave (server); + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return NULL; + } + ++#if defined(__OpenBSD__) ++ args = kvm_getargv2 (server->machine.kd, pinfo, max_len); ++#else + args = kvm_getargv (server->machine.kd, pinfo, max_len); ++#endif + if (args == NULL) { + glibtop_suid_leave (server); + glibtop_warn_io_r (server, "kvm_getargv (%d)", pid); diff --git a/devel/libgtop2/patches/patch-sysdeps_bsd_prockernel_c b/devel/libgtop2/patches/patch-sysdeps_bsd_prockernel_c new file mode 100644 index 00000000000..959ad0d8137 --- /dev/null +++ b/devel/libgtop2/patches/patch-sysdeps_bsd_prockernel_c @@ -0,0 +1,114 @@ +$OpenBSD: patch-sysdeps_bsd_prockernel_c,v 1.1 2008/02/09 16:52:25 ajacoutot Exp $ +--- sysdeps/bsd/prockernel.c.orig Thu Sep 27 22:34:55 2007 ++++ sysdeps/bsd/prockernel.c Mon Jan 28 15:18:44 2008 +@@ -34,7 +34,7 @@ + #include + #endif + #if !defined(__bsdi__) && !(defined(__FreeBSD__) && defined(__alpha__)) && \ +- !defined(__NetBSD__) ++ !defined(__NetBSD__) && !defined(__OpenBSD__) + #include + #endif + +@@ -64,13 +64,18 @@ + + static const unsigned long _glibtop_sysdeps_proc_kernel_pstats = + (1L << GLIBTOP_PROC_KERNEL_MIN_FLT) + +-(1L << GLIBTOP_PROC_KERNEL_MAJ_FLT) + +-(1L << GLIBTOP_PROC_KERNEL_CMIN_FLT) + +-(1L << GLIBTOP_PROC_KERNEL_CMAJ_FLT); ++(1L << GLIBTOP_PROC_KERNEL_MAJ_FLT) ++#if !defined(__OpenBSD__) +++ (1L << GLIBTOP_PROC_KERNEL_CMIN_FLT) + ++(1L << GLIBTOP_PROC_KERNEL_CMAJ_FLT) ++#endif ++; + ++#if !defined(__OpenBSD__) + static const unsigned long _glibtop_sysdeps_proc_kernel_pcb = + (1L << GLIBTOP_PROC_KERNEL_KSTK_EIP) + + (1L << GLIBTOP_PROC_KERNEL_KSTK_ESP); ++#endif + + static const unsigned long _glibtop_sysdeps_proc_kernel_wchan = + (1L << GLIBTOP_PROC_KERNEL_NWCHAN) + +@@ -82,7 +87,9 @@ void + _glibtop_init_proc_kernel_p (glibtop *server) + { + server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel_pstats | ++#if !defined(__OpenBSD__) + _glibtop_sysdeps_proc_kernel_pcb | ++#endif + _glibtop_sysdeps_proc_kernel_wchan; + } + +@@ -91,12 +98,16 @@ glibtop_get_proc_kernel_p (glibtop *server, + glibtop_proc_kernel *buf, + pid_t pid) + { ++#if defined(__OpenBSD__) ++ struct kinfo_proc2 *pinfo; ++#else + struct kinfo_proc *pinfo; + #if !(defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) + struct user *u_addr = (struct user *)USRSTACK; + struct pstats pstats; + struct pcb pcb; +-#endif ++#endif /* --FreeBSD__ */ ++#endif /* __OpenBSD__ */ + int count; + + char filename [BUFSIZ]; +@@ -113,7 +124,12 @@ glibtop_get_proc_kernel_p (glibtop *server, + if (pid == 0) return; + + /* Get the process information */ ++#if defined(__OpenBSD__) ++ pinfo = kvm_getproc2 (server->machine.kd, KERN_PROC_PID, pid, ++ sizeof(*pinfo), &count); ++#else + pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count); ++#endif /* __OpenBSD__ */ + if ((pinfo == NULL) || (count != 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + return; +@@ -125,6 +141,9 @@ glibtop_get_proc_kernel_p (glibtop *server, + #define PROC_WMESG ki_wmesg + #define PROC_WMESG ki_wmesg + ++#elif defined(__OpenBSD__) ++/* empty, not for too long though! */ ++ + #else + + #define PROC_WCHAN kp_proc.p_wchan +@@ -133,6 +152,21 @@ glibtop_get_proc_kernel_p (glibtop *server, + + #endif + ++#if defined(__OpenBSD__) ++ ++ buf->nwchan = pinfo[0].p_wchan; ++ if (pinfo[0].p_wchan && pinfo[0].p_wmesg) ++ g_strlcpy(buf->wchan, pinfo[0].p_wmesg, ++ sizeof buf->wchan); ++ ++ buf->min_flt = pinfo[0].p_uru_minflt; ++ buf->maj_flt = pinfo[0].p_uru_majflt; ++ ++ buf->flags |= (_glibtop_sysdeps_proc_kernel_wchan ++ | _glibtop_sysdeps_proc_kernel_pstats); ++ ++#else ++ + #if !defined(__NetBSD__) || !defined(SACTIVE) + buf->nwchan = (unsigned long) pinfo [0].PROC_WCHAN &~ KERNBASE; + +@@ -267,4 +301,6 @@ glibtop_get_proc_kernel_p (glibtop *server, + */ + return; + #endif /* __FreeBSD__ */ ++ ++#endif /* __OpenBSD */ + } diff --git a/devel/libgtop2/patches/patch-sysdeps_bsd_proclist_c b/devel/libgtop2/patches/patch-sysdeps_bsd_proclist_c new file mode 100644 index 00000000000..d3c2f6af6ac --- /dev/null +++ b/devel/libgtop2/patches/patch-sysdeps_bsd_proclist_c @@ -0,0 +1,47 @@ +$OpenBSD: patch-sysdeps_bsd_proclist_c,v 1.1 2008/02/09 16:52:25 ajacoutot Exp $ +--- sysdeps/bsd/proclist.c.orig Fri Dec 28 19:03:21 2007 ++++ sysdeps/bsd/proclist.c Fri Dec 28 19:16:25 2007 +@@ -56,11 +56,15 @@ _glibtop_init_proclist_p (glibtop *server) + server->sysdeps.proclist = _glibtop_sysdeps_proclist; + } + +-unsigned * ++pid_t * + glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf, + gint64 real_which, gint64 arg) + { ++#if defined(__OpenBSD__) ++ struct kinfo_proc2 *pinfo; ++#else + struct kinfo_proc *pinfo; ++#endif + unsigned *pids = NULL; + int which, count; + int i,j; +@@ -72,7 +76,12 @@ glibtop_get_proclist_p (glibtop *server, glibtop_procl + which = (int)(real_which & GLIBTOP_KERN_PROC_MASK); + + /* Get the process data */ +- pinfo = kvm_getprocs (server->machine.kd, which, arg, &count); ++#if defined(__OpenBSD__) ++ pinfo = kvm_getproc2 (server->machine.kd, which, arg, ++ sizeof (*pinfo), &count); ++#else ++ pinfo = kvm_getprocs (server->machine.kd, which, arg, &count); ++#endif + if ((pinfo == NULL) || (count < 1)) { + glibtop_warn_io_r (server, "kvm_getprocs (proclist)"); + return NULL; +@@ -88,6 +97,12 @@ glibtop_get_proclist_p (glibtop *server, glibtop_procl + #define PROC_STAT ki_stat + #define PROC_RUID ki_ruid + #define PROC_PID ki_pid ++ ++#elif defined(__OpenBSD__) ++ ++#define PROC_STAT p_stat ++#define PROC_RUID p_ruid ++#define PROC_PID p_pid + + #else + #define PROC_STAT kp_proc.p_stat diff --git a/devel/libgtop2/patches/patch-sysdeps_freebsd_procmap_c b/devel/libgtop2/patches/patch-sysdeps_bsd_procmap_c similarity index 56% rename from devel/libgtop2/patches/patch-sysdeps_freebsd_procmap_c rename to devel/libgtop2/patches/patch-sysdeps_bsd_procmap_c index 99fd6ab2086..afed634e9eb 100644 --- a/devel/libgtop2/patches/patch-sysdeps_freebsd_procmap_c +++ b/devel/libgtop2/patches/patch-sysdeps_bsd_procmap_c @@ -1,39 +1,43 @@ -$OpenBSD: patch-sysdeps_freebsd_procmap_c,v 1.7 2007/12/28 14:31:52 jasper Exp $ ---- sysdeps/freebsd/procmap.c.orig Tue Jan 2 23:50:28 2007 -+++ sysdeps/freebsd/procmap.c Fri Dec 28 15:29:17 2007 -@@ -36,7 +36,7 @@ +$OpenBSD: patch-sysdeps_bsd_procmap_c,v 1.1 2008/02/09 16:52:25 ajacoutot Exp $ +--- sysdeps/bsd/procmap.c.orig Fri Apr 27 00:27:34 2007 ++++ sysdeps/bsd/procmap.c Fri Dec 28 19:18:15 2007 +@@ -34,7 +34,8 @@ #include #include #include -#elif defined(__NetBSD__) && (__NetBSD_Version__ >= 105020000) -+#elif defined(__NetBSD__) && (__NetBSD_Version__ >= 105020000) || defined(__OpenBSD__) ++#elif (defined(__NetBSD__) && (__NetBSD_Version__ >= 105020000)) || \ ++ defined(__OpenBSD__) #include #else #include -@@ -64,11 +64,11 @@ +@@ -62,11 +63,13 @@ #include #endif #include -#if !defined(__NetBSD__) || (__NetBSD_Version__ < 105020000) -+#if (!defined(__NetBSD__) || (__NetBSD_Version__ < 105020000)) && ! defined(__OpenBSD__) ++#if (!defined(__NetBSD__) || (__NetBSD_Version__ < 105020000)) && \ ++ !defined(__OpenBSD__) #include #endif -#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) -+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__) ++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)) || \ ++ defined(__OpenBSD__) /* Fixme ... */ #undef _KERNEL #define _UVM_UVM_AMAP_I_H_ 1 -@@ -102,7 +102,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ +@@ -100,7 +103,8 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ struct kinfo_proc *pinfo; struct vm_map_entry entry, *first; struct vmspace vmspace; -#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) -+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(OpenBSD) ++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)) || \ ++ defined(__OpenBSD__) struct vnode vnode; struct inode inode; #else -@@ -167,7 +167,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ +@@ -165,7 +169,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ /* I tested this a few times with `mmap'; as soon as you write * to the mmap'ed area, the object type changes from OBJT_VNODE @@ -41,31 +45,34 @@ $OpenBSD: patch-sysdeps_freebsd_procmap_c,v 1.7 2007/12/28 14:31:52 jasper Exp $ + * to OBJT_DEFAULT so it seems this really works. */ do { - if (update) { -@@ -188,7 +188,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ + glibtop_map_entry *mentry; +@@ -190,7 +194,8 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ continue; #endif #else -#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) -+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(__OpenBSD__) ++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)) || \ ++ defined(__OpenBSD__) if (UVM_ET_ISSUBMAP (&entry)) continue; #else -@@ -214,7 +214,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ +@@ -200,7 +205,8 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ + #endif - i++; -#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) -+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(OpenBSD) ++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)) || \ ++ defined(__OpenBSD__) if (!entry.object.uvm_obj) continue; -@@ -238,7 +238,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ +@@ -224,7 +230,8 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_ glibtop_error_io_r (server, "kvm_read (object)"); #endif -#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) -+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(OpenBSD) ++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)) || \ ++ defined(__OpenBSD__) #if defined(UVM_VNODE_VALID) if (!vnode.v_uvm.u_flags & UVM_VNODE_VALID) continue; diff --git a/devel/libgtop2/patches/patch-sysdeps_bsd_procmem_c b/devel/libgtop2/patches/patch-sysdeps_bsd_procmem_c new file mode 100644 index 00000000000..375d3b93772 --- /dev/null +++ b/devel/libgtop2/patches/patch-sysdeps_bsd_procmem_c @@ -0,0 +1,155 @@ +$OpenBSD: patch-sysdeps_bsd_procmem_c,v 1.1 2008/02/09 16:52:25 ajacoutot Exp $ +--- sysdeps/bsd/procmem.c.orig Fri Apr 27 00:27:34 2007 ++++ sysdeps/bsd/procmem.c Fri Dec 28 19:17:26 2007 +@@ -30,7 +30,7 @@ + #include + #include + #include +-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 105020000) ++#if defined(__NetBSD__) && (__NetBSD_Version__ >= 105020000) || defined(__OpenBSD__) + #include + #else + #include +@@ -46,14 +46,15 @@ + #include + #endif + #include +-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 105020000) ++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 105020000)) || defined(__OpenBSD__) + #include + #else + #include + #endif + +-#if defined(__NetBSD__) && \ +- (__NetBSD_Version__ >= 104000000) && (__NetBSD_Version__ < 105020000) ++#if (defined(__NetBSD__) && \ ++ (__NetBSD_Version__ >= 104000000) && (__NetBSD_Version__ < 105020000)) \ ++ || defined(__OpenBSD__) + /* Fixme ... */ + #undef _KERNEL + #define _UVM_UVM_AMAP_I_H_ 1 +@@ -69,7 +70,8 @@ static const unsigned long _glibtop_sysdeps_proc_mem = + (1L << GLIBTOP_PROC_MEM_RSS_RLIM); + + static const unsigned long _glibtop_sysdeps_proc_mem_share = +-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) ++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)) || \ ++ defined(__OpenBSD__) + (1L << GLIBTOP_PROC_MEM_SHARE); + #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + (1L << GLIBTOP_PROC_MEM_SHARE); +@@ -116,10 +118,14 @@ void + glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, + pid_t pid) + { ++#if defined(__OpenBSD__) ++ struct kinfo_proc2 *pinfo; ++#else + struct kinfo_proc *pinfo; + struct vm_map_entry entry, *first; + struct vmspace *vms, vmspace; +-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) ++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)) || \ ++ defined(__OpenBSD__) + struct vnode vnode; + #else + struct vm_object object; +@@ -127,6 +133,8 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_ + #if (!defined(__FreeBSD__) || (__FreeBSD_version < 500013)) && !defined(__FreeBSD_kernel__) + struct plimit plimit; + #endif ++#endif /* __OpenBSD__ */ ++ + int count; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_MEM), 0); +@@ -140,7 +148,12 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_ + if (pid == 0) return; + + /* Get the process data */ +- pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count); ++#if defined(__OpenBSD__) ++ pinfo = kvm_getproc2 (server->machine.kd, KERN_PROC_PID, pid, ++ 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; +@@ -157,6 +170,15 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_ + buf->resident = buf->rss = (guint64) pagetok + (pinfo [0].ki_rssize) << LOG1024; + ++#elif defined(__OpenBSD__) ++ ++ buf->rss_rlim = pinfo[0].p_uru_maxrss; ++ buf->vsize = buf->size = (guint64)pagetok ++ (pinfo[0].p_vm_tsize + pinfo[0].p_vm_dsize + pinfo[0].p_vm_ssize) ++ << LOG1024; ++ buf->resident = buf->rss = (guint64)pagetok ++ (pinfo[0].p_vm_rssize) << LOG1024; ++ + #else + + #define PROC_VMSPACE kp_proc.p_vmspace +@@ -182,6 +204,10 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_ + + /* Now we get the shared memory. */ + ++#if defined(__OpenBSD__) ++ buf->share = pinfo[0].p_uru_ixrss; ++#else ++ + if (kvm_read (server->machine.kd, + (unsigned long) pinfo [0].PROC_VMSPACE, + (char *) &vmspace, sizeof (vmspace)) != sizeof (vmspace)) { +@@ -221,7 +247,8 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_ + continue; + #endif + #else +-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) ++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)) || \ ++ defined(__OpenBSD__) + if (UVM_ET_ISSUBMAP (&entry)) + continue; + #else +@@ -230,7 +257,8 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_ + #endif + #endif + +-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) ++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)) || \ ++ defined(__OpenBSD__) + if (!entry.object.uvm_obj) + continue; + +@@ -257,14 +285,16 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_ + #endif + /* If the object is of type vnode, add its size */ + +-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) ++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)) || \ ++ defined(__OpenBSD__) + #if defined(UVM_VNODE_VALID) + if (!vnode.v_uvm.u_flags & UVM_VNODE_VALID) + continue; + #endif + if ((vnode.v_type != VREG) || (vnode.v_tag != VT_UFS) || + !vnode.v_data) continue; +-#if defined(__NetBSD__) && (__NetBSD_Version__ >= 105250000) ++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 105250000)) || \ ++ defined(__OpenBSD__) + /* Reference count must be at least two. */ + if (vnode.v_usecount <= 1) + continue; +@@ -287,6 +317,8 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_ + buf->share += object.un_pager.vnp.vnp_size; + #endif + } ++ ++#endif /* __OpenBSD */ + + buf->flags = _glibtop_sysdeps_proc_mem | + _glibtop_sysdeps_proc_mem_share; diff --git a/devel/libgtop2/patches/patch-sysdeps_bsd_procopenfiles_c b/devel/libgtop2/patches/patch-sysdeps_bsd_procopenfiles_c new file mode 100644 index 00000000000..71ed7d80c01 --- /dev/null +++ b/devel/libgtop2/patches/patch-sysdeps_bsd_procopenfiles_c @@ -0,0 +1,34 @@ +$OpenBSD: patch-sysdeps_bsd_procopenfiles_c,v 1.1 2008/02/09 16:52:25 ajacoutot Exp $ +--- sysdeps/bsd/procopenfiles.c.orig Sun Dec 30 19:40:10 2007 ++++ sysdeps/bsd/procopenfiles.c Sun Dec 30 19:42:14 2007 +@@ -47,5 +47,30 @@ _glibtop_init_proc_open_files_s (glibtop *server) + glibtop_open_files_entry * + glibtop_get_proc_open_files_s (glibtop *server, glibtop_proc_open_files *buf, pid_t pid) + { ++ memset(buf, 0, sizeof (glibtop_proc_open_files)); ++ return NULL; ++} ++ ++#include ++ ++static const unsigned long _glibtop_sysdeps_proc_wd = ++(1 << GLIBTOP_PROC_WD_EXE) | ++(1 << GLIBTOP_PROC_WD_ROOT) | ++(1 << GLIBTOP_PROC_WD_NUMBER); ++ ++/* Init function. */ ++ ++void ++_glibtop_init_proc_wd_s (glibtop *server) ++{ ++ server->sysdeps.proc_wd = _glibtop_sysdeps_proc_wd; ++} ++ ++ ++/* XXX Unimplemented on BSD */ ++char ** ++glibtop_get_proc_wd_s (glibtop *server, glibtop_proc_wd *buf, pid_t pid) ++{ ++ memset (buf, 0, sizeof (glibtop_proc_wd)); + return NULL; + } diff --git a/devel/libgtop2/patches/patch-sysdeps_bsd_procsignal_c b/devel/libgtop2/patches/patch-sysdeps_bsd_procsignal_c new file mode 100644 index 00000000000..072e856b8fc --- /dev/null +++ b/devel/libgtop2/patches/patch-sysdeps_bsd_procsignal_c @@ -0,0 +1,102 @@ +$OpenBSD: patch-sysdeps_bsd_procsignal_c,v 1.1 2008/02/09 16:52:25 ajacoutot Exp $ +--- sysdeps/bsd/procsignal.c.orig Sun Dec 30 19:57:24 2007 ++++ sysdeps/bsd/procsignal.c Sun Dec 30 20:06:42 2007 +@@ -51,7 +51,11 @@ glibtop_get_proc_signal_p (glibtop *server, + glibtop_proc_signal *buf, + pid_t pid) + { ++#if defined(__OpenBSD__) ++ struct kinfo_proc2 *pinfo; ++#else + struct kinfo_proc *pinfo; ++#endif + int count = 0; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0); +@@ -62,7 +66,12 @@ glibtop_get_proc_signal_p (glibtop *server, + if (pid == 0) return; + + /* Get the process information */ ++#if defined(__OpenBSD__) ++ pinfo = kvm_getproc2 (server->machine.kd, KERN_PROC_PID, pid, ++ 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; +@@ -75,6 +84,10 @@ glibtop_get_proc_signal_p (glibtop *server, + #define PROC_SIGIGNORE ki_sigignore + #define PROC_SIGCATCH ki_sigcatch + ++#elif defined(__OpenBSD__) ++ ++/* nothing to see here, move along */ ++ + #else + + #define PROC_SIGLIST kp_proc.p_siglist +@@ -87,6 +100,9 @@ glibtop_get_proc_signal_p (glibtop *server, + /* signal: mask of pending signals. + * pinfo [0].kp_proc.p_siglist + */ ++#if defined(__OpenBSD__) ++ buf->signal [0] = pinfo [0].p_siglist; ++#else + #if defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) + buf->signal [0] = pinfo [0].kp_proc.p_sigctx.ps_siglist.__bits[0]; + #elif (defined(__NetBSD__) && (NSIG > 32)) || \ +@@ -95,10 +111,14 @@ glibtop_get_proc_signal_p (glibtop *server, + #else + buf->signal [0] = pinfo [0].kp_proc.p_siglist; + #endif ++#endif /* __OpenBSD__ */ + + /* blocked: mask of blocked signals. + * pinfo [0].kp_proc.p_sigmask + */ ++#if defined(__OpenBSD__) ++ buf->blocked [0] = pinfo [0].p_sigmask; ++#else + #if defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) + buf->blocked [0] = pinfo [0].kp_proc.p_sigctx.ps_sigmask.__bits[0]; + #elif (defined(__NetBSD__) && (NSIG > 32)) || \ +@@ -107,10 +127,14 @@ glibtop_get_proc_signal_p (glibtop *server, + #else + buf->blocked [0] = pinfo [0].kp_proc.p_sigmask; + #endif ++#endif /* __OpenBSD__ */ + + /* sigignore: mask of ignored signals. + * pinfo [0].kp_proc.p_sigignore + */ ++#if defined(__OpenBSD__) ++ buf->sigignore [0] = pinfo [0].p_sigignore; ++#else + #if defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) + buf->sigignore [0] = pinfo [0].kp_proc.p_sigctx.ps_sigignore.__bits[0]; + #elif (defined(__NetBSD__) && (NSIG > 32)) || \ +@@ -119,10 +143,14 @@ glibtop_get_proc_signal_p (glibtop *server, + #else + buf->sigignore [0] = pinfo [0].kp_proc.p_sigignore; + #endif ++#endif /* __OpenBSD__ */ + + /* sigcatch: mask of caught signals. + * pinfo [0].kp_proc.p_sigcatch + */ ++#if defined(__OpenBSD__) ++ buf->sigcatch [0] = pinfo [0].p_sigcatch; ++#else + #if defined(__NetBSD__) && (__NetBSD_Version__ >= 105150000) + buf->sigcatch [0] = pinfo [0].kp_proc.p_sigctx.ps_sigcatch.__bits[0]; + #elif (defined(__NetBSD__) && (NSIG > 32)) || \ +@@ -131,6 +159,7 @@ glibtop_get_proc_signal_p (glibtop *server, + #else + buf->sigcatch [0] = pinfo [0].kp_proc.p_sigcatch; + #endif ++#endif /* __OpenBSD__ */ + + buf->flags = _glibtop_sysdeps_proc_signal; + } diff --git a/devel/libgtop2/patches/patch-sysdeps_bsd_procstate_c b/devel/libgtop2/patches/patch-sysdeps_bsd_procstate_c new file mode 100644 index 00000000000..b528571a536 --- /dev/null +++ b/devel/libgtop2/patches/patch-sysdeps_bsd_procstate_c @@ -0,0 +1,42 @@ +$OpenBSD: patch-sysdeps_bsd_procstate_c,v 1.1 2008/02/09 16:52:25 ajacoutot Exp $ +--- sysdeps/bsd/procstate.c.orig Thu Sep 27 22:34:55 2007 ++++ sysdeps/bsd/procstate.c Mon Jan 28 15:05:59 2008 +@@ -54,7 +54,11 @@ glibtop_get_proc_state_p (glibtop *server, + glibtop_proc_state *buf, + pid_t pid) + { ++#if defined(__OpenBSD__) ++ struct kinfo_proc2 *pinfo; ++#else + struct kinfo_proc *pinfo; ++#endif + int count = 0; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_STATE), 0); +@@ -65,7 +69,12 @@ glibtop_get_proc_state_p (glibtop *server, + if (pid == 0) return; + + /* Get the process information */ ++#if defined(__OpenBSD__) ++ pinfo = kvm_getproc2 (server->machine.kd, KERN_PROC_PID, pid, ++ 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; +@@ -78,6 +87,13 @@ glibtop_get_proc_state_p (glibtop *server, + #define PROC_RUID ki_ruid + #define PROC_RGID ki_rgid + #define PROC_STAT ki_stat ++ ++#elif defined(__OpenBSD__) ++ ++#define PROC_COMM p_comm ++#define PROC_SVUID p_svuid ++#define PROC_SVGID p_svgid ++#define PROC_STAT p_stat + + #else + #define PROC_COMM kp_proc.p_comm diff --git a/devel/libgtop2/patches/patch-sysdeps_bsd_procuid_c b/devel/libgtop2/patches/patch-sysdeps_bsd_procuid_c new file mode 100644 index 00000000000..99d5c4d0c04 --- /dev/null +++ b/devel/libgtop2/patches/patch-sysdeps_bsd_procuid_c @@ -0,0 +1,65 @@ +$OpenBSD: patch-sysdeps_bsd_procuid_c,v 1.1 2008/02/09 16:52:25 ajacoutot Exp $ +--- sysdeps/bsd/procuid.c.orig Mon Jan 28 15:20:42 2008 ++++ sysdeps/bsd/procuid.c Mon Jan 28 15:23:01 2008 +@@ -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,7 +52,11 @@ void + glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, + pid_t pid) + { ++#if defined (__OpenBSD__) ++ struct kinfo_proc2 *pinfo; ++#else + struct kinfo_proc *pinfo; ++#endif + int count = 0; + + #if LIBGTOP_VERSION_CODE >= 1001000 +@@ -69,7 +74,12 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_ + if (pid == 0) return; + + /* Get the process information */ ++#if defined (__OpenBSD__) ++ pinfo = kvm_getproc2 (server->machine.kd, KERN_PROC_PID, pid, ++ 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; +@@ -86,6 +96,20 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_ + #define PROC_TPGID ki_tpgid + #define PROC_NICE ki_nice + #define PROC_PRIORITY ki_pri.pri_user ++ ++#elif defined (__OpenBSD__) ++ ++#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 + + #define PROC_RUID kp_eproc.e_pcred.p_ruid +@@ -105,6 +129,7 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_ + buf->gid = pinfo [0].PROC_RGID; + buf->egid = pinfo [0].PROC_SVGID; + ++ buf->pid = pinfo [0].PROC_PID; + buf->ppid = pinfo [0].PROC_PPID; + buf->pgrp = pinfo [0].PROC_PGID; + buf->tpgid = pinfo [0].PROC_TPGID; diff --git a/devel/libgtop2/patches/patch-sysdeps_freebsd_sem_limits_c b/devel/libgtop2/patches/patch-sysdeps_bsd_sem_limits_c similarity index 65% rename from devel/libgtop2/patches/patch-sysdeps_freebsd_sem_limits_c rename to devel/libgtop2/patches/patch-sysdeps_bsd_sem_limits_c index 7f574dd456b..96c3ba197c6 100644 --- a/devel/libgtop2/patches/patch-sysdeps_freebsd_sem_limits_c +++ b/devel/libgtop2/patches/patch-sysdeps_bsd_sem_limits_c @@ -1,7 +1,7 @@ -$OpenBSD: patch-sysdeps_freebsd_sem_limits_c,v 1.6 2007/12/28 14:31:52 jasper Exp $ ---- sysdeps/freebsd/sem_limits.c.orig Tue Jan 2 23:50:28 2007 -+++ sysdeps/freebsd/sem_limits.c Fri Dec 28 15:29:17 2007 -@@ -57,7 +57,10 @@ glibtop_get_sem_limits_p (glibtop *server, glibtop_sem +$OpenBSD: patch-sysdeps_bsd_sem_limits_c,v 1.1 2008/02/09 16:52:25 ajacoutot Exp $ +--- sysdeps/bsd/sem_limits.c.orig Fri Dec 28 17:16:24 2007 ++++ sysdeps/bsd/sem_limits.c Fri Dec 28 17:26:07 2007 +@@ -55,7 +55,10 @@ glibtop_get_sem_limits_p (glibtop *server, glibtop_sem #include static unsigned long _glibtop_sysdeps_sem_limits = @@ -13,7 +13,7 @@ $OpenBSD: patch-sysdeps_freebsd_sem_limits_c,v 1.6 2007/12/28 14:31:52 jasper Ex (1L << GLIBTOP_IPC_SEMMNS) + (1L << GLIBTOP_IPC_SEMMNU) + (1L << GLIBTOP_IPC_SEMMSL) + (1L << GLIBTOP_IPC_SEMOPM) + (1L << GLIBTOP_IPC_SEMUME) + (1L << GLIBTOP_IPC_SEMUSZ) + -@@ -105,7 +108,9 @@ glibtop_get_sem_limits_p (glibtop *server, glibtop_sem +@@ -103,7 +106,9 @@ glibtop_get_sem_limits_p (glibtop *server, glibtop_sem if (server->sysdeps.sem_limits == 0) return; diff --git a/devel/libgtop2/patches/patch-sysdeps_bsd_sysinfo_c b/devel/libgtop2/patches/patch-sysdeps_bsd_sysinfo_c new file mode 100644 index 00000000000..05095cd6be3 --- /dev/null +++ b/devel/libgtop2/patches/patch-sysdeps_bsd_sysinfo_c @@ -0,0 +1,65 @@ +$OpenBSD: patch-sysdeps_bsd_sysinfo_c,v 1.1 2008/02/09 16:52:25 ajacoutot Exp $ +--- sysdeps/bsd/sysinfo.c.orig Sat May 19 16:27:30 2007 ++++ sysdeps/bsd/sysinfo.c Fri Dec 28 19:00:25 2007 +@@ -35,16 +35,49 @@ static glibtop_sysinfo sysinfo = { .flags = 0 }; + static void + init_sysinfo (glibtop *server) + { +- char *model; +- guint64 ncpus = 1; ++ char model[64]; ++#if defined(__OpenBSD__) ++ int mib[2]; ++#endif ++ int ncpus = 0; + int mhz = 0; +- size_t len; ++ size_t len = 0; + + if (G_LIKELY (sysinfo.flags)) + return; + + glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0); + ++#if defined(__OpenBSD__) ++ mib[0] = CTL_HW; ++ ++ /* Get the number of CPU's present */ ++ mib[1] = HW_NCPU; ++ ++ len = sizeof(ncpus); ++ if (sysctl(mib, 2, &ncpus, &len, NULL, 0) != 0) { ++ ncpus = 1; /* we have at least 1 cpu... */ ++ printf("Couldn't determine hw.ncpu.\n"); ++ } ++ ++ /* Get the CPU model */ ++ mib[1] = HW_MODEL; ++ len = sizeof(model); ++ ++ if (sysctl(mib, 2, model, &len, NULL, 0) != 0) { ++ (void)strlcpy(model, "unknown", sizeof(model)); ++ printf("Couldn't determine hw.model.\n"); ++ } ++ ++ /* Get the clockrate */ ++ mib[1] = HW_CPUSPEED; ++ len = sizeof(mhz); ++ ++ if (sysctl(mib, 2, &mhz, &len, NULL, 0) != 0) { ++ mhz = 0; ++ printf("Couldn't determine hw.cpuspeed.\n"); ++ } ++#else + len = sizeof (ncpus); + sysctlbyname ("hw.ncpu", &ncpus, &len, NULL, 0); + len = 0; +@@ -53,6 +86,8 @@ init_sysinfo (glibtop *server) + sysctlbyname ("hw.model", model, &len, NULL, 0); + len = sizeof (mhz); + sysctlbyname ("hw.clockrate", &mhz, &len, NULL, 0); ++ ++#endif /* __OpenBSD__ */ + + for (sysinfo.ncpu = 0; + sysinfo.ncpu < GLIBTOP_NCPU && sysinfo.ncpu < ncpus; diff --git a/devel/libgtop2/patches/patch-sysdeps_common_fsusage_c b/devel/libgtop2/patches/patch-sysdeps_common_fsusage_c new file mode 100644 index 00000000000..c0e5d1e0270 --- /dev/null +++ b/devel/libgtop2/patches/patch-sysdeps_common_fsusage_c @@ -0,0 +1,12 @@ +$OpenBSD: patch-sysdeps_common_fsusage_c,v 1.1 2008/02/09 16:52:25 ajacoutot Exp $ +--- sysdeps/common/fsusage.c.orig Fri Dec 28 17:23:01 2007 ++++ sysdeps/common/fsusage.c Fri Dec 28 17:23:28 2007 +@@ -270,7 +270,7 @@ glibtop_get_fsusage_s (glibtop *server, glibtop_fsusag + return; + + #if (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__)) \ +- || defined(__FreeBSD__) ++ || defined(__FreeBSD__) || defined(__OpenBSD__) + /* Solaris but not SunOS and FreeBSD */ + buf->block_size = fsd.f_frsize; + #else diff --git a/devel/libgtop2/patches/patch-sysdeps_freebsd_fsusage_c b/devel/libgtop2/patches/patch-sysdeps_freebsd_fsusage_c deleted file mode 100644 index de811ace4ba..00000000000 --- a/devel/libgtop2/patches/patch-sysdeps_freebsd_fsusage_c +++ /dev/null @@ -1,11 +0,0 @@ -$OpenBSD: patch-sysdeps_freebsd_fsusage_c,v 1.3 2007/12/28 14:31:52 jasper Exp $ ---- sysdeps/freebsd/fsusage.c.orig Tue Jan 2 23:50:28 2007 -+++ sysdeps/freebsd/fsusage.c Fri Dec 28 15:29:17 2007 -@@ -47,7 +47,6 @@ _glibtop_freebsd_get_fsusage_read_write(glibtop *serve - return; - } - #if !defined(__FreeBSD_kernel__) -- buf->read = sfs.f_syncreads + sfs.f_asyncreads; - buf->write = sfs.f_syncwrites + sfs.f_asyncwrites; - #endif - buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE); diff --git a/devel/libgtop2/patches/patch-sysdeps_freebsd_prockernel_c b/devel/libgtop2/patches/patch-sysdeps_freebsd_prockernel_c deleted file mode 100644 index 53eab8e4483..00000000000 --- a/devel/libgtop2/patches/patch-sysdeps_freebsd_prockernel_c +++ /dev/null @@ -1,53 +0,0 @@ -$OpenBSD: patch-sysdeps_freebsd_prockernel_c,v 1.5 2007/12/28 14:31:52 jasper Exp $ ---- sysdeps/freebsd/prockernel.c.orig Tue Jan 2 23:50:28 2007 -+++ sysdeps/freebsd/prockernel.c Fri Dec 28 15:29:17 2007 -@@ -35,8 +35,9 @@ - #if (!defined __OpenBSD__) && (!defined __bsdi__) - #include - #endif --#if !defined(__bsdi__) && !(defined(__FreeBSD__) && defined(__alpha__)) && \ -- !defined(__NetBSD__) -+#if !(defined(__NetBSD__) || defined(__bsdi__) || defined(__FreeBSD__) || \ -+ defined(__OpenBSD__)) && \ -+ defined(__alpha__) - #include - #endif - -@@ -84,7 +85,9 @@ void - glibtop_init_proc_kernel_p (glibtop *server) - { - server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel_pstats | -+#if (!defined __OpenBSD__) || (defined __i386__) - _glibtop_sysdeps_proc_kernel_pcb | -+#endif - _glibtop_sysdeps_proc_kernel_wchan; - } - -@@ -216,13 +219,15 @@ glibtop_get_proc_kernel_p (glibtop *server, - /*xxx FreeBSD/Alpha? */ - #endif - #else --#ifdef __i386__ -+#if (!defined __OpenBSD__) || (defined __i386__) - buf->kstk_esp = (guint64) pcb.pcb_tss.tss_esp0; - #ifdef __bsdi__ - buf->kstk_eip = (guint64) pcb.pcb_tss.tss_eip; - #else -+#if (!defined __OpenBSD__) || (defined __i386__) - buf->kstk_eip = (guint64) pcb.pcb_tss.__tss_eip; - #endif -+#endif - #else - #if defined(__NetBSD__) - #if defined(__m68k__) -@@ -249,7 +254,10 @@ glibtop_get_proc_kernel_p (glibtop *server, - buf->kstk_eip = (guint64) 0; - #endif /* ${MACHINE_ARCH} */ - #endif /* __NetBSD__ */ -+ -+#if (!defined __OpenBSD__) || (defined __i386__) - buf->flags |= _glibtop_sysdeps_proc_kernel_pcb; -+#endif - #endif - #endif - } diff --git a/devel/libgtop2/patches/patch-sysdeps_freebsd_procmem_c b/devel/libgtop2/patches/patch-sysdeps_freebsd_procmem_c deleted file mode 100644 index 5cbf14875ac..00000000000 --- a/devel/libgtop2/patches/patch-sysdeps_freebsd_procmem_c +++ /dev/null @@ -1,85 +0,0 @@ -$OpenBSD: patch-sysdeps_freebsd_procmem_c,v 1.6 2007/12/28 14:31:52 jasper Exp $ ---- sysdeps/freebsd/procmem.c.orig Tue Jan 2 23:50:28 2007 -+++ sysdeps/freebsd/procmem.c Fri Dec 28 15:29:17 2007 -@@ -34,7 +34,7 @@ - #include - #if defined(__NetBSD__) && (__NetBSD_Version__ >= 105020000) - #include --#else -+#elif !defined(__OpenBSD__) - #include - #include - #endif -@@ -50,12 +50,13 @@ - #include - #if defined(__NetBSD__) && (__NetBSD_Version__ >= 105020000) - #include --#else -+#elif !defined(__OpenBSD__) - #include - #endif - - #if defined(__NetBSD__) && \ -- (__NetBSD_Version__ >= 104000000) && (__NetBSD_Version__ < 105020000) -+ (__NetBSD_Version__ >= 104000000) && (__NetBSD_Version__ < 105020000) || \ -+ defined(OpenBSD) - /* Fixme ... */ - #undef _KERNEL - #define _UVM_UVM_AMAP_I_H_ 1 -@@ -71,10 +72,8 @@ static const unsigned long _glibtop_sysdeps_proc_mem = - (1L << GLIBTOP_PROC_MEM_RSS_RLIM); - - static const unsigned long _glibtop_sysdeps_proc_mem_share = --#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) -+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(OpenBSD) || defined(__FreeBSD__) - (1L << GLIBTOP_PROC_MEM_SHARE); --#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) --(1L << GLIBTOP_PROC_MEM_SHARE); - #else - 0; - #endif -@@ -121,7 +120,7 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_ - struct kinfo_proc *pinfo; - struct vm_map_entry entry, *first; - struct vmspace *vms, vmspace; --#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) -+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(OpenBSD) - struct vnode vnode; - #else - struct vm_object object; -@@ -223,7 +222,7 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_ - continue; - #endif - #else --#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) -+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(OpenBSD) - if (UVM_ET_ISSUBMAP (&entry)) - continue; - #else -@@ -232,7 +231,7 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_ - #endif - #endif - --#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) -+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(OpenBSD) - if (!entry.object.uvm_obj) - continue; - -@@ -259,7 +258,7 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_ - #endif - /* If the object is of type vnode, add its size */ - --#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) -+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000) || defined(OpenBSD) - #if defined(UVM_VNODE_VALID) - if (!vnode.v_uvm.u_flags & UVM_VNODE_VALID) - continue; -@@ -275,7 +274,7 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_ - #else - - /* Reference count must be at least two. */ -- if (vnode.v_uvm.u_obj.uo_refs <= 1) -+ if (vnode.v_usecount <= 1) - continue; - - buf->share += pagetok (vnode.v_uvm.u_obj.uo_npages) << LOG1024; diff --git a/devel/libgtop2/patches/patch-sysdeps_freebsd_sysinfo_c b/devel/libgtop2/patches/patch-sysdeps_freebsd_sysinfo_c deleted file mode 100644 index 2f99e6d1443..00000000000 --- a/devel/libgtop2/patches/patch-sysdeps_freebsd_sysinfo_c +++ /dev/null @@ -1,30 +0,0 @@ -$OpenBSD: patch-sysdeps_freebsd_sysinfo_c,v 1.2 2007/02/21 17:27:54 steven Exp $ ---- sysdeps/freebsd/sysinfo.c.orig Tue Jan 2 23:50:28 2007 -+++ sysdeps/freebsd/sysinfo.c Sun Feb 18 20:23:18 2007 -@@ -45,14 +45,22 @@ init_sysinfo (glibtop *server) - - glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0); - -+ int mib[2]; -+ mib[0] = CTL_HW; -+ - len = sizeof (ncpus); -- sysctlbyname ("hw.ncpu", &ncpus, &len, NULL, 0); -+ mib[1] = HW_NCPU; -+ sysctl(mib, 2, &ncpus, &len, NULL, 0); -+ - len = 0; -- sysctlbyname ("hw.model", NULL, &len, NULL, 0); -+ mib[1] = HW_MODEL; -+ sysctl(mib, 2, NULL, &len, NULL, 0); - model = g_malloc (len); -- sysctlbyname ("hw.model", model, &len, NULL, 0); -+ sysctl(mib, 2, &model, &len, NULL, 0); -+ - len = sizeof (mhz); -- sysctlbyname ("hw.clockrate", &mhz, &len, NULL, 0); -+ mib[1] = HW_CPUSPEED; -+ sysctl(mib, 2, &mhz, &len, NULL, 0); - - for (sysinfo.ncpu = 0; - sysinfo.ncpu < GLIBTOP_NCPU && sysinfo.ncpu < ncpus; diff --git a/devel/libgtop2/pkg/PLIST b/devel/libgtop2/pkg/PLIST index 97d125a0d06..099e98f115e 100644 --- a/devel/libgtop2/pkg/PLIST +++ b/devel/libgtop2/pkg/PLIST @@ -1,4 +1,4 @@ -@comment $OpenBSD: PLIST,v 1.14 2007/01/23 11:00:12 bernd Exp $ +@comment $OpenBSD: PLIST,v 1.15 2008/02/09 16:52:25 ajacoutot Exp $ %%SHARED%% bin/libgtop_daemon2 @mode 2555 @@ -15,7 +15,6 @@ include/libgtop-2.0/glibtop/cpu.h include/libgtop-2.0/glibtop/fsusage.h include/libgtop-2.0/glibtop/global.h include/libgtop-2.0/glibtop/gnuserv.h -include/libgtop-2.0/glibtop/inodedb.h include/libgtop-2.0/glibtop/loadavg.h include/libgtop-2.0/glibtop/mem.h include/libgtop-2.0/glibtop/mountlist.h @@ -36,6 +35,7 @@ include/libgtop-2.0/glibtop/procsignal.h include/libgtop-2.0/glibtop/procstate.h include/libgtop-2.0/glibtop/proctime.h include/libgtop-2.0/glibtop/procuid.h +include/libgtop-2.0/glibtop/procwd.h include/libgtop-2.0/glibtop/sem_limits.h include/libgtop-2.0/glibtop/shm_limits.h include/libgtop-2.0/glibtop/signal.h @@ -65,7 +65,6 @@ share/gtk-doc/html/libgtop/libgtop-Close.html share/gtk-doc/html/libgtop/libgtop-Command.html share/gtk-doc/html/libgtop/libgtop-GlibTop-Server.html share/gtk-doc/html/libgtop/libgtop-GlibTop.html -share/gtk-doc/html/libgtop/libgtop-Inode-DB.html share/gtk-doc/html/libgtop/libgtop-Net-List.html share/gtk-doc/html/libgtop/libgtop-Net-Load.html share/gtk-doc/html/libgtop/libgtop-PPP.html @@ -205,6 +204,9 @@ share/locale/ne/LC_MESSAGES/ share/locale/ne/LC_MESSAGES/libgtop-2.0.mo share/locale/nl/LC_MESSAGES/libgtop-2.0.mo share/locale/nn/LC_MESSAGES/libgtop-2.0.mo +share/locale/oc/ +share/locale/oc/LC_MESSAGES/ +share/locale/oc/LC_MESSAGES/libgtop-2.0.mo share/locale/or/ share/locale/or/LC_MESSAGES/ share/locale/or/LC_MESSAGES/libgtop-2.0.mo @@ -245,7 +247,5 @@ share/locale/xh/ share/locale/xh/LC_MESSAGES/ share/locale/xh/LC_MESSAGES/libgtop-2.0.mo share/locale/zh_CN/LC_MESSAGES/libgtop-2.0.mo -share/locale/zh_HK/ -share/locale/zh_HK/LC_MESSAGES/ share/locale/zh_HK/LC_MESSAGES/libgtop-2.0.mo share/locale/zh_TW/LC_MESSAGES/libgtop-2.0.mo