Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 06 Jun 1995 09:26:14 +0200
From:      "Philippe Charnier" <charnier@lirmm.fr>
To:        ports@FreeBSD.org
Subject:   top & swap.
Message-ID:  <199506060726.JAA06138@lirmm.lirmm.fr>

next in thread | raw e-mail | index | archive | help
Hello,

I think I found something strange in the top-3.3 directory, and maybe
the reason why swap is not displayed correctly.


patch-ab was patching work/machine/m_freebsd20.c but the file
files/machine.c was used instead (with another patch applied but
without patch-ab in).

the fix is
- remove files/machine.c (patch-ab now contains the 2 patches).
- replace patch-ab with the new one.
- replace scripts/post-configure (the new one simply copy
     work/machine/m_freebsd20.c into work/machine.c instead of using
     files/machine.c).


===================================== post-configure
#!/bin/sh
#
# $Id: post-configure,v 1.3 1995/01/04 19:31:43 swallace Exp $
#

cp -f ${CURDIR}/files/Makefile ${WRKSRC}
cp -f ${CURDIR}/files/top.local.h ${WRKSRC}
cp -f ${CURDIR}/files/top.1 ${WRKSRC}
cp -f ${WRKSRC}/machine/m_freebsd20.c ${WRKSRC}/machine.c

===================================== patch-ab
*** machine/m_freebsd20.c.orig	Mon Jun  5 16:42:38 1995
--- machine/m_freebsd20.c	Mon Jun  5 16:44:53 1995
***************
*** 157,163 ****
  
  char *state_abbrev[] =
  {
!     "", "start", "run\0\0\0", "sleep", "stop", "zomb", "WAIT"
  };
  
  
--- 157,163 ----
  
  char *state_abbrev[] =
  {
!     "", "start", "run\0\0\0", "sleep", "stop", "zomb",
  };
  
  
***************
*** 192,201 ****
  
  /* these are for detailing the process states */
  
! int process_states[7];
  char *procstatenames[] = {
      "", " starting, ", " running, ", " sleeping, ", " stopped, ",
!     " zombie, ", " ABANDONED, ",
      NULL
  };
  
--- 192,201 ----
  
  /* these are for detailing the process states */
  
! int process_states[6];
  char *procstatenames[] = {
      "", " starting, ", " running, ", " sleeping, ", " stopped, ",
!     " zombie, ",
      NULL
  };
  
***************
*** 816,821 ****
--- 816,822 ----
  	int i, div, avail, nfree, npfree, used;
  	struct swdevt *sw;
  	long blocksize, *perdev;
+ 	u_long ptr;
  	struct rlist head;
  	struct rlist *swaplist;
  
***************
*** 826,832 ****
  	if ((sw = (struct swdevt *)malloc(nswdev * sizeof(*sw))) == NULL ||
  	    (perdev = (long *)malloc(nswdev * sizeof(*perdev))) == NULL)
  		err(1, "malloc");
! 	KGET1(VM_SWDEVT, sw, nswdev * sizeof(*sw), "swdevt");
  
  	/* Count up swap space. */
  	nfree = 0;
--- 827,834 ----
  	if ((sw = (struct swdevt *)malloc(nswdev * sizeof(*sw))) == NULL ||
  	    (perdev = (long *)malloc(nswdev * sizeof(*perdev))) == NULL)
  		err(1, "malloc");
! 	KGET1(VM_SWDEVT, &ptr, sizeof ptr, "swdevt");
! 	KGET2(ptr, sw, nswdev * sizeof(*sw), "*swdevt");
  
  	/* Count up swap space. */
  	nfree = 0;





--------                                                        --------
Philippe Charnier                                      charnier@lirmm.fr
                               

         LIRMM, 161 rue Ada, 34392 Montpellier cedex 5 -- France
------------------------------------------------------------------------







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199506060726.JAA06138>