diff options
author | Roland McGrath <roland@gnu.org> | 1993-12-11 22:26:14 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1993-12-11 22:26:14 +0000 |
commit | b88fc10ea338b0400667b16cedf30c59773458f9 (patch) | |
tree | f8f8a84aab059b2383e13e8c9f02e21ea552d1a4 /src/unexsunos4.c | |
parent | e8f9c449bde94cce2e79c9dd6958da8ce8ae9aba (diff) | |
download | emacs-b88fc10ea338b0400667b16cedf30c59773458f9.tar.gz |
[! 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/unexsunos4.c')
-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 @@ #include <stdio.h> #include <a.out.h> +/* NetBSD needs this bit, but SunOS does not have it. */ +#ifndef MAP_FILE +#define MAP_FILE 0 +#endif + + /* * for programs other than emacs * define data_start + initialized here, and make sure @@ -63,7 +69,6 @@ unexec (new_name, a_name, bndry, bss_start, entry) char *new_name, *a_name; unsigned bndry, bss_start, entry; { - char buf[PAGSIZ]; int fd, new; char *old; 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) exit (1); } - old = (char *)mmap (0, stat.st_size, PROT_READ, MAP_SHARED, fd, 0); + old = (char *)mmap (0, stat.st_size, PROT_READ, MAP_FILE|MAP_SHARED, fd, 0); if (old == (char *)-1) { fprintf (stderr, "%s: ", a_name); @@ -267,7 +272,7 @@ is_it (path) * addresses in the data segment not part of __DYNAMIC */ mmap (data_start, rd_only_len, PROT_READ | PROT_EXEC, - MAP_SHARED | MAP_FIXED, fd, + MAP_FILE | MAP_SHARED | MAP_FIXED, fd, N_DATOFF (hdr) + data_start - N_DATADDR (hdr)); close (fd); return 1; |