diff options
| author | Roland McGrath | 1993-12-11 22:26:14 +0000 |
|---|---|---|
| committer | Roland McGrath | 1993-12-11 22:26:14 +0000 |
| commit | 3b95c869b1b2ad7d92e1c5df73edebf83b6b2c5c (patch) | |
| tree | a23750b667cf34caf3ef2ed9e80845dfe3c7375b /src | |
| parent | a0c567b516fa844254356fc2d96fc3d93fefc2af (diff) | |
| download | emacs-3b95c869b1b2ad7d92e1c5df73edebf83b6b2c5c.tar.gz emacs-3b95c869b1b2ad7d92e1c5df73edebf83b6b2c5c.zip | |
[! MAP_FILE] (MAP_FILE): Define to zero.
(unexec): Remove unused variable BUF.
Use MAP_FILE bit in mmap call.
(run_time_remap): Use MAP_FILE bit in mmap call.
Diffstat (limited to 'src')
| -rw-r--r-- | src/unexsunos4.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/unexsunos4.c b/src/unexsunos4.c index 664a7db6997..48934f21447 100644 --- a/src/unexsunos4.c +++ b/src/unexsunos4.c | |||
| @@ -35,6 +35,12 @@ | |||
| 35 | #include <stdio.h> | 35 | #include <stdio.h> |
| 36 | #include <a.out.h> | 36 | #include <a.out.h> |
| 37 | 37 | ||
| 38 | /* NetBSD needs this bit, but SunOS does not have it. */ | ||
| 39 | #ifndef MAP_FILE | ||
| 40 | #define MAP_FILE 0 | ||
| 41 | #endif | ||
| 42 | |||
| 43 | |||
| 38 | /* | 44 | /* |
| 39 | * for programs other than emacs | 45 | * for programs other than emacs |
| 40 | * define data_start + initialized here, and make sure | 46 | * define data_start + initialized here, and make sure |
| @@ -63,7 +69,6 @@ unexec (new_name, a_name, bndry, bss_start, entry) | |||
| 63 | char *new_name, *a_name; | 69 | char *new_name, *a_name; |
| 64 | unsigned bndry, bss_start, entry; | 70 | unsigned bndry, bss_start, entry; |
| 65 | { | 71 | { |
| 66 | char buf[PAGSIZ]; | ||
| 67 | int fd, new; | 72 | int fd, new; |
| 68 | char *old; | 73 | char *old; |
| 69 | struct exec ohdr; /* Allocate on the stack, not needed in the next life */ | 74 | struct exec ohdr; /* Allocate on the stack, not needed in the next life */ |
| @@ -93,7 +98,7 @@ unexec (new_name, a_name, bndry, bss_start, entry) | |||
| 93 | exit (1); | 98 | exit (1); |
| 94 | } | 99 | } |
| 95 | 100 | ||
| 96 | old = (char *)mmap (0, stat.st_size, PROT_READ, MAP_SHARED, fd, 0); | 101 | old = (char *)mmap (0, stat.st_size, PROT_READ, MAP_FILE|MAP_SHARED, fd, 0); |
| 97 | if (old == (char *)-1) | 102 | if (old == (char *)-1) |
| 98 | { | 103 | { |
| 99 | fprintf (stderr, "%s: ", a_name); | 104 | fprintf (stderr, "%s: ", a_name); |
| @@ -267,7 +272,7 @@ is_it (path) | |||
| 267 | * addresses in the data segment not part of __DYNAMIC | 272 | * addresses in the data segment not part of __DYNAMIC |
| 268 | */ | 273 | */ |
| 269 | mmap (data_start, rd_only_len, PROT_READ | PROT_EXEC, | 274 | mmap (data_start, rd_only_len, PROT_READ | PROT_EXEC, |
| 270 | MAP_SHARED | MAP_FIXED, fd, | 275 | MAP_FILE | MAP_SHARED | MAP_FIXED, fd, |
| 271 | N_DATOFF (hdr) + data_start - N_DATADDR (hdr)); | 276 | N_DATOFF (hdr) + data_start - N_DATADDR (hdr)); |
| 272 | close (fd); | 277 | close (fd); |
| 273 | return 1; | 278 | return 1; |