[7095] in Athena Bugs

home help back first fref pref prev next nref lref last post

VAX /etc/savecore

daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Tue Feb 12 16:12:29 1991

To: bugs@ATHENA.MIT.EDU
Date: Tue, 12 Feb 91 16:11:58 EST
From: John Carr <jfc@ATHENA.MIT.EDU>


This change to VAX savecore will cause it not to write empty pages to disk.
This will reduce the size of core files for panics which occur before the
virtual memory usage equals physical memory.  The RT savecore does this (it
has a better reason, becuase there is often a 4 MB hole in the middle of
memory on the RT).  This will be especially useful on the dialup VAX
servers, which have 20 megabytes of memory which often is not fully used.

*** /source/bsd-4.3/vax/etc/savecore/savecore.c	Wed Jul 11 13:47:49 1990
--- savecore.vax.c	Tue Feb 12 16:07:58 1991
***************
*** 513,520 ****
  
  Write(fd, buf, size)
  	int fd, size;
! 	char *buf;
  {
  
  	if (write(fd, buf, size) < size) {
  		int oerrno = errno;
--- 513,526 ----
  
  Write(fd, buf, size)
  int fd, size;
! register char *buf;
  {
+ 	static char zero[CLBYTES];
+ 
+ 	if (*(int *)buf == 0 && bcmp(zero, buf) == 0 &&
+ 	    lseek (fd, CLBYTES, L_INCR) != -1) {
+ 		return;
+ 	}
  
  	if (write(fd, buf, size) < size) {
  		int oerrno = errno;

home help back first fref pref prev next nref lref last post