diff options
author | Richard M. Stallman <rms@gnu.org> | 1995-10-03 09:15:49 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1995-10-03 09:15:49 +0000 |
commit | 2013bdfd286edd7d76aa4f8df8ec61c43897e715 (patch) | |
tree | 4df895f5ccd669f15558447562696b2735d70fdc /src/unexec.c | |
parent | fdcbd98edd29e07a1646cb86821db2b3ec3f002c (diff) | |
download | emacs-2013bdfd286edd7d76aa4f8df8ec61c43897e715.tar.gz |
(write_segment): Use pagesize as unit of writing instead of 128.
Diffstat (limited to 'src/unexec.c')
-rw-r--r-- | src/unexec.c | 9 |
1 files changed, 5 insertions, 4 deletions
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); |