diff options
| author | Richard M. Stallman | 1995-10-03 09:15:49 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-10-03 09:15:49 +0000 |
| commit | 68db017386579f2c100e606df13934378286271e (patch) | |
| tree | 1389743ceafae1a4649bf26637490eab4d8e2fa4 /src | |
| parent | e05169e2ea8280a89a6833c8868a8be081954e6a (diff) | |
| download | emacs-68db017386579f2c100e606df13934378286271e.tar.gz emacs-68db017386579f2c100e606df13934378286271e.zip | |
(write_segment): Use pagesize as unit of writing instead of 128.
Diffstat (limited to 'src')
| -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) | |||
| 1014 | register int i, nwrite, ret; | 1014 | register int i, nwrite, ret; |
| 1015 | char buf[80]; | 1015 | char buf[80]; |
| 1016 | extern int errno; | 1016 | extern int errno; |
| 1017 | char zeros[128]; | 1017 | int pagesize = getpagesize (); |
| 1018 | char *zeros = (char *) alloca (pagesize); | ||
| 1018 | 1019 | ||
| 1019 | bzero (zeros, sizeof zeros); | 1020 | bzero (zeros, pagesize); |
| 1020 | 1021 | ||
| 1021 | for (i = 0; ptr < end;) | 1022 | for (i = 0; ptr < end;) |
| 1022 | { | 1023 | { |
| 1023 | /* distance to next multiple of 128. */ | 1024 | /* distance to next multiple of pagesize. */ |
| 1024 | nwrite = (((int) ptr + 128) & -128) - (int) ptr; | 1025 | nwrite = (((int) ptr + pagesize) & -pagesize) - (int) ptr; |
| 1025 | /* But not beyond specified end. */ | 1026 | /* But not beyond specified end. */ |
| 1026 | if (nwrite > end - ptr) nwrite = end - ptr; | 1027 | if (nwrite > end - ptr) nwrite = end - ptr; |
| 1027 | ret = write (new, ptr, nwrite); | 1028 | ret = write (new, ptr, nwrite); |