X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/3f8a3241196f03b755d4e159b6369a20e82fdf97..cd2904bd2c06864bc02f3e454caccdeb3f0e03f2:/src/unexhp9k800.c diff --git a/src/unexhp9k800.c b/src/unexhp9k800.c index 0d8f1a7cf0..686a1ed1eb 100644 --- a/src/unexhp9k800.c +++ b/src/unexhp9k800.c @@ -37,12 +37,33 @@ sigsetreturn (_sigreturn); */ +#ifdef emacs +#include +#endif + #include #include #include #include +#ifdef HPUX_USE_SHLIBS +#include +#endif + +/* brk value to restore, stored as a global. + This is really used only if we used shared libraries. */ +static long brk_on_dump = 0; + +/* Called from main, if we use shared libraries. */ +int +run_time_remap (ignored) + char *ignored; +{ + brk ((char *) brk_on_dump); +} + +#undef roundup #define roundup(x,n) (((x) + ((n) - 1)) & ~((n) - 1)) /* n is power of 2 */ #define min(x,y) (((x) < (y)) ? (x) : (y)) @@ -78,12 +99,14 @@ unexec (new_name, old_name, new_end_of_text, dummy1, dummy2) /* Read the old headers */ read_header (old, &hdr, &auxhdr); + + brk_on_dump = (long) sbrk (0); /* Decide how large the new and old data areas are */ old_size = auxhdr.exec_dsize; /* I suspect these two statements are separate to avoid a compiler bug in hpux version 8. */ - i = sbrk (0); + i = (long) sbrk (0); new_size = i - auxhdr.exec_dmem; /* Copy the old file to the new, up to the data space */ @@ -246,7 +269,7 @@ copy_file (old, new, size) int size; { int len; - int buffer[8196]; /* word aligned will be faster */ + int buffer[8192]; /* word aligned will be faster */ for (; size > 0; size -= len) {