From: Richard M. Stallman Date: Tue, 3 Oct 1995 09:15:49 +0000 (+0000) Subject: (write_segment): Use pagesize as unit of writing instead of 128. X-Git-Tag: emacs-19.34~2753 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=68db017386579f2c100e606df13934378286271e;p=emacs.git (write_segment): Use pagesize as unit of writing instead of 128. --- diff --git a/src/unexec.c b/src/unexec.c index 4b853e5b7ee..3be336a9a77 100644 --- a/src/unexec.c +++ b/src/unexec.c @@ -1014,14 +1014,15 @@ write_segment (new, ptr, end) 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);