Fix compile for older Linux without mmap MAP_HUGETLB
authorJens Axboe <axboe@kernel.dk>
Tue, 27 Nov 2012 07:27:50 +0000 (08:27 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 27 Nov 2012 07:27:50 +0000 (08:27 +0100)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
os/os-linux.h
os/os.h

index 9b7ff29e50af7f07d656cf3e763e7fafe409a669..e9d7cf3e6f6e0cf4af791bab019fc9faf9586e21 100644 (file)
@@ -7,6 +7,7 @@
 #include <sys/uio.h>
 #include <sys/syscall.h>
 #include <sys/vfs.h>
 #include <sys/uio.h>
 #include <sys/syscall.h>
 #include <sys/vfs.h>
+#include <sys/mman.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_HAVE_E4_ENG
 
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_HAVE_E4_ENG
 
+#ifdef MAP_HUGETLB
+#define FIO_HAVE_MMAP_HUGE
+#endif
+
 /*
  * Can only enable this for newer glibcs, or the header and defines are
  * missing
 /*
  * Can only enable this for newer glibcs, or the header and defines are
  * missing
diff --git a/os/os.h b/os/os.h
index e150284ef6a84f10764abe08103e795ae2058ee6..dd704647932a0ad7f9b1cf22a3860e8ee758b62d 100644 (file)
--- a/os/os.h
+++ b/os/os.h
@@ -115,6 +115,10 @@ typedef unsigned long os_cpu_mask_t;
 #endif
 #endif
 
 #endif
 #endif
 
+#ifndef FIO_HAVE_MMAP_HUGE
+#define MAP_HUGETLB                    0
+#endif
+
 #ifndef FIO_O_NOATIME
 #define FIO_O_NOATIME                  0
 #endif
 #ifndef FIO_O_NOATIME
 #define FIO_O_NOATIME                  0
 #endif