[comp.sys.sun] Apply this patch to hatstat.c after installing the PMEG patch

thakur@zerkalo.harvard.edu (Manavendra K. Thakur) (11/27/90)

[Sun-spots readers: hatstat is a program Sun is sending out for sites
wishing to test whether they need the PMEG patches or not.  Apparently,
just about everyone needs the PMEG patches!]

>>>>> On Fri, 9 Nov 90 14:03:05 GMT, Tim Gibbs <gibbs@src.bae.co.uk> said:

> Note that hatstat won't work once the PMEG patches are in place in
> the kernel.  You'll get '_hatcnt' missing from name list.'

You can modify one line in hatstat.c and it will continue to work after
you install the pmeg patches.  Here is the patch:

*** hatstat.c   Fri Nov  9 18:02:49 1990
--- hat41.c     Fri Nov  9 18:31:40 1990
***************
*** 27,31 ****
  struct nlist nl[] = {
  #define       N_HATCNT        0
!       { "_hatcnt" },
  #define       N_PMGRPFREE     1
        { "_pmgrpfree" },
--- 27,31 ----
  struct nlist nl[] = {
  #define       N_HATCNT        0
!       { "_cnt" },
  #define       N_PMGRPFREE     1
        { "_pmgrpfree" },

Apparently, the _hatcnt function has been renamed as _cnt in the vm_hat.o
that comes with the pmeg patches.  Note that I don't have SunOS 4.1.1
sources, so I can't really verify this.  I just ran strings on the kernel
modules and grepped around a bit.

But after applying the patch above and recompiling, the hatstat program
continues to run.

Hope this helps.

Manavendra K. Thakur			Internet: thakur@zerkalo.harvard.edu
System Manager,	High Energy Division	BITNET:	  thakur@cfa.BITNET
Harvard-Smithsonian Center for		DECNET:	  CFA::thakur
Astrophysics				UUCP:	  ...!uunet!mit-eddie!thakur

barry@ADS.COM (Barry Lustig) (12/05/90)

In article <425@brchh104.bnr.ca> thakur@zerkalo.harvard.edu (Manavendra K. Thakur) writes:
	[Sun-spots readers: hatstat is a program Sun is sending out for sites
	wishing to test whether they need the PMEG patches or not.  Apparently,
	just about everyone needs the PMEG patches!]

	You can modify one line in hatstat.c and it will continue to work after
	you install the pmeg patches.  Here is the patch:

	*** hatstat.c   Fri Nov  9 18:02:49 1990
	--- hat41.c     Fri Nov  9 18:31:40 1990
	***************
	*** 27,31 ****
	  struct nlist nl[] = {
	  #define       N_HATCNT        0
	!       { "_hatcnt" },
	  #define       N_PMGRPFREE     1
	        { "_pmgrpfree" },
	--- 27,31 ----
	  struct nlist nl[] = {
	  #define       N_HATCNT        0
	!       { "_cnt" },
	  #define       N_PMGRPFREE     1
	        { "_pmgrpfree" },

For those without source, just run emacs on the hatstat binary and change
_hatcnt to _cnt\0\0\0 (that is cnt followed by 3 NULLS).