diff src/unexec.c @ 13107:fab67884f69a

(write_segment): Use pagesize as unit of writing instead of 128.
author Richard M. Stallman <rms@gnu.org>
date Tue, 03 Oct 1995 09:15:49 +0000
parents 0b471201bbd4
children a7e0445bd152
line wrap: on
line diff
--- a/src/unexec.c	Tue Oct 03 09:14:54 1995 +0000
+++ b/src/unexec.c	Tue Oct 03 09:15:49 1995 +0000
@@ -1014,14 +1014,15 @@
   register int i, nwrite, ret;
   char buf[80];
   extern int errno;
-  char zeros[128];
+  int pagesize = getpagesize ();
+  char *zeros = (char *) alloca (pagesize);
 
-  bzero (zeros, sizeof zeros);
+  bzero (zeros, pagesize);
 
   for (i = 0; ptr < end;)
     {
-      /* distance to next multiple of 128.  */
-      nwrite = (((int) ptr + 128) & -128) - (int) ptr;
+      /* distance to next multiple of pagesize.  */
+      nwrite = (((int) ptr + pagesize) & -pagesize) - (int) ptr;
       /* But not beyond specified end.  */
       if (nwrite > end - ptr) nwrite = end - ptr;
       ret = write (new, ptr, nwrite);