#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"
td->mmapfd = 1;
+ if (td->o.mem_type == MEM_MMAPHUGE) {
+ unsigned long mask = td->o.hugepage_size - 1;
+
+ flags |= MAP_HUGETLB;
+ total_mem = (total_mem + mask) & ~mask;
+ }
+
if (td->mmapfile) {
td->mmapfd = open(td->mmapfile, O_RDWR|O_CREAT, 0644);