[PATCH] Remove the old job command line options
[fio.git] / os-linux.h
index 51da8dc5b8f695463b29e0216ee3f32f47fd5a94..5f0ef8214fcac07a32d629dbaea2fa9a9a209d15 100644 (file)
 #define FIO_HAVE_SGIO
 #define FIO_HAVE_IOPRIO
 #define FIO_HAVE_SPLICE
+#define FIO_HAVE_IOSCHED_SWITCH
+#define FIO_HAVE_ODIRECT
 
 #define OS_MAP_ANON            (MAP_ANONYMOUS)
 
 typedef cpu_set_t os_cpu_mask_t;
+typedef struct drand48_data os_random_state_t;
 
 /*
  * we want fadvise64 really, but it's so tangled... later
@@ -86,4 +89,37 @@ static inline int blockdev_size(int fd, unsigned long long *bytes)
        return errno;
 }
 
+static inline unsigned long long os_phys_mem(void)
+{
+       long pagesize, pages;
+
+       pagesize = sysconf(_SC_PAGESIZE);
+       pages = sysconf(_SC_PHYS_PAGES);
+       if (pages == -1 || pagesize == -1)
+               return 0;
+
+       return (unsigned long long) pages * (unsigned long long) pagesize;
+}
+
+static inline void os_random_seed(unsigned long seed, os_random_state_t *rs)
+{
+       srand48_r(seed, rs);
+}
+
+static inline long os_random_long(os_random_state_t *rs)
+{
+       long val;
+
+       lrand48_r(rs, &val);
+       return val;
+}
+
+static inline double os_random_double(os_random_state_t *rs)
+{
+       double val;
+
+       drand48_r(rs, &val);
+       return val;
+}
+
 #endif