diff --git a/NEWS b/NEWS index 3c70bc0f..89e44bb4 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ next ---- * Minor cache improvements and a NULL-pointer dereference fix. + * Fix test suite for 32-bit architectures. 0.5.4 ----- diff --git a/configure.ac b/configure.ac index 04d1c6fa..93ebb39d 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,8 @@ AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(off_t) AC_SUBST(SIZEOF_OFF_T, $ac_cv_sizeof_off_t) +AC_CHECK_FUNCS(mmap64) + dnl This makes sure pkg.m4 is available. m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config]) diff --git a/src/kdumpfile/test-fcache.c b/src/kdumpfile/test-fcache.c index 1ed57447..604ed540 100644 --- a/src/kdumpfile/test-fcache.c +++ b/src/kdumpfile/test-fcache.c @@ -64,9 +64,20 @@ static char *mmapbuf; static int failmmap; +#ifdef HAVE_MMAP64 + +#define STR_MMAP XSTRINGIFY(mmap64) +static void* (*orig_mmap)(void *addr, size_t length, int prot, int flags, + int fd, off64_t offset); + +#else + +#define STR_MMAP XSTRINGIFY(mmap) static void* (*orig_mmap)(void *addr, size_t length, int prot, int flags, int fd, off_t offset); +#endif + void * mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) { @@ -445,7 +456,7 @@ main(int argc, char **argv) return TEST_ERR; } - orig_mmap = dlsym(RTLD_NEXT, "mmap"); + orig_mmap = dlsym(RTLD_NEXT, STR_MMAP); if (!orig_mmap) { fprintf(stderr, "Cannot get original mmap() address: %s\n", dlerror());