bug in sps memory size reporting for Sun-3

Alexander Dupuy dupuy at douglass.columbia.edu
Fri May 20 10:27:38 AEST 1988


I'm shocked I never noticed this before, but lots of programs (like the csh)
report erroneous memory sizes.  At any rate, the Sun-2 and Sun-2 have different
page sizes (2K for the Sun-2, 8K for the Sun-3).  The header file sps.h assumed
that all Suns would have a page size of 2K.

Here are the diffs:
*** sps.h.dist	Tue Feb 24 18:44:50 1987
--- sps.h	Thu May 19 20:20:49 1988
***************
*** 22,31 ****
  # endif
  
  /* Convert clicks to kbytes ... */
! # ifdef SUN
  # define        KBYTES( size )  ((size) << 1)
  # else
  # define        KBYTES( size )  ((size) >> (10 - PGSHIFT))
  # endif
  
  /* Standard files to be examined ... */
--- 22,35 ----
  # endif
  
  /* Convert clicks to kbytes ... */
! # ifndef PGSHIFT
  # define        KBYTES( size )  ((size) << 1)
  # else
+ # if PGSHIFT > 10
+ # define        KBYTES( size )  ((size) << (PGSHIFT - 10))
+ # else
  # define        KBYTES( size )  ((size) >> (10 - PGSHIFT))
+ # endif
  # endif
  
  /* Standard files to be examined ... */

@alex

inet: dupuy at columbia.edu
uucp: ...!rutgers!columbia!dupuy



More information about the Comp.sources.bugs mailing list