diff -c configure- configure
*** configure-	Tue May 25 10:16:11 1993
--- configure	Thu May 27 14:19:27 1993
***************
*** 391,399 ****
      machine=amdahl opsys=usg5-2-2
    ;;
  
!   ## Appallings - I mean, Apollos - running Domain
    m68*-apollo* )
!     machine=apollo opsys=bsd4-2
    ;;
  
    ## AT&T 3b2, 3b5, 3b15, 3b20
--- 391,399 ----
      machine=amdahl opsys=usg5-2-2
    ;;
  
!   ## Apollo Domain/OS
    m68*-apollo* )
!     machine=apollo opsys=bsd4-3
    ;;
  
    ## AT&T 3b2, 3b5, 3b15, 3b20
diff -c etc/MACHINES- etc/MACHINES
*** etc/MACHINES-	Sun May 23 23:24:31 1993
--- etc/MACHINES	Fri May 28 12:42:59 1993
***************
*** 55,109 ****
    even worth trying to use it.  Success was obtained with the
    uts native C compiler on uts version 5.2.5.
  
! Apollo running Domain (m68k-apollo-bsd)
  
!   18.52 works, to some extent.
!   Code for dumping Emacs has been written, but we cannot distribute it yet.
!   There are reports of bugs in cc -O on this system.
  
!   In `lib-src/Makefile', don't expect emacsclient and emacsserver to
!   compile.  You might want to remove them from your makefile.
  
!   Supposedly something in dired.c runs into a compiler bug.
!   Paraphrasing the statement should avoid the problem.  I have not yet
!   received word as to the exact statement this is.
  
!   The Apollo has a bizarre operating system which does not permit
!   Emacs to be dumped with preloaded pure Lisp code.  Therefore, each
!   time you start Emacs on this system, the standard Lisp code is loaded
!   into it.  Expect it to take a long time.  You can prevent loading of
!   the standard Lisp code by specifying the -nl switch.  It must
!   come at the beginning of the command line; only the -t and -batch
!   switches may come before it.
  
!   There is one remaining problem on the Apollo.  You must replace
!   the CPP line in src/Makefile with "CPP = /usr/lib/cpp".
!   The C preprocessor lives there rather than in /lib/cpp because the
!   Aegis OS uses the /lib directory as the repository for shared libraries.
! 
! 
!   Here is a design for a method of dumping and reloading the relevant
!   necessary impure areas of Emacs.
! 
!   On dumping, you need to dump only the array `pure' plus the
!   locations that contain values of forwarded Lisp variables or that are
!   protected for garbage collection.  The former can be found by a
!   garbage- collection-like technique, and the latter are in the
!   staticprolist vector (see alloc.c for both things).
! 
!   Reloading would work in an Emacs that has just been started; except
!   when a switch is specified to inhibit this, it would read the dump
!   file and set all the appropriate locations.  The data loaded must be
!   relocated, but that's not hard.  Those locations that are of type
!   Lisp_Object can be found by a technique like garbage-collection, and
!   those of them that point to storage can be relocated.  The other data
!   read from the file will not need to be relocated.
! 
!   The switch to inhibit loading the data base would be used when it
!   is time to dump a new data base.
! 
!   This would take a few seconds, which is much faster than loading
!   the Lisp code of Emacs from scratch.
  
  AT&T 3b2, 3b5, 3b15, 3b20 (we32k-att-sysv)
  
--- 55,80 ----
    even worth trying to use it.  Success was obtained with the
    uts native C compiler on uts version 5.2.5.
  
! Apollo running Domain/OS (m68k-apollo-bsd)
  
!   The Apollo version now supports dumping just fine.  I run it on sr10.3.
!   It certainly requires at least sr10.0, and maybe sr10.2.
  
!   Although I fixed up the sources, I didn't really work on the configuration
!   stuff much, so you may have to edit the makefiles manually.  There seem to
!   be too many versions of both cc and X to automate this easily.  I use cc 6.7
!   and X11r5 shared libraries.
  
!   When you try to dump emacs, you may get the message ".rwdi section needs
!   relocation."  This means you are linking with some code that has compressed
!   data sections.  In some cases this comes from linking with X libraries.  Try
!   using shared X libraries instead.  With some versions of Domain/OS this is
!   as simple as removing the "-lX11" from the link command line.
  
