#ifndef FIO_OS_LINUX_H
#define FIO_OS_LINUX_H
+#define FIO_OS os_linux
+
#include <sys/ioctl.h>
#include <sys/uio.h>
#include <sys/syscall.h>
#include <linux/unistd.h>
#include <linux/raw.h>
#include <linux/major.h>
+#include <endian.h>
#include "indirect.h"
#include "binject.h"
sched_getaffinity((pid), (ptr))
#endif
-#define fio_cpu_clear(mask, cpu) CPU_CLR((cpu), (mask))
-#define fio_cpu_set(mask, cpu) CPU_SET((cpu), (mask))
+#define fio_cpu_clear(mask, cpu) (void) CPU_CLR((cpu), (mask))
+#define fio_cpu_set(mask, cpu) (void) CPU_SET((cpu), (mask))
static inline int fio_cpuset_init(os_cpu_mask_t *mask)
{
#define FIO_MADV_FREE MADV_REMOVE
#endif
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define FIO_LITTLE_ENDIAN
+#elif __BYTE_ORDER == __BIG_ENDIAN
+#define FIO_BIG_ENDIAN
+#else
+#error "Unknown endianness"
+#endif
+
+#define fio_swap16(x) __bswap_16(x)
+#define fio_swap32(x) __bswap_32(x)
+#define fio_swap64(x) __bswap_64(x)
+
#define CACHE_LINE_FILE \
"/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size"