Add support for O_ATOMIC
[fio.git] / os / os.h
diff --git a/os/os.h b/os/os.h
index a14d7f0c0333152ed6663d895d787fb95d7e1f18..715f2260a3f6992b13e2e6f164511b7a08e54e82 100644 (file)
--- a/os/os.h
+++ b/os/os.h
@@ -8,6 +8,8 @@
 #include <unistd.h>
 #include <stdlib.h>
 
+#include "../arch/arch.h"
+
 enum {
        os_linux = 1,
        os_aix,
@@ -56,7 +58,7 @@ typedef struct aiocb os_aiocb_t;
 #include <scsi/sg.h>
 #endif
 
-#ifdef CONFIG_STRSEP
+#ifndef CONFIG_STRSEP
 #include "../lib/strsep.h"
 #endif
 
@@ -79,7 +81,7 @@ typedef unsigned long os_cpu_mask_t;
 #endif
 
 #ifndef FIO_HAVE_IOPRIO
-#define ioprio_set(which, who, prio)   (0)
+#define ioprio_set(which, who, prioclass, prio)        (0)
 #endif
 
 #ifndef FIO_HAVE_ODIRECT
@@ -88,6 +90,12 @@ typedef unsigned long os_cpu_mask_t;
 #define OS_O_DIRECT                    O_DIRECT
 #endif
 
+#ifdef OS_O_ATOMIC
+#define FIO_O_ATOMIC                   OS_O_ATOMIC
+#else
+#define FIO_O_ATOMIC                   0
+#endif
+
 #ifndef FIO_HAVE_HUGETLB
 #define SHM_HUGETLB                    0
 #define MAP_HUGETLB                    0
@@ -125,7 +133,11 @@ typedef unsigned long os_cpu_mask_t;
 #endif
 
 #ifndef FIO_PREFERRED_CLOCK_SOURCE
+#ifdef CONFIG_CLOCK_GETTIME
 #define FIO_PREFERRED_CLOCK_SOURCE     CS_CGETTIME
+#else
+#define FIO_PREFERRED_CLOCK_SOURCE     CS_GTOD
+#endif
 #endif
 
 #ifndef FIO_MAX_JOBS
@@ -137,7 +149,7 @@ typedef unsigned int socklen_t;
 #endif
 
 #ifndef FIO_OS_HAS_CTIME_R
-#define os_ctime_r(x, y, z)     ctime_r((x), (y))
+#define os_ctime_r(x, y, z)     (void) ctime_r((x), (y))
 #endif
 
 #ifdef FIO_USE_GENERIC_SWAP
@@ -165,7 +177,7 @@ static inline uint64_t fio_swap64(uint64_t val)
 #endif
 
 #ifndef FIO_HAVE_BYTEORDER_FUNCS
-#ifdef FIO_LITTLE_ENDIAN
+#ifdef CONFIG_LITTLE_ENDIAN
 #define __le16_to_cpu(x)               (x)
 #define __le32_to_cpu(x)               (x)
 #define __le64_to_cpu(x)               (x)