From owner-freebsd-current Fri Oct 4 9: 6:40 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7D34037B401 for ; Fri, 4 Oct 2002 09:06:34 -0700 (PDT) Received: from creme-brulee.marcuscom.com (rdu57-17-158.nc.rr.com [66.57.17.158]) by mx1.FreeBSD.org (Postfix) with ESMTP id CF27443E77 for ; Fri, 4 Oct 2002 09:06:33 -0700 (PDT) (envelope-from marcus@marcuscom.com) Received: from [10.2.1.2] (vpn-client-2.marcuscom.com [10.2.1.2]) by creme-brulee.marcuscom.com (8.12.5/8.12.5) with ESMTP id g94G1Wiv027808; Fri, 4 Oct 2002 12:01:32 -0400 (EDT) (envelope-from marcus@marcuscom.com) Subject: Re: GNOME 2.0 DOES NOT COMPILE From: Joe Marcus Clarke To: Lars Eggert Cc: The Gupta Age , freebsd-current@FreeBSD.ORG In-Reply-To: <3D9DA821.4080809@isi.edu> References: <20021004015919.P30152-100000@kashmir.etowns.net> <3D9DA821.4080809@isi.edu> Content-Type: multipart/mixed; boundary="=-MlR/n6sgYDu17+TV/sQm" X-Mailer: Ximian Evolution 1.0.8 Date: 04 Oct 2002 12:06:10 -0400 Message-Id: <1033747570.319.16.camel@gyros.marcuscom.com> Mime-Version: 1.0 X-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES, SPAM_PHRASE_00_01 version=2.41 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --=-MlR/n6sgYDu17+TV/sQm Content-Type: text/plain Content-Transfer-Encoding: 7bit On Fri, 2002-10-04 at 10:39, Lars Eggert wrote: > The Gupta Age wrote: > > Hi. > > > > I was trying to compile GNOME 2.0 on a freebsd current > > machine on which the world was recently cvsuped, built > > and installed. CVSUP-ed on 09/22/2002 > > > > the gnome compilation breaks while trying to compile > > libgtop2. here is the error: > > I ran into the same problem last week. Check the archives for the > "sys/sys/proc.h 1.250 breaks devel/libgtop2 port" thread, it has some > fixes in its replies. Okay, I'm back from vacation, here are the patches. These will be committed when the ports freeze lifts. Thanks goes to julian for pointing me to using a pure libkvm solution. Joe > > Lars > -- > Lars Eggert USC Information Sciences Institute -- PGP Key : http://www.marcuscom.com/pgp.asc --=-MlR/n6sgYDu17+TV/sQm Content-Disposition: attachment; filename="patch-sysdeps::freebsd::proctime.c" Content-Transfer-Encoding: quoted-printable Content-Type: text/x-c; name="patch-sysdeps::freebsd::proctime.c"; charset=ISO8859-1 --- 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. */ =20 +#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; =20 st =3D p->p_sticks; @@ -81,19 +79,10 @@ tot =3D 1; } =20 -#if (defined __FreeBSD__) && (__FreeBSD_version >=3D 300003) - - /* This was changed from a `struct timeval' into a `u_int64_t' - * on FreeBSD 3.0 and renamed p_rtime -> p_runtime. - */ - - totusec =3D (u_quad_t) p->p_runtime; -#else sec =3D p->p_rtime.tv_sec; usec =3D p->p_rtime.tv_usec; =20 totusec =3D (quad_t)sec * 1000000 + usec; -#endif =20 if (totusec < 0) { /* XXX no %qd in kernel. Truncate. */ @@ -116,6 +105,7 @@ ip->tv_usec =3D it % 1000000; } } +#endif =20 /* Provides detailed information about a process. */ =20 @@ -142,25 +132,25 @@ /* It does not work for the swapper task. */ if (pid =3D=3D 0) return; =09 -#if !(defined(__NetBSD__) && (__NetBSD_Version__ >=3D 104000000)) +#if (defined(__NetBSD__) && (__NetBSD_Version__ >=3D 104000000)) if (server->sysdeps.proc_time =3D=3D 0) return; =20 +#endif #ifndef __bsdi__ sprintf (filename, "/proc/%d/mem", (int) pid); if (stat (filename, &statb)) return; #endif -#endif =20 /* Get the process information */ pinfo =3D kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count); if ((pinfo =3D=3D NULL) || (count !=3D 1)) glibtop_error_io_r (server, "kvm_getprocs (%d)", pid); =20 -#if (defined __FreeBSD__) && (__FreeBSD_version >=3D 300003) - buf->rtime =3D pinfo [0].kp_proc.p_runtime; +#if (defined __FreeBSD__) && (__FreeBSD_version >=3D 500013) + buf->rtime =3D pinfo [0].ki_runtime; #else - buf->rtime =3D tv2sec (pinfo [0].kp_proc.p_rtime); + buf->rtime =3D pinfo [0].kp_proc.p_runtime; #endif =20 buf->frequency =3D 1000000; @@ -192,6 +182,21 @@ =20 buf->flags |=3D _glibtop_sysdeps_proc_time_user; #else +#if __FreeBSD_version >=3D 500013 +#if __FreeBSD_version >=3D 500016 + if ((pinfo [0].ki_flag & PS_INMEM)) { +#else + if ((pinfo [0].ki_flag & P_INMEM)) { +#endif + buf->utime =3D pinfo [0].ki_runtime; + buf->stime =3D 0; /* XXX */ + buf->cutime =3D tv2sec (pinfo [0].ki_childtime); + buf->cstime =3D 0; /* XXX */ + buf->start_time =3D tv2sec (pinfo [0].ki_start); + buf->flags =3D _glibtop_sysdeps_proc_time_user; + } + +#else glibtop_suid_enter (server); =20 if ((pinfo [0].kp_proc.p_flag & P_INMEM) && @@ -199,29 +204,16 @@ (unsigned long) &u_addr->u_stats, (char *) &pstats, sizeof (pstats)) =3D=3D 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 =3D &pstats.p_ru; - calcru(&(pinfo [0]).kp_proc, - &rup->ru_utime, &rup->ru_stime, NULL); - - buf->utime =3D tv2sec (pstats.p_ru.ru_utime); - buf->stime =3D tv2sec (pstats.p_ru.ru_stime); - =09 - buf->cutime =3D tv2sec (pstats.p_cru.ru_utime); - buf->cstime =3D tv2sec (pstats.p_cru.ru_stime); - - buf->start_time =3D tv2sec (pstats.p_start); =20 + buf->utime =3D tv2sec (pinfo[0].kp_eproc.e_stats.p_ru.ru_utime); + buf->stime =3D tv2sec (pinfo[0].kp_eproc.e_stats.p_ru.ru_stime); + buf->cutime =3D tv2sec (pinfo[0].kp_eproc.e_stats.p_cru.ru_utime); + buf->cstime =3D tv2sec (pinfo[0].kp_eproc.e_stats.p_cru.ru_stime); + buf->start_time =3D tv2sec (pinfo[0].kp_eproc.e_stats.p_start); buf->flags =3D _glibtop_sysdeps_proc_time_user; + glibtop_suid_leave (server); } +#endif =20 glibtop_suid_leave (server); #endif --=-MlR/n6sgYDu17+TV/sQm Content-Disposition: attachment; filename=patch-ah Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; name=patch-ah; charset=ISO8859-1 --- sysdeps/freebsd/procmap.c.orig Mon Jun 10 17:34:42 2002 +++ sysdeps/freebsd/procmap.c Fri Sep 20 16:10:37 2002 @@ -33,7 +33,11 @@ #include #include #include +#if (__FreeBSD_version >=3D 400011) +#include +#else #include +#endif #include =20 #include @@ -92,7 +96,6 @@ #if defined __FreeBSD__ struct vnode vnode; struct inode inode; - struct mount mount; #endif int count, i =3D 0; int update =3D 0; @@ -114,7 +117,11 @@ /* Now we get the memory maps. */ =20 if (kvm_read (server->machine.kd, +#if (__FreeBSD_version >=3D 500013) + (unsigned long) pinfo [0].ki_vmspace, +#else (unsigned long) pinfo [0].kp_proc.p_vmspace, +#endif (char *) &vmspace, sizeof (vmspace)) !=3D sizeof (vmspace)) glibtop_error_io_r (server, "kvm_read (vmspace)"); =20 @@ -244,18 +251,17 @@ &vnode, sizeof (vnode)) !=3D sizeof (vnode)) glibtop_error_io_r (server, "kvm_read (vnode)"); =20 +#if __FreeBSD_version > 500039 + if ((vnode.v_type !=3D VREG) || strcmp("ufs", vnode.v_tag) || +#else if ((vnode.v_type !=3D VREG) || (vnode.v_tag !=3D VT_UFS) || +#endif !vnode.v_data) continue; =20 if (kvm_read (server->machine.kd, (unsigned long) vnode.v_data, &inode, sizeof (inode)) !=3D sizeof (inode)) glibtop_error_io_r (server, "kvm_read (inode)"); - - if (kvm_read (server->machine.kd, - (unsigned long) vnode.v_mount, - &mount, sizeof (mount)) !=3D sizeof (mount)) - glibtop_error_io_r (server, "kvm_read (mount)"); =20 maps [i-1].inode =3D inode.i_number; maps [i-1].device =3D inode.i_dev; --=-MlR/n6sgYDu17+TV/sQm-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message