X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fdumper.c;h=137ce9686246d1f5542ad17e86e9ac0bb879f359;hb=1cf707aab041eda2f4b37c0b9702da7f2baa5dcd;hp=4118809844860e44d6ff1bf2f422df0ba124a5d6;hpb=4836e869212eaa972d5a2bdfe61730d8af7b2c61;p=chise%2Fxemacs-chise.git diff --git a/src/dumper.c b/src/dumper.c index 4118809..137ce96 100644 --- a/src/dumper.c +++ b/src/dumper.c @@ -1249,6 +1249,11 @@ pdump_file_get (const char *path) lseek (fd, 0, SEEK_SET); #ifdef HAVE_MMAP +/* Unix 98 requires that sys/mman.h define MAP_FAILED, + but many earlier implementations don't. */ +# ifndef MAP_FAILED +# define MAP_FAILED ((void *) -1L) +# endif pdump_start = (char *) mmap (0, pdump_length, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); if (pdump_start != (char *) MAP_FAILED) { @@ -1256,7 +1261,7 @@ pdump_file_get (const char *path) close (fd); return 1; } -#endif +#endif /* HAVE_MMAP */ pdump_mallocadr = xmalloc (pdump_length+255); pdump_free = pdump_file_free;