!   Most of the Apollo work was done by Leonard Zubkoff and John Vasta.  I just
!   assembled pieces and merged it in to Epoch 4.0.
  
!   - Jim Rees, University of Michigan, June 1992.
  
  AT&T 3b2, 3b5, 3b15, 3b20 (we32k-att-sysv)
  
diff -c src/crt0.c- src/crt0.c
*** src/crt0.c-	Sun May 17 22:40:16 1992
--- src/crt0.c	Thu May 27 13:40:58 1993
***************
*** 82,87 ****
--- 82,112 ----
  static start1 ();
  #endif
  
+ #ifdef APOLLO
+ /* Added by John Vasta, 19-Oct-89
+    Malloc, free, etc. are in shared libraries on the Apollo. Library references
+    to them are indirect so that they can be replaced by the user, just as if
+    they were statically linked. We set the pointer values here. (The regular
+    Apollo crt0.o file isn't used because it has a compressed data section which
+    interferes with the unexec process.) */
+ 
+ extern	char   *malloc(),      *(*_libc_malloc) ();
+ extern	void	free(),		(*_libc_free) ();
+ extern	char   *realloc(),     *(*_libc_realloc)();
+ 
+ extern	int	main();
+ std_$call void	unix_$main();
+ 
+ _start()
+ {
+ 	_libc_malloc = malloc;
+ 	_libc_realloc = realloc;
+ 	_libc_free = free;
+ 
+ 	unix_$main(main);	/* no return */
+ }
+ #endif /* APOLLO */
+ 
  #if defined(orion) || defined(pyramid) || defined(celerity) || defined(ALLIANT) || defined(clipper) || defined(sps7)
  
  #if defined(sps7) && defined(V3x)
diff -c src/emacs.c- src/emacs.c
*** src/emacs.c-	Sat May 22 14:50:59 1993
--- src/emacs.c	Thu May 27 13:43:32 1993
***************
*** 39,50 ****
  #include <termios.h>
  #endif
  
- #ifdef APOLLO
- #ifndef APOLLO_SR10
- #include <default_acl.h>
- #endif
- #endif
- 
  #include "lisp.h"
  #include "commands.h"
  #include "intervals.h"
--- 39,44 ----
***************
*** 300,314 ****
    setpgrp (0, getpid ());
  #endif
  
- #ifdef APOLLO
- #ifndef APOLLO_SR10
-   /* If USE_DOMAIN_ACLS environment variable exists,
-      use ACLs rather than UNIX modes. */
-   if (egetenv ("USE_DOMAIN_ACLS"))
-     default_acl (USE_DEFACL);
- #endif
- #endif /* APOLLO */
- 
  #ifndef SYSTEM_MALLOC
    if (! initialized)
      {
--- 294,299 ----
***************
*** 719,726 ****
  
  
  #ifndef CANNOT_DUMP
- /* Nothing like this can be implemented on an Apollo.
-    What a loss!  */
  
  #ifdef HAVE_SHM
  
--- 704,709 ----
diff -c src/fileio.c- src/fileio.c
*** src/fileio.c-	Mon May 24 18:58:29 1993
--- src/fileio.c	Thu May 27 14:07:49 1993
***************
*** 1636,1644 ****
  	  EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0);
  	  EMACS_SET_UTIMES (XSTRING (newname)->data, atime, mtime);
  	}
- #ifdef APOLLO
-       if (!egetenv ("USE_DOMAIN_ACLS"))
- #endif
  	chmod (XSTRING (newname)->data, st.st_mode & 07777);
      }
  
--- 1636,1641 ----
***************
*** 2213,2248 ****
    if (!NILP (handler))
      return call3 (handler, Qset_file_modes, abspath, mode);
  
- #ifndef APOLLO
    if (chmod (XSTRING (abspath)->data, XINT (mode)) < 0)
      report_file_error ("Doing chmod", Fcons (abspath, Qnil));
- #else /* APOLLO */
-   if (!egetenv ("USE_DOMAIN_ACLS"))
-     {
-       struct stat st;
-       struct timeval tvp[2];
- 
-       /* chmod on apollo also change the file's modtime; need to save the
- 	 modtime and then restore it. */
-       if (stat (XSTRING (abspath)->data, &st) < 0)
- 	{
- 	  report_file_error ("Doing chmod", Fcons (abspath, Qnil));
- 	  return (Qnil);
- 	}
-  
-       if (chmod (XSTRING (abspath)->data, XINT (mode)) < 0)
-  	report_file_error ("Doing chmod", Fcons (abspath, Qnil));
-  
-       /* reset the old accessed and modified times.  */
-       tvp[0].tv_sec = st.st_atime + 1; /* +1 due to an Apollo roundoff bug */
-       tvp[0].tv_usec = 0;
-       tvp[1].tv_sec = st.st_mtime + 1; /* +1 due to an Apollo roundoff bug */
-       tvp[1].tv_usec = 0;
-  
-       if (utimes (XSTRING (abspath)->data, tvp) < 0)
-  	report_file_error ("Doing utimes", Fcons (abspath, Qnil));
-     }
- #endif /* APOLLO */
  
    return Qnil;
  }
--- 2210,2217 ----
diff -c src/keymap.c- src/keymap.c
*** src/keymap.c-	Sat May 22 14:58:04 1993
--- src/keymap.c	Thu May 27 16:38:25 1993
***************
*** 1142,1148 ****
--- 1142,1152 ----
       register char *p;
  {
    /* Clear all the meaningless bits above the meta bit.  */
+ #ifndef APOLLO
    c &= meta_modifier | ~ - meta_modifier;
+ #else
+   c &= meta_modifier | ~ - (int) meta_modifier;
+ #endif
  
    if (c & alt_modifier)
      {
diff -c src/unexapollo.c- src/unexapollo.c
*** src/unexapollo.c-	Thu May 27 14:16:31 1993
--- src/unexapollo.c	Fri May 28 02:33:43 1993
***************
*** 0 ****
--- 1,310 ----
+ /*	UNEXAPOLLO -- COFF File UNEXEC for GNU Emacs on Apollo SR10.[34]     */
+ /*									     */
+ /*	Copyright (C) 1988 by Leonard N. Zubkoff, All Rights Reserved	     */
+ /*									     */
+ /*	This software is provided free and without any warranty.	     */
+ /*	Permission to copy for any purpose is hereby granted so		     */
+ /*	long as this copyright notice remains intact.			     */
+ /*									     */
+ /*	Revision History:						     */
+ /*		09-Apr-91 by John Vasta: Fix problems due to changes in	     */
+ /*			  COFF file layout by SR10.4 linker.		     */
+ 
+ 
+ #define begin	    {
+ #define end	    }
+ #define then
+ #define do
+ #define hidden	    static
+ #define visible
+ #define procedure   void
+ 
+ 
+ #include "config.h"
+ 
+ #ifdef volatile
+ #undef volatile
+ #endif
+ 
+ #include <fcntl.h>
+ 
+ 
+ #include <a.out.h>
+ #include <sys/file.h>
+ #include <apollo/base.h>
+ #include <apollo/ios.h>
+ #include <apollo/type_uids.h>
+ #include <apollo/dst.h>
+ 
+ 
+ #define DST_RECORD_HDR_SIZE	2
+ 
+ #define LONG_ALIGN(X)	(((X)+3)&(~3))
+ 
+ visible procedure unexec(char *TargetFileName,
+ 			 char *SourceFileName)
+     begin
+ 	struct filehdr FileHeader;
+ 	struct aouthdr DomainHeader;
+ 	struct scnhdr *Section, *Sections, *SectionsLimit;
+ 	struct scnhdr *FirstDataSection, *LastDataSection;
+ 	struct scnhdr *RwdiSection, *BlocksSection;
+ 	struct reloc RelocEntry;
+ 	unsigned long DataSize, OldDataSectionSize, SourceFileOffsetPastRwdi;
+ 	unsigned char Buffer[4096];
+ 	long DeltaBeforeRwdi, DeltaAfterRwdi, ByteCount;
+ 	long FirstChangedVaddr, OldRwdiVaddr, i;
+ 	ios_$id_t TargetFile, SourceFile;
+ 	status_$t Status;
+ 	/* Open the Source File. */
+ 	if ((SourceFile = open(SourceFileName,O_RDONLY)) < 0) then
+ 	    error("cannot open source file for input");
+ 	/* Read the File Header. */
+ 	if (read(SourceFile,&FileHeader,sizeof(FileHeader))
+ 		!= sizeof(FileHeader)) then
+ 	    error("cannot read file header");
+ 
+ 	/* Read the Domain Header. */
+ 	if (read(SourceFile,&DomainHeader,sizeof(DomainHeader))
+ 		!= sizeof(DomainHeader)) then
+ 	    error("cannot read domain header");
+ 	/* Read the Section Headers. */
+ 	Sections = (struct scnhdr *) malloc(FileHeader.f_nscns
+ 					    *sizeof(struct scnhdr));
+ 	if (Sections == (struct scnhdr *) 0) then
+ 	    error("cannot allocate section header storage");
+ 	SectionsLimit = Sections+FileHeader.f_nscns;
+ 	if (read(SourceFile,Sections,FileHeader.f_nscns*sizeof(struct scnhdr))
+ 		!= FileHeader.f_nscns*sizeof(struct scnhdr)) then
+ 	    error("cannot read section headers");
+ 	/* Compute the new Size of the Data Section. */
+ 	DataSize = sbrk(0)-DomainHeader.data_start;
+ 	DeltaBeforeRwdi = DeltaAfterRwdi = DataSize - DomainHeader.dsize;
+ 	OldRwdiVaddr = 0;
+ 	/* Find and Deallocate the .rwdi Section Information. */
+ 	for (RwdiSection=Sections;
+ 	     RwdiSection != SectionsLimit; RwdiSection++) do
+ 		if (strcmp(RwdiSection->s_name,".rwdi") == 0) then
+ 		    begin
+ 			/* If there are relocation entries, we
+ 			   cannot "unrelocate" them. */
+ 			if (RwdiSection->s_nreloc)
+ 			    error (".rwdi section needs relocation - \
+ 				   cannot dump Emacs");
+ 			DeltaAfterRwdi = DeltaBeforeRwdi - RwdiSection->s_size;
+ 			OldRwdiVaddr = RwdiSection->s_vaddr;
+ 			RwdiSection->s_paddr = 0;
+ 			RwdiSection->s_vaddr = 0;
+ 			RwdiSection->s_scnptr = 0;
+ 			RwdiSection->s_size = 0;
+ 			SourceFileOffsetPastRwdi = (RwdiSection+1)->s_scnptr;
+ 			break;
+ 		    end;
+ 	/* Skip over the Text Section Headers. */
+ 	for (Section=Sections;
+ 	     (Section->s_flags & STYP_TEXT) != 0; Section++) do ;
+ 	/* Find the First and Last Data Sections
+ 	   and Fixup Section Header Relocation Pointers  */
+ 	FirstDataSection = LastDataSection = (struct scnhdr *) 0;
+ 	for (; Section != SectionsLimit; Section++) do
+ 	    begin
+ 		if ((Section->s_flags & STYP_DATA) != 0) then
+ 		    begin
+ 			if (FirstDataSection == (struct scnhdr *) 0) then
+ 			    FirstDataSection = Section;
+ 			LastDataSection = Section;
+ 		    end;
+ 		if (Section->s_relptr != 0) then
+ 		    Section->s_relptr += DeltaAfterRwdi;
+ 	    end;
+ 	/* Increment the Size of the Last Data Section. */
+ 	OldDataSectionSize = LastDataSection->s_size;
+ 	LastDataSection->s_size += DeltaBeforeRwdi;
+ 	/* Update the File Header and Domain Header. */
+ 	FileHeader.f_symptr += DeltaAfterRwdi;
+ 	DomainHeader.dsize = DataSize;
+ 	DomainHeader.bsize = 0;
+ 	if (DomainHeader.o_sri != 0) then
+ 	    DomainHeader.o_sri += DeltaAfterRwdi;
+ 	if (DomainHeader.o_inlib != 0) then
+ 	    DomainHeader.o_inlib += DeltaAfterRwdi;
+ 
+  	/* Skip over subsequent Bss Section Headers. */
+  	for (Section=LastDataSection+1;
+  	     (Section->s_flags & STYP_BSS) != 0; Section++) do ;
+  	/* Update the remaining Section Headers. */
+         BlocksSection = (struct scnhdr *) 0;
+         FirstChangedVaddr = 0;
+  	for (; Section != SectionsLimit; Section++) do
+ 	    begin
+ 		long Delta;
+ 		if (Section < RwdiSection) then
+ 		    Delta = DeltaBeforeRwdi;
+ 		else
+ 		    Delta = DeltaAfterRwdi;
+ 
+ 		if (Section->s_paddr != 0) then
+ 		    Section->s_paddr += Delta;
+ 		if (Section->s_vaddr != 0) then
+                     begin
+                         if (FirstChangedVaddr == 0) then
+                             FirstChangedVaddr = Section->s_vaddr;
+ 		        Section->s_vaddr += Delta;
+                     end;
+ 		if (Section->s_scnptr != 0) then
+ 		    Section->s_scnptr += Delta;
+                 if (strcmp (Section->s_name, ".blocks") == 0) then
+                     BlocksSection = Section;
+ 	    end;
+ 	/* Open the Target File. */
+ 	ios_$create(TargetFileName,strlen(TargetFileName),coff_$uid,
+ 		    ios_$recreate_mode,ios_$write_opt,&TargetFile,&Status);
+ 	if (Status.all != status_$ok) then
+ 	    error("cannot open target file for output");
+ 	/* Write the File Header. */
+ 	if (write(TargetFile,&FileHeader,sizeof(FileHeader))
+ 		!= sizeof(FileHeader)) then
+ 	    error("cannot write file header");
+ 	/* Write the Domain Header. */
+ 	if (write(TargetFile,&DomainHeader,sizeof(DomainHeader))
+ 		!= sizeof(DomainHeader)) then
+ 	    error("cannot write domain header");
+ 	/* Write the Section Headers. */
+ 	if (write(TargetFile,Sections,FileHeader.f_nscns*sizeof(struct scnhdr))
+ 		!= FileHeader.f_nscns*sizeof(struct scnhdr)) then
+ 	    error("cannot write section headers");
+ 	/* Copy the Allocated Sections. */
+ 	for (Section=Sections; Section != FirstDataSection; Section++) do
+ 	    if (Section->s_scnptr != 0) then
+ 		CopyData(TargetFile,SourceFile,LONG_ALIGN(Section->s_size));
+ 	/* Write the Expanded Data Segment. */
+ 	if (write(TargetFile,FirstDataSection->s_vaddr,
+ 		  DataSize) != DataSize) then
+ 	    error("cannot write new data section");
+ 	/* Skip over the Last Data Section and Copy until the .rwdi Section. */
+ 	if (lseek(SourceFile,LastDataSection->s_scnptr
+ 			     +OldDataSectionSize,L_SET) == -1) then
+ 	    error("cannot seek past data section");
+ 	for (Section=LastDataSection+1; Section != RwdiSection; Section++) do
+ 	    if (Section->s_scnptr != 0) then
+ 		CopyData(TargetFile,SourceFile,LONG_ALIGN(Section->s_size));
+ 	/* Skip over the .rwdi Section and Copy Remainder of Source File. */
+ 	if (lseek(SourceFile,SourceFileOffsetPastRwdi,L_SET) == -1) then
+ 	    error("cannot seek past .rwdi section");
+ 	while ((ByteCount = read(SourceFile,Buffer,sizeof(Buffer))) > 0) do
+ 	    if (write(TargetFile,Buffer,ByteCount) != ByteCount) then
+ 		error("cannot write data");
+ 
+ 	/* Unrelocate .data references to Global Symbols. */
+ 	for (Section = FirstDataSection; Section <= LastDataSection; Section++) do
+ 	    for (i=0; i<Section->s_nreloc; i++) do
+ 		begin
+ 		    if (lseek(SourceFile,Section->s_relptr
+ 					 +i*sizeof(struct reloc)-DeltaAfterRwdi,
+ 			      L_SET) == -1) then
+ 			error("cannot seek to relocation info");
+ 		    if (read(SourceFile,&RelocEntry,sizeof(RelocEntry))
+ 			    != sizeof(RelocEntry)) then
+ 			error("cannot read reloc entry");
+ 		    if (lseek(SourceFile,RelocEntry.r_vaddr-Section->s_vaddr
+ 					 +Section->s_scnptr,L_SET) == -1) then
+ 			error("cannot seek to data element");
+ 		    if (lseek(TargetFile,RelocEntry.r_vaddr-Section->s_vaddr
+ 					 +Section->s_scnptr,L_SET) == -1) then
+ 			error("cannot seek to data element");
+ 		    if (read(SourceFile,Buffer,4) != 4) then
+ 			error("cannot read data element");
+ 		    if (write(TargetFile,Buffer,4) != 4) then
+ 			error("cannot write data element");
+ 		end;
+ 	/* Correct virtual addresses in .blocks section. */
+ 	if (BlocksSection != (struct scnhdr *) 0) then
+ 	    begin
+ 		dst_rec_t DstRecord;
+ 		dst_rec_comp_unit_t *CompUnit;
+ 		unsigned short NumberOfSections;
+ 		unsigned long SectionBase;
+ 		unsigned long SectionOffset = 0;
+ 		/* Find section tables and update section base addresses. */
+ 		while (SectionOffset < BlocksSection->s_size) do
+ 		    begin
+ 			if (lseek(TargetFile,
+ 				  BlocksSection->s_scnptr+SectionOffset,
+ 				  L_SET) == -1) then
+ 			    error ("cannot seek to comp unit record");
+ 			/* Handle pad records before the comp unit record. */
+ 			if (read(TargetFile,&DstRecord,DST_RECORD_HDR_SIZE)
+ 				!= DST_RECORD_HDR_SIZE) then
+ 			    error("cannot read dst record tag");
+ 			if (DstRecord.rec_type == dst_typ_pad) then
+ 			    SectionOffset += DST_RECORD_HDR_SIZE;
+ 			else if (DstRecord.rec_type == dst_typ_comp_unit) then
+ 			    begin
+ 				CompUnit = &DstRecord.rec_data.comp_unit_;
+ 				if (read(TargetFile,CompUnit,sizeof(*CompUnit))
+ 					!= sizeof (*CompUnit)) then
+ 				    error("cannot read comp unit record");
+ 				if (lseek(TargetFile,BlocksSection->s_scnptr
+ 						     +SectionOffset
+ 						     +CompUnit->section_table
+ 						     +DST_RECORD_HDR_SIZE,
+ 					  L_SET) == -1) then
+ 				    error ("cannot seek to section table");
+ 
+ 				if (read(TargetFile,&NumberOfSections,
+ 					 sizeof(NumberOfSections))
+ 					!= sizeof(NumberOfSections)) then
+ 				    error("cannot read section table size");
+ 				for (i=0; i<NumberOfSections; i++) do
+ 				    begin
+ 					if (read(TargetFile,&SectionBase,
+ 						 sizeof(SectionBase))
+ 						!= sizeof(SectionBase)) then
+ 					    error("cannot read section \
+ 						   base value");
+ 					if (SectionBase < FirstChangedVaddr)
+ 					    then continue;
+ 					else if (SectionBase < OldRwdiVaddr)
+ 					    then SectionBase += DeltaBeforeRwdi;
+ 					else
+ 					    SectionBase += DeltaAfterRwdi;
+ 					if (lseek(TargetFile,
+ 						  -sizeof(SectionBase),
+ 						  L_INCR) == -1) then
+ 					    error("cannot seek to \
+ 						   section base value");
+ 					if (write(TargetFile,&SectionBase,
+ 						  sizeof(SectionBase))
+ 						!= sizeof(SectionBase)) then
+ 					    error("cannot write section base");
+ 				    end;
+ 				SectionOffset += CompUnit->data_size;
+ 			    end
+ 			else error("unexpected dst record type");
+ 		    end;
+ 	    end;
+ 	if (close(SourceFile) == -1) then
+ 	    error("cannot close source file");
+ 	if (close(TargetFile) == -1) then
+ 	    error("cannot close target file");
+     end
+ 
+ 
+ hidden CopyData(int TargetFile,
+ 		int SourceFile,
+ 		long TotalByteCount)
+     begin
+ 	unsigned char Buffer[4096];
+ 	long ByteCount;
+ 	while (TotalByteCount > 0) do
+ 	    begin
+ 		if (TotalByteCount > sizeof(Buffer)) then
+ 		    ByteCount = sizeof(Buffer);
+ 		else ByteCount = TotalByteCount;
+ 		if (read(SourceFile,Buffer,ByteCount) != ByteCount) then
+ 		    error("cannot read data");
+ 		if (write(TargetFile,Buffer,ByteCount) != ByteCount) then
+ 		    error("cannot write data");
+ 		TotalByteCount -= ByteCount;
+ 	    end;
+     end
diff -c src/m/apollo.h- src/m/apollo.h
*** src/m/apollo.h-	Wed Mar  3 12:39:56 1993
--- src/m/apollo.h	Thu May 27 20:59:08 1993
***************
*** 20,26 ****
  
  /* The following line tells the configuration script what sort of 
     operating system this machine is likely to run.
!    USUAL-OPSYS="bsd4-2"  */
  
  /* The following three symbols give information on
   the size of various data types.  */
--- 20,26 ----
  
  /* The following line tells the configuration script what sort of 
     operating system this machine is likely to run.
!    USUAL-OPSYS="bsd4-3"  */
  
  /* The following three symbols give information on
   the size of various data types.  */
***************
*** 54,69 ****
  /* Do not define LOAD_AVE_TYPE or LOAD_AVE_CVT
     since there is no /dev/kmem */
  
! /* Define CANNOT_DUMP because it is impossible to dump.  */
  
! #define CANNOT_DUMP
  
- /* Define VIRT_ADDR_VARIES because the virtual addresses of
-    pure and impure space as loaded can vary, and even their
-    relative order cannot be relied on.  */
- 
- #define VIRT_ADDR_VARIES
- 
  /* Define HAVE_ALLOCA because we use the system's version of alloca.  */
  
  #define HAVE_ALLOCA
--- 54,64 ----
  /* Do not define LOAD_AVE_TYPE or LOAD_AVE_CVT
     since there is no /dev/kmem */
  
! /* Undefine VIRT_ADDR_VARIES because the virtual addresses of
!    pure and impure space as loaded do not vary.  */
  
! #undef VIRT_ADDR_VARIES
  
  /* Define HAVE_ALLOCA because we use the system's version of alloca.  */
  
  #define HAVE_ALLOCA
***************
*** 77,100 ****
  
  #define LIBS_DEBUG
  
! /* Must use the system's termcap.  It does special things.  */
  
! #define LIBS_TERMCAP -ltermcap
  
  /* Must use the system's malloc and alloca.  */
  
  #define SYSTEM_MALLOC
  
! /* No crt0 is needed, but control where environ is allocated.  */
  
! #define START_FILES pre-crt0.o
  
! /* Apollo's bcopy said to lose on more than 16k bytes in SR9.5.  */
  
! #ifndef APOLLO_SR10
! #undef BSTRING
! #endif
  
! /* The function x_destroy_database doesn't exist in the version of X
!    on the Apollo.  */
! #define NO_X_DESTROY_DATABASE
--- 72,110 ----
  
  #define LIBS_DEBUG
  
! /* Can't use the system's termcap.  It has compressed data sections that
!    interfere with dumping.  That means we won't automatically get a vt100
!    when we start up emacs in a dm pad (a dubious feature at best anyway).
!    If you really want to run emacs in a pad, you should be using lucid emacs. */
  
! #undef LIBS_TERMCAP
  
  /* Must use the system's malloc and alloca.  */
  
  #define SYSTEM_MALLOC
  
! /* System Type is Domain/OS. */
  
! #undef SYSTEM_TYPE
! #define SYSTEM_TYPE "Domain/OS"
  
! /* Define the file we use for UNEXEC. */
  
! #define UNEXEC unexapollo.o
  
! /* In SR10 and later we use our own version of crt0. */
! 
! #define START_FILES crt0.o
! 
! /* Define C_SWITCH_MACHINE to compile for 68020/68030 or PRISM. */
! 
! /* Define LD_SWITCH_MACHINE to save space by stripping symbols
!    and use X11 libraries. */
! 
! #if _ISP__A88K
! #define C_SWITCH_MACHINE -W0,-ncompress -O -A cpu,a88k -A sys,any -A run,bsd4.3
! #define LD_SWITCH_MACHINE -A cpu,a88k -A sys,any -A run,bsd4.3
! #else
! #define C_SWITCH_MACHINE -W0,-ncompress -O -A cpu,3000 -A sys,any -A run,bsd4.3
! #define LD_SWITCH_MACHINE -A cpu,m68k -A sys,any -A run,bsd4.3
! #endif
