diff options
author | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2002-12-04 12:28:06 +0800 |
---|---|---|
committer | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2002-12-04 12:28:06 +0800 |
commit | 5810a1b74139e68dc82461bff59fccb4e6899eca (patch) | |
tree | 9d6157a592d1e3706a383c3e2c426eea7bc7023c /devel/libgtop2/files | |
parent | 45d3d7dadbb0b27793912f39b4de27e4825408a5 (diff) | |
download | marcuscom-ports-5810a1b74139e68dc82461bff59fccb4e6899eca.tar marcuscom-ports-5810a1b74139e68dc82461bff59fccb4e6899eca.tar.gz marcuscom-ports-5810a1b74139e68dc82461bff59fccb4e6899eca.tar.bz2 marcuscom-ports-5810a1b74139e68dc82461bff59fccb4e6899eca.tar.lz marcuscom-ports-5810a1b74139e68dc82461bff59fccb4e6899eca.tar.xz marcuscom-ports-5810a1b74139e68dc82461bff59fccb4e6899eca.tar.zst marcuscom-ports-5810a1b74139e68dc82461bff59fccb4e6899eca.zip |
Add libgtop2.
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@228 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'devel/libgtop2/files')
-rw-r--r-- | devel/libgtop2/files/patch-ab | 11 | ||||
-rw-r--r-- | devel/libgtop2/files/patch-ah | 68 | ||||
-rw-r--r-- | devel/libgtop2/files/patch-aj | 372 | ||||
-rw-r--r-- | devel/libgtop2/files/patch-configure | 56 | ||||
-rw-r--r-- | devel/libgtop2/files/patch-libgtop-2.0.pc.in | 11 | ||||
-rw-r--r-- | devel/libgtop2/files/patch-src::daemon::gnuserv.c | 15 | ||||
-rw-r--r-- | devel/libgtop2/files/patch-src_daemon_Makefile.in | 11 | ||||
-rw-r--r-- | devel/libgtop2/files/patch-support_Makefile.in | 11 | ||||
-rw-r--r-- | devel/libgtop2/files/patch-sysdeps::freebsd::proctime.c | 138 | ||||
-rw-r--r-- | devel/libgtop2/files/patch-sysdeps_freebsd_swap.c | 13 |
10 files changed, 706 insertions, 0 deletions
diff --git a/devel/libgtop2/files/patch-ab b/devel/libgtop2/files/patch-ab new file mode 100644 index 000000000..9c88c62bc --- /dev/null +++ b/devel/libgtop2/files/patch-ab @@ -0,0 +1,11 @@ +--- Makefile.in.orig Mon Apr 29 12:00:07 2002 ++++ Makefile.in Mon Apr 29 12:00:24 2002 +@@ -503,7 +503,7 @@ + $(top_srcdir)/aclocal.m4: libgtop-sysdeps.m4 LIBGTOP-VERSION + + libgtopConf.sh: libgtopConf.sh.in Makefile +- sed -e 's#\@LIBGTOP_LIBDIR\@#$(libdir)#g' \ ++ sed -e 's#\@LIBGTOP_LIBDIR\@#$(sysconfdir)#g' \ + -e 's#\@LIBGTOP_INCLUDEDIR\@#$(includedir)/libgtop-2.0#g' \ + -e 's#\@LIBGTOP_DATADIR\@#$(datadir)#g' \ + -e 's#\@LIBGTOP_EXTRA_LIBS\@#$(LIBGTOP_EXTRA_LIBS)#g' \ diff --git a/devel/libgtop2/files/patch-ah b/devel/libgtop2/files/patch-ah new file mode 100644 index 000000000..fad02673b --- /dev/null +++ b/devel/libgtop2/files/patch-ah @@ -0,0 +1,68 @@ +--- sysdeps/freebsd/procmap.c.orig Mon Jun 10 17:34:42 2002 ++++ sysdeps/freebsd/procmap.c Sat Oct 26 01:20:26 2002 +@@ -33,7 +33,11 @@ + #include <sys/proc.h> + #include <sys/resource.h> + #include <vm/vm_object.h> ++#if (__FreeBSD_version >= 400011) ++#include <vm/vm.h> ++#else + #include <vm/vm_prot.h> ++#endif + #include <vm/vm_map.h> + + #include <sys/vnode.h> +@@ -91,8 +95,9 @@ + glibtop_map_entry *maps; + #if defined __FreeBSD__ + struct vnode vnode; ++#if __FreeBSD_version < 500039 + struct inode inode; +- struct mount mount; ++#endif + #endif + int count, i = 0; + int update = 0; +@@ -114,7 +119,11 @@ + /* Now we get the memory maps. */ + + if (kvm_read (server->machine.kd, ++#if (__FreeBSD_version >= 500013) ++ (unsigned long) pinfo [0].ki_vmspace, ++#else + (unsigned long) pinfo [0].kp_proc.p_vmspace, ++#endif + (char *) &vmspace, sizeof (vmspace)) != sizeof (vmspace)) + glibtop_error_io_r (server, "kvm_read (vmspace)"); + +@@ -244,6 +253,15 @@ + &vnode, sizeof (vnode)) != sizeof (vnode)) + glibtop_error_io_r (server, "kvm_read (vnode)"); + ++#if __FreeBSD_version >= 500039 ++ switch (vnode.v_type) { ++ case VREG: ++ maps [i-1].inode = vnode.v_cachedid; ++ maps [i-1].device = vnode.v_cachedfs; ++ default: ++ continue; ++ } ++#else + if ((vnode.v_type != VREG) || (vnode.v_tag != VT_UFS) || + !vnode.v_data) continue; + +@@ -252,13 +270,9 @@ + &inode, sizeof (inode)) != sizeof (inode)) + glibtop_error_io_r (server, "kvm_read (inode)"); + +- if (kvm_read (server->machine.kd, +- (unsigned long) vnode.v_mount, +- &mount, sizeof (mount)) != sizeof (mount)) +- glibtop_error_io_r (server, "kvm_read (mount)"); +- + maps [i-1].inode = inode.i_number; + maps [i-1].device = inode.i_dev; ++#endif + #endif + } while (entry.next != first); + diff --git a/devel/libgtop2/files/patch-aj b/devel/libgtop2/files/patch-aj new file mode 100644 index 000000000..101a29532 --- /dev/null +++ b/devel/libgtop2/files/patch-aj @@ -0,0 +1,372 @@ +--- sysdeps/freebsd/proclist.c.orig Thu May 27 09:04:05 1999 ++++ sysdeps/freebsd/proclist.c Fri Dec 22 18:02:59 2000 +@@ -88,9 +88,20 @@ + for (i=j=0; i < count; i++) { ++#if __FreeBSD_version >= 500013 ++#define XXX_P_STAT ki_stat ++#define XXX_P_RUID ki_ruid ++#define XXX_P_PID ki_pid ++ ++#else ++#define XXX_P_STAT kp_proc.p_stat ++#define XXX_P_RUID kp_eproc.e_pcred.p_ruid ++#define XXX_P_PID kp_proc.p_pid ++ ++#endif + if ((real_which & GLIBTOP_EXCLUDE_IDLE) && +- (pinfo[i].kp_proc.p_stat != SRUN)) ++ (pinfo[i].XXX_P_STAT != SRUN)) + continue; + else if ((real_which & GLIBTOP_EXCLUDE_SYSTEM) && +- (pinfo[i].kp_eproc.e_pcred.p_ruid == 0)) ++ (pinfo[i].XXX_P_RUID == 0)) + continue; +- pids [j++] = (unsigned) pinfo[i].kp_proc.p_pid; ++ pids [j++] = (unsigned) pinfo[i].XXX_P_PID; + } /* end for */ +--- sysdeps/freebsd/procstate.c.orig Sun Feb 10 09:30:11 2002 ++++ sysdeps/freebsd/procstate.c Mon Apr 29 11:42:22 2002 +@@ -28,7 +28,7 @@ + #include <glibtop_suid.h> + + #if !defined(__OpenBSD__) +-//&& (!defined __bsdi__) ++/*&& (!defined __bsdi__)*/ + #include <sys/user.h> + #endif + +@@ -37,11 +37,7 @@ + (1L << GLIBTOP_PROC_STATE_GID); + + static const unsigned long _glibtop_sysdeps_proc_state_new = +-#if LIBGTOP_VERSION_CODE >= 1001000 +-(1L << GLIBTOP_PROC_STATE_RUID) + (1L << GLIBTOP_PROC_STATE_RGID); +-#else + 0; +-#endif + + /* Init function. */ + +@@ -76,43 +72,35 @@ + return; + } + +- strncpy (buf->cmd, pinfo [0].kp_proc.p_comm, sizeof (buf->cmd)-1); +- buf->cmd [sizeof (buf->cmd)-1] = 0; ++#if __FreeBSD_version >= 500013 ++#define XXX_P_COMM ki_comm ++#define XXX_P_SVUID ki_svuid ++#define XXX_P_SVGID ki_svgid ++#define XXX_P_RUID ki_ruid ++#define XXX_P_RGID ki_rgid ++#define XXX_P_STAT ki_stat + +- buf->uid = pinfo [0].kp_eproc.e_pcred.p_svuid; +- buf->gid = pinfo [0].kp_eproc.e_pcred.p_svgid; ++#else ++#define XXX_P_COMM kp_proc.p_comm ++#define XXX_P_SVUID kp_eproc.e_pcred.p_svuid ++#define XXX_P_SVGID kp_eproc.e_pcred.p_svgid ++#define XXX_P_RUID kp_eproc.e_pcred.p_ruid ++#define XXX_P_RGID kp_eproc.e_pcred.p_rgid ++#define XXX_P_STAT kp_proc.p_stat + +-#if LIBGTOP_VERSION_CODE >= 1001000 +- buf->ruid = pinfo [0].kp_eproc.e_pcred.p_ruid; +- buf->rgid = pinfo [0].kp_eproc.e_pcred.p_rgid; + #endif + ++ strncpy (buf->cmd, pinfo [0].XXX_P_COMM, sizeof (buf->cmd)-1); ++ buf->cmd [sizeof (buf->cmd)-1] = 0; ++ ++ buf->uid = pinfo [0].XXX_P_SVUID; ++ buf->gid = pinfo [0].XXX_P_SVGID; ++ + /* Set the flags for the data we're about to return*/ + buf->flags = _glibtop_sysdeps_proc_state | + _glibtop_sysdeps_proc_state_new; + +-#if LIBGTOP_VERSION_CODE >= 1001000 +- switch (pinfo [0].kp_proc.p_stat) { +- case SIDL: +- buf->state = 0; +- break; +- case SRUN: +- buf->state = GLIBTOP_PROCESS_RUNNING; +- break; +- case SSLEEP: +- buf->state = GLIBTOP_PROCESS_INTERRUPTIBLE; +- break; +- case SSTOP: +- buf->state = GLIBTOP_PROCESS_STOPPED; +- break; +- case SZOMB: +- buf->state = GLIBTOP_PROCESS_ZOMBIE; +- break; +- default: +- return; +- } +-#else +- switch (pinfo [0].kp_proc.p_stat) { ++ switch (pinfo [0].XXX_P_STAT) { + case SIDL: + buf->state = 'S'; + break; +@@ -131,7 +119,6 @@ + default: + return; + } +-#endif + + buf->flags |= (1L << GLIBTOP_PROC_STATE_STATE); + } +--- sysdeps/freebsd/procuid.c.orig Fri Sep 17 06:08:07 1999 ++++ sysdeps/freebsd/procuid.c Thu Feb 15 01:16:50 2001 +@@ -86,13 +86,42 @@ + +- buf->uid = pinfo [0].kp_eproc.e_pcred.p_ruid; +- buf->euid = pinfo [0].kp_eproc.e_pcred.p_svuid; +- buf->gid = pinfo [0].kp_eproc.e_pcred.p_rgid; +- buf->egid = pinfo [0].kp_eproc.e_pcred.p_svgid; +- +- buf->ppid = pinfo [0].kp_eproc.e_ppid; +- buf->pgrp = pinfo [0].kp_eproc.e_pgid; +- buf->tpgid = pinfo [0].kp_eproc.e_tpgid; ++#if __FreeBSD_version >= 500013 + +- buf->nice = pinfo [0].kp_proc.p_nice; +- buf->priority = pinfo [0].kp_proc.p_priority; ++#define XXX_P_RUID ki_ruid ++#define XXX_P_SVUID ki_svuid ++#define XXX_P_RGID ki_rgid ++#define XXX_P_SVGID ki_svgid ++#define XXX_E_PPID ki_ppid ++#define XXX_E_PGID ki_pgid ++#define XXX_E_TPGID ki_tpgid ++#define XXX_P_NICE ki_nice ++#if __FreeBSD_version >= 500013 ++#define XXX_P_PRIORITY ki_pri.pri_user ++#else ++#define XXX_P_PRIORITY ki_priority ++#endif ++#else ++ ++#define XXX_P_RUID kp_eproc.e_pcred.p_ruid ++#define XXX_P_SVUID kp_eproc.e_pcred.p_svuid ++#define XXX_P_RGID kp_eproc.e_pcred.p_rgid ++#define XXX_P_SVGID kp_eproc.e_pcred.p_svgid ++#define XXX_E_PPID kp_eproc.e_ppid ++#define XXX_E_PGID kp_eproc.e_pgid ++#define XXX_E_TPGID kp_eproc.e_tpgid ++#define XXX_P_NICE kp_proc.p_nice ++#define XXX_P_PRIORITY kp_proc.p_priority ++ ++#endif ++ ++ buf->uid = pinfo [0].XXX_P_RUID; ++ buf->euid = pinfo [0].XXX_P_SVUID; ++ buf->gid = pinfo [0].XXX_P_RGID; ++ buf->egid = pinfo [0].XXX_P_SVGID; ++ ++ buf->ppid = pinfo [0].XXX_E_PPID; ++ buf->pgrp = pinfo [0].XXX_E_PGID; ++ buf->tpgid = pinfo [0].XXX_E_TPGID; ++ ++ buf->nice = pinfo [0].XXX_P_NICE; ++ buf->priority = pinfo [0].XXX_P_PRIORITY; + +--- sysdeps/freebsd/procmem.c.orig Thu May 27 13:56:49 1999 ++++ sysdeps/freebsd/procmem.c Wed Dec 27 10:16:26 2000 +@@ -139,2 +139,18 @@ + ++#if __FreeBSD_version >= 500013 ++ ++#define XXX_P_VMSPACE ki_vmspace ++ ++ buf->rss_rlim = pinfo [0].ki_rssize; ++ ++ buf->vsize = buf->size = (u_int64_t) pagetok ++ (pinfo [0].ki_tsize + pinfo [0].ki_dsize + pinfo[0].ki_ssize) ++ << LOG1024; ++ buf->resident = buf->rss = (u_int64_t) pagetok ++ (pinfo [0].ki_rssize) << LOG1024; ++ ++#else ++ ++#define XXX_P_VMSPACE kp_proc.p_vmspace ++ + if (kvm_read (server->machine.kd, +@@ -156,2 +172,3 @@ + (vms->vm_rssize) << LOG1024; ++#endif + +@@ -160,3 +177,3 @@ + if (kvm_read (server->machine.kd, +- (unsigned long) pinfo [0].kp_proc.p_vmspace, ++ (unsigned long) pinfo [0].XXX_P_VMSPACE, + (char *) &vmspace, sizeof (vmspace)) != sizeof (vmspace)) { +--- sysdeps/freebsd/procsignal.c.orig Sun Feb 13 15:31:39 2000 ++++ sysdeps/freebsd/procsignal.c Wed Dec 27 10:22:28 2000 +@@ -69,2 +69,18 @@ + ++#if __FreeBSD_version >= 500013 ++ ++#define XXX_P_SIGLIST ki_siglist ++#define XXX_P_SIGMASK ki_sigmask ++#define XXX_P_SIGIGNORE ki_sigignore ++#define XXX_P_SIGCATCH ki_sigcatch ++ ++#else ++ ++#define XXX_P_SIGLIST kp_proc.p_siglist ++#define XXX_P_SIGMASK kp_proc.p_sigmask ++#define XXX_P_SIGIGNORE kp_proc.p_sigignore ++#define XXX_P_SIGCATCH kp_proc.p_sigcatch ++ ++#endif ++ + /* signal: mask of pending signals. +@@ -73,3 +89,3 @@ + #if (defined(__NetBSD__) && (NSIG > 32)) || (__FreeBSD_version >= 400011) +- buf->signal [0] = pinfo [0].kp_proc.p_siglist.__bits[0]; ++ buf->signal [0] = pinfo [0].XXX_P_SIGLIST.__bits[0]; + #else +@@ -82,3 +98,3 @@ + #if (defined(__NetBSD__) && (NSIG > 32)) || (__FreeBSD_version >= 400011) +- buf->blocked [0] = pinfo [0].kp_proc.p_sigmask.__bits[0]; ++ buf->blocked [0] = pinfo [0].XXX_P_SIGMASK.__bits[0]; + #else +@@ -91,3 +107,3 @@ + #if (defined(__NetBSD__) && (NSIG > 32)) || (__FreeBSD_version >= 400011) +- buf->sigignore [0] = pinfo [0].kp_proc.p_sigignore.__bits[0]; ++ buf->sigignore [0] = pinfo [0].XXX_P_SIGIGNORE.__bits[0]; + #else +@@ -100,3 +116,3 @@ + #if (defined(__NetBSD__) && (NSIG > 32)) || (__FreeBSD_version >= 400011) +- buf->sigcatch [0] = pinfo [0].kp_proc.p_sigcatch.__bits[0]; ++ buf->sigcatch [0] = pinfo [0].XXX_P_SIGCATCH.__bits[0]; + #else +--- sysdeps/freebsd/prockernel.c.orig Sat Oct 16 13:31:43 1999 ++++ sysdeps/freebsd/prockernel.c Wed Dec 27 10:50:19 2000 +@@ -36,8 +36,2 @@ + #endif +-#if !defined(__bsdi__) && !(defined(__FreeBSD__) && defined(__alpha__)) +-#include <machine/pcb.h> +-#endif +-#if defined(__FreeBSD__) && !defined(__alpha__) +-#include <machine/tss.h> +-#endif + +@@ -80,10 +74,4 @@ + struct kinfo_proc *pinfo; +- struct user *u_addr = (struct user *)USRSTACK; +- struct pstats pstats; +- struct pcb pcb; + int count; + +- char filename [BUFSIZ]; +- struct stat statb; +- + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_KERNEL), 0); +@@ -103,7 +91,21 @@ + +- buf->nwchan = (unsigned long) pinfo [0].kp_proc.p_wchan &~ KERNBASE; ++#if __FreeBSD_version >= 500013 ++ ++#define XXX_P_WCHAN ki_wchan ++#define XXX_P_WMESG ki_wmesg ++#define XXX_E_WMESG ki_wmesg ++ ++#else ++ ++#define XXX_P_WCHAN kp_proc.p_wchan ++#define XXX_P_WMESG kp_proc.p_wmesg ++#define XXX_E_WMESG kp_eproc.e_wmesg ++ ++#endif ++ ++ buf->nwchan = (unsigned long) pinfo [0].XXX_P_WCHAN &~ KERNBASE; + buf->flags |= (1L << GLIBTOP_PROC_KERNEL_NWCHAN); + +- if (pinfo [0].kp_proc.p_wchan && pinfo [0].kp_proc.p_wmesg) { +- strncpy (buf->wchan, pinfo [0].kp_eproc.e_wmesg, ++ if (pinfo [0].XXX_P_WCHAN && pinfo [0].XXX_P_WMESG) { ++ strncpy (buf->wchan, pinfo [0].XXX_E_WMESG, + sizeof (buf->wchan) - 1); +@@ -115,70 +117,8 @@ + +- /* Taken from `saveuser ()' in `/usr/src/bin/ps/ps.c'. */ +- +- /* [FIXME]: /usr/include/sys/user.h tells me that the user area +- * may or may not be at the same kernel address in all +- * processes, but I don't see any way to get that address. +- * Since `ps' simply uses its own address, I think it's +- * safe to do this here, too. */ +- +- /* NOTE: You need to mount the /proc filesystem to make +- * `kvm_uread' work. */ +- +- sprintf (filename, "/proc/%d/mem", (int) pid); +- if (stat (filename, &statb)) return; +- +- glibtop_suid_enter (server); +- +- if ((pinfo [0].kp_proc.p_flag & P_INMEM) && +- kvm_uread (server->machine.kd, &(pinfo [0]).kp_proc, +- (unsigned long) &u_addr->u_stats, +- (char *) &pstats, sizeof (pstats)) == sizeof (pstats)) +- { +- /* +- * The u-area might be swapped out, and we can't get +- * at it because we have a crashdump and no swap. +- * If it's here fill in these fields, otherwise, just +- * leave them 0. +- */ +- +- buf->min_flt = (u_int64_t) pstats.p_ru.ru_minflt; +- buf->maj_flt = (u_int64_t) pstats.p_ru.ru_majflt; +- buf->cmin_flt = (u_int64_t) pstats.p_cru.ru_minflt; +- buf->cmaj_flt = (u_int64_t) pstats.p_cru.ru_majflt; +- +- buf->flags |= _glibtop_sysdeps_proc_kernel_pstats; +- } +- +- if ((pinfo [0].kp_proc.p_flag & P_INMEM) && +- kvm_uread (server->machine.kd, &(pinfo [0]).kp_proc, +- (unsigned long) &u_addr->u_pcb, +- (char *) &pcb, sizeof (pcb)) == sizeof (pcb)) +- { +-#ifdef __FreeBSD__ +-#ifndef __alpha__ +-#if (__FreeBSD_version >= 300003) +- buf->kstk_esp = (u_int64_t) pcb.pcb_esp; +- buf->kstk_eip = (u_int64_t) pcb.pcb_eip; +-#else +- buf->kstk_esp = (u_int64_t) pcb.pcb_ksp; +- buf->kstk_eip = (u_int64_t) pcb.pcb_pc; +-#endif +-#else +- /*xxx FreeBSD/Alpha? */ +-#endif +-#else +- buf->kstk_esp = (u_int64_t) pcb.pcb_tss.tss_esp0; +-#ifdef __bsdi__ +- buf->kstk_eip = (u_int64_t) pcb.pcb_tss.tss_eip; +-#else +- buf->kstk_eip = (u_int64_t) pcb.pcb_tss.__tss_eip; +-#endif +- +- buf->flags |= _glibtop_sysdeps_proc_kernel_pcb; +-#endif +- } +- +- /* Taken from `wchan ()' in `/usr/src/bin/ps/print.c'. */ +- +- glibtop_suid_leave (server); ++ /* XXX: the code here was, quite frankly, junk, and almost ++ * certainly wrong - remove it all, leave these fields ++ * unpopulated, and give up until such time as the right ++ * code is produced for both FreeBSD 4.x and 5.x ++ */ ++ return; + } diff --git a/devel/libgtop2/files/patch-configure b/devel/libgtop2/files/patch-configure new file mode 100644 index 000000000..d62e2fc92 --- /dev/null +++ b/devel/libgtop2/files/patch-configure @@ -0,0 +1,56 @@ +--- configure.orig Sun Feb 10 09:30:14 2002 ++++ configure Thu May 9 01:40:00 2002 +@@ -1249,10 +1249,10 @@ + + # The aliases save the names the user supplied, while $host etc. + # will get canonicalized. +-test -n "$target_alias" && +- test "$program_prefix$program_suffix$program_transform_name" = \ +- NONENONEs,x,x, && +- program_prefix=${target_alias}- ++#test -n "$target_alias" && ++# test "$program_prefix$program_suffix$program_transform_name" = \ ++# NONENONEs,x,x, && ++# program_prefix=${target_alias}- + + LIBGTOP_MAJOR_VERSION=1 + LIBGTOP_MINOR_VERSION=90 +@@ -1526,9 +1526,9 @@ + + # libtool versioning + LT_RELEASE=$LIBGTOP_MAJOR_VERSION.$LIBGTOP_MINOR_VERSION +-LT_CURRENT=`expr $LIBGTOP_MICRO_VERSION - $LIBGTOP_INTERFACE_AGE` +-LT_REVISION=$LIBGTOP_INTERFACE_AGE +-LT_AGE=`expr $LIBGTOP_BINARY_AGE - $LIBGTOP_INTERFACE_AGE` ++LT_CURRENT=2 ++LT_REVISION=0 ++LT_AGE=0 + LT_VERSION_INFO='-version-info ${LT_CURRENT}:${LT_REVISION}:${LT_AGE}' + + ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I ." +@@ -7491,6 +7491,7 @@ + + # This can be used to rebuild libtool when needed + LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" ++$ac_aux_dir/ltconfig $LIBTOOL_DEPS + + # Always use our own libtool. + LIBTOOL='$(SHELL) $(top_builddir)/libtool' +@@ -15639,7 +15640,7 @@ + LIBGTOP_GUILE_LIBS="$LIBGTOP_LIBS" + LIBGTOP_GUILE_INCS="$LIBGTOP_INCS" + LIBGTOP_BINDIR='$(bindir)' +-LIBGTOP_SERVER='$(bindir)/libgtop_server' ++LIBGTOP_SERVER='$(bindir)/libgtop_server2' + + sysdeps_dir="$libgtop_sysdeps_dir" + +@@ -15688,7 +15689,7 @@ + + if test x$libgtop_need_server = xyes ; then + sysdeps_suid_lib="\$(top_builddir)/sysdeps/\$(sysdeps_dir)/libgtop_sysdeps_suid-2.0.la" +- server_programs='libgtop_server' ++ server_programs='libgtop_server2' + else + sysdeps_suid_lib= + server_programs= diff --git a/devel/libgtop2/files/patch-libgtop-2.0.pc.in b/devel/libgtop2/files/patch-libgtop-2.0.pc.in new file mode 100644 index 000000000..fae24611e --- /dev/null +++ b/devel/libgtop2/files/patch-libgtop-2.0.pc.in @@ -0,0 +1,11 @@ +--- libgtop-2.0.pc.in.orig Mon Apr 29 22:35:22 2002 ++++ libgtop-2.0.pc.in Mon Apr 29 22:35:35 2002 +@@ -7,7 +7,7 @@ + Description: Portable System Access Library + Requires: glib-2.0 + Version: @VERSION@ +-Libs: -L${libdir} @LIBGTOP_LIBS@ ++Libs: -L${libdir} @LIBGTOP_LIBS@ @LIBGTOP_EXTRA_LIBS@ + Cflags: -I${includedir}/libgtop-2.0 + + diff --git a/devel/libgtop2/files/patch-src::daemon::gnuserv.c b/devel/libgtop2/files/patch-src::daemon::gnuserv.c new file mode 100644 index 000000000..8b0712a8d --- /dev/null +++ b/devel/libgtop2/files/patch-src::daemon::gnuserv.c @@ -0,0 +1,15 @@ +--- src/daemon/gnuserv.c.orig Thu Nov 29 08:58:40 2001 ++++ src/daemon/gnuserv.c Thu Nov 29 08:58:17 2001 +@@ -200,6 +200,12 @@ + + auth_data_len = atoi (buf); + ++ if (auth_data_len < 1 || auth_data_len > sizeof(buf)) { ++ syslog_message(LOG_WARNING, ++ "Invalid data length supplied by client"); ++ return FALSE; ++ } ++ + if (timed_read (fd, buf, auth_data_len, AUTH_TIMEOUT, 0) != auth_data_len) + return FALSE; + diff --git a/devel/libgtop2/files/patch-src_daemon_Makefile.in b/devel/libgtop2/files/patch-src_daemon_Makefile.in new file mode 100644 index 000000000..04aa141eb --- /dev/null +++ b/devel/libgtop2/files/patch-src_daemon_Makefile.in @@ -0,0 +1,11 @@ +--- src/daemon/Makefile.in.orig Mon Apr 29 12:05:45 2002 ++++ src/daemon/Makefile.in Mon Apr 29 12:12:14 2002 +@@ -92,7 +92,7 @@ + LIBGTOP_GUILE_NAMES_LIBS = @LIBGTOP_GUILE_NAMES_LIBS@ + LIBGTOP_INCS = @LIBGTOP_INCS@ + LIBGTOP_INTERFACE_AGE = @LIBGTOP_INTERFACE_AGE@ +-LIBGTOP_LIBS = @LIBGTOP_LIBS@ ++LIBGTOP_LIBS = + LIBGTOP_MAJOR_VERSION = @LIBGTOP_MAJOR_VERSION@ + LIBGTOP_MICRO_VERSION = @LIBGTOP_MICRO_VERSION@ + LIBGTOP_MINOR_VERSION = @LIBGTOP_MINOR_VERSION@ diff --git a/devel/libgtop2/files/patch-support_Makefile.in b/devel/libgtop2/files/patch-support_Makefile.in new file mode 100644 index 000000000..d86420f5c --- /dev/null +++ b/devel/libgtop2/files/patch-support_Makefile.in @@ -0,0 +1,11 @@ +--- support/Makefile.in.orig Mon Apr 29 13:02:18 2002 ++++ support/Makefile.in Mon Apr 29 13:03:33 2002 +@@ -146,7 +146,7 @@ + sysdeps_dir = @sysdeps_dir@ + sysdeps_suid_lib = @sysdeps_suid_lib@ + +-supportexecincludedir = $(pkglibdir)/include ++supportexecincludedir = $(includedir)/libgtop-2.0 + + INCLUDES = -D_GNU_SOURCE + diff --git a/devel/libgtop2/files/patch-sysdeps::freebsd::proctime.c b/devel/libgtop2/files/patch-sysdeps::freebsd::proctime.c new file mode 100644 index 000000000..f26b953a8 --- /dev/null +++ b/devel/libgtop2/files/patch-sysdeps::freebsd::proctime.c @@ -0,0 +1,138 @@ +--- sysdeps/freebsd/proctime.c.orig Mon Jun 10 17:34:42 2002 ++++ sysdeps/freebsd/proctime.c Wed Oct 2 21:18:38 2002 +@@ -57,6 +57,7 @@ + * system, and interrupt time usage. + */ + ++#ifndef __FreeBSD__ + static void + calcru(p, up, sp, ip) + struct proc *p; +@@ -66,9 +67,6 @@ + { + quad_t totusec; + u_quad_t u, st, ut, it, tot; +-#if (__FreeBSD_version < 300003) +- long sec, usec; +-#endif + struct timeval tv; + + st = p->p_sticks; +@@ -81,19 +79,10 @@ + tot = 1; + } + +-#if (defined __FreeBSD__) && (__FreeBSD_version >= 300003) +- +- /* This was changed from a `struct timeval' into a `u_int64_t' +- * on FreeBSD 3.0 and renamed p_rtime -> p_runtime. +- */ +- +- totusec = (u_quad_t) p->p_runtime; +-#else + sec = p->p_rtime.tv_sec; + usec = p->p_rtime.tv_usec; + + totusec = (quad_t)sec * 1000000 + usec; +-#endif + + if (totusec < 0) { + /* XXX no %qd in kernel. Truncate. */ +@@ -116,6 +105,7 @@ + ip->tv_usec = it % 1000000; + } + } ++#endif + + /* Provides detailed information about a process. */ + +@@ -142,25 +132,25 @@ + /* It does not work for the swapper task. */ + if (pid == 0) return; + +-#if !(defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)) ++#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)) + if (server->sysdeps.proc_time == 0) + return; + ++#endif + #ifndef __bsdi__ + sprintf (filename, "/proc/%d/mem", (int) pid); + if (stat (filename, &statb)) return; + #endif +-#endif + + /* Get the process information */ + pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count); + if ((pinfo == NULL) || (count != 1)) + glibtop_error_io_r (server, "kvm_getprocs (%d)", pid); + +-#if (defined __FreeBSD__) && (__FreeBSD_version >= 300003) +- buf->rtime = pinfo [0].kp_proc.p_runtime; ++#if (defined __FreeBSD__) && (__FreeBSD_version >= 500013) ++ buf->rtime = pinfo [0].ki_runtime; + #else +- buf->rtime = tv2sec (pinfo [0].kp_proc.p_rtime); ++ buf->rtime = pinfo [0].kp_proc.p_runtime; + #endif + + buf->frequency = 1000000; +@@ -192,6 +182,21 @@ + + buf->flags |= _glibtop_sysdeps_proc_time_user; + #else ++#if __FreeBSD_version >= 500013 ++#if __FreeBSD_version >= 500016 ++ if ((pinfo [0].ki_flag & PS_INMEM)) { ++#else ++ if ((pinfo [0].ki_flag & P_INMEM)) { ++#endif ++ buf->utime = pinfo [0].ki_runtime; ++ buf->stime = 0; /* XXX */ ++ buf->cutime = tv2sec (pinfo [0].ki_childtime); ++ buf->cstime = 0; /* XXX */ ++ buf->start_time = tv2sec (pinfo [0].ki_start); ++ buf->flags = _glibtop_sysdeps_proc_time_user; ++ } ++ ++#else + glibtop_suid_enter (server); + + if ((pinfo [0].kp_proc.p_flag & P_INMEM) && +@@ -199,29 +204,16 @@ + (unsigned long) &u_addr->u_stats, + (char *) &pstats, sizeof (pstats)) == sizeof (pstats)) + { +- /* This is taken form the kernel source code of +- * FreeBSD 2.2.6. */ +- +- /* Well, we just do the same getrusage () does ... */ +- +- register struct rusage *rup; +- +- glibtop_suid_leave (server); +- +- rup = &pstats.p_ru; +- calcru(&(pinfo [0]).kp_proc, +- &rup->ru_utime, &rup->ru_stime, NULL); +- +- buf->utime = tv2sec (pstats.p_ru.ru_utime); +- buf->stime = tv2sec (pstats.p_ru.ru_stime); +- +- buf->cutime = tv2sec (pstats.p_cru.ru_utime); +- buf->cstime = tv2sec (pstats.p_cru.ru_stime); +- +- buf->start_time = tv2sec (pstats.p_start); + ++ buf->utime = tv2sec (pinfo[0].kp_eproc.e_stats.p_ru.ru_utime); ++ buf->stime = tv2sec (pinfo[0].kp_eproc.e_stats.p_ru.ru_stime); ++ buf->cutime = tv2sec (pinfo[0].kp_eproc.e_stats.p_cru.ru_utime); ++ buf->cstime = tv2sec (pinfo[0].kp_eproc.e_stats.p_cru.ru_stime); ++ buf->start_time = tv2sec (pinfo[0].kp_eproc.e_stats.p_start); + buf->flags = _glibtop_sysdeps_proc_time_user; ++ glibtop_suid_leave (server); + } ++#endif + + glibtop_suid_leave (server); + #endif diff --git a/devel/libgtop2/files/patch-sysdeps_freebsd_swap.c b/devel/libgtop2/files/patch-sysdeps_freebsd_swap.c new file mode 100644 index 000000000..4896a16a8 --- /dev/null +++ b/devel/libgtop2/files/patch-sysdeps_freebsd_swap.c @@ -0,0 +1,13 @@ +--- sysdeps/freebsd/swap.c.orig Mon Aug 26 20:18:07 2002 ++++ sysdeps/freebsd/swap.c Mon Aug 26 20:19:18 2002 +@@ -369,8 +369,8 @@ + + buf->flags = _glibtop_sysdeps_swap; + +- buf->used = kvmsw[nswdev].ksw_used; +- buf->total = kvmsw[nswdev].ksw_total; ++ buf->used = kvmsw[nswdev].ksw_used * getpagesize(); ++ buf->total = kvmsw[nswdev].ksw_total * getpagesize(); + + buf->free = buf->total - buf->used; + |