#include <sys/syscall.h>
#include <unistd.h>
#include <fcntl.h>
+#include <errno.h>
#include <linux/unistd.h>
#include <linux/raw.h>
#include <linux/major.h>
#define FIO_HAVE_STRSEP
#define FIO_HAVE_FALLOCATE
#define FIO_HAVE_POSIXAIO_FSYNC
+#define FIO_HAVE_PSHARED_MUTEX
+#define FIO_HAVE_CL_SIZE
#define OS_MAP_ANON MAP_ANONYMOUS
#define FIO_O_NOATIME 0
#endif
+#define CACHE_LINE_FILE \
+ "/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size"
+
+static inline int arch_cache_line_size(void)
+{
+ char size[32];
+ int fd, ret;
+
+ fd = open(CACHE_LINE_FILE, O_RDONLY);
+ if (fd < 0)
+ return -1;
+
+ ret = read(fd, size, sizeof(size));
+
+ close(fd);
+
+ if (ret <= 0)
+ return -1;
+ else
+ return atoi(size);
+}
+
#endif