HAVE_MNTENT = @have_mntent@
HAVE_FLS = @have_fls@
HAVE_FSETXATTR = @have_fsetxattr@
+HAVE_MREMAP = @have_mremap@
GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall
# -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-decl
LCFLAGS += -DHAVE_READDIR
endif
+ifeq ($(HAVE_MREMAP),yes)
+LCFLAGS += -DHAVE_MREMAP
+endif
+
default: depend $(LTCOMMAND)
include $(BUILDRULES)
static cmdinfo_t msync_cmd;
static cmdinfo_t munmap_cmd;
static cmdinfo_t mwrite_cmd;
+#ifdef HAVE_MREMAP
static cmdinfo_t mremap_cmd;
+#endif /* HAVE_MREMAP */
mmap_region_t *maptable;
int mapcount;
return 0;
}
+#ifdef HAVE_MREMAP
static void
mremap_help(void)
{
return 0;
}
+#endif /* HAVE_MREMAP */
void
mmap_init(void)
_("writes data into a region in the current memory mapping");
mwrite_cmd.help = mwrite_help;
+#ifdef HAVE_MREMAP
mremap_cmd.name = "mremap";
mremap_cmd.altname = "mrm";
mremap_cmd.cfunc = mremap_f;
mremap_cmd.oneline =
_("alters the size of the current memory mapping");
mremap_cmd.help = mremap_help;
+#endif /* HAVE_MREMAP */
add_command(&mmap_cmd);
add_command(&mread_cmd);
add_command(&msync_cmd);
add_command(&munmap_cmd);
add_command(&mwrite_cmd);
+#ifdef HAVE_MREMAP
add_command(&mremap_cmd);
+#endif /* HAVE_MREMAP */
}
have_mntent=yes)
AC_SUBST(have_mntent)
])
+
+#
+# Check if we have a mremap call (not on Mac OS X)
+#
+AC_DEFUN([AC_HAVE_MREMAP],
+ [ AC_CHECK_DECL([mremap],
+ have_mremap=yes,
+ [],
+ [#define _GNU_SOURCE
+ #include <sys/mman.h>]
+ )
+ AC_SUBST(have_mremap)
+ ])