Conditionally include <sys/shm.h> based on OS support. Define missing MAP_HUGETLB...
authorOleg <olegm@olegm-vmware.(none)>
Tue, 12 Mar 2013 07:06:53 +0000 (00:06 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 12 Mar 2013 12:09:14 +0000 (13:09 +0100)
Signed-off-by: Oleg Matcovschi <olegmatcovsky@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
backend.c
init.c
memory.c
os/os-android.h

index d1fe9641d88ebaa47489fc10a8f039e9443bbc10..e482fb846c8c4ebc2cee7c204b7e8b7dd23e6a0b 100644 (file)
--- a/backend.c
+++ b/backend.c
 #include <sys/stat.h>
 #include <sys/wait.h>
 #include <sys/ipc.h>
-#ifndef FIO_NO_HAVE_SHM_H
-#include <sys/shm.h>
-#endif
 #include <sys/mman.h>
 
 #include "fio.h"
+#ifndef FIO_NO_HAVE_SHM_H
+#include <sys/shm.h>
+#endif
 #include "hash.h"
 #include "smalloc.h"
 #include "verify.h"
diff --git a/init.c b/init.c
index c7226887210363b9dbeb637420ae683458409c92..9d15318209cfe0f02d7ff65e32c94464023cca25 100644 (file)
--- a/init.c
+++ b/init.c
@@ -9,13 +9,14 @@
 #include <string.h>
 #include <errno.h>
 #include <sys/ipc.h>
-#ifndef FIO_NO_HAVE_SHM_H
-#include <sys/shm.h>
-#endif
 #include <sys/types.h>
 #include <sys/stat.h>
 
 #include "fio.h"
+#ifndef FIO_NO_HAVE_SHM_H
+#include <sys/shm.h>
+#endif
+
 #include "parse.h"
 #include "smalloc.h"
 #include "filehash.h"
index ee5f895d2b0b0f88e6bd50a2a2a50149c45591fd..443d71d4bbda3de4c2771c055c77abdd49442954 100644 (file)
--- a/memory.c
+++ b/memory.c
@@ -5,12 +5,12 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
-#ifndef FIO_NO_HAVE_SHM_H
-#include <sys/shm.h>
-#endif
 #include <sys/mman.h>
 
 #include "fio.h"
+#ifndef FIO_NO_HAVE_SHM_H
+#include <sys/shm.h>
+#endif
 
 static void *pinned_mem;
 
index cedfdaf8ea8ca0910715580a08ee317d8fc3dd12..3bb44b9529290ebea26515521be2f1e88ce63ad8 100644 (file)
@@ -31,6 +31,7 @@
 #define FIO_HAVE_E4_ENG
 #define FIO_HAVE_BYTEORDER_FUNCS
 #define FIO_HAVE_MMAP_HUGE
+#define FIO_NO_HAVE_SHM_H
 
 #define OS_MAP_ANON            MAP_ANONYMOUS
 
@@ -41,6 +42,9 @@
 #ifdef MADV_REMOVE
 #define FIO_MADV_FREE  MADV_REMOVE
 #endif
+#ifndef MAP_HUGETLB
+#define MAP_HUGETLB 0x40000 /* arch specific */
+#endif
 
 
 /*