6 #elif defined(__FreeBSD__)
7 #include "os-freebsd.h"
9 #include "os-solaris.h"
10 #elif defined(__APPLE__)
13 #error "unsupported os"
16 #ifdef FIO_HAVE_LIBAIO
20 #ifdef FIO_HAVE_POSIXAIO
29 #ifndef FIO_HAVE_STRSEP
30 #include "../lib/strsep.h"
33 #ifndef FIO_HAVE_FADVISE
34 #define fadvise(fd, off, len, advice) (0)
36 #ifndef POSIX_FADV_DONTNEED
37 #define POSIX_FADV_DONTNEED (0)
38 #define POSIX_FADV_SEQUENTIAL (0)
39 #define POSIX_FADV_RANDOM (0)
41 #endif /* FIO_HAVE_FADVISE */
43 #ifndef FIO_HAVE_CPU_AFFINITY
44 #define fio_setaffinity(pid, mask) (0)
45 #define fio_getaffinity(pid, mask) do { } while (0)
46 #define fio_cpu_clear(mask, cpu) do { } while (0)
47 #define fio_cpuset_exit(mask) (-1)
50 #ifndef FIO_HAVE_IOPRIO
51 #define ioprio_set(which, who, prio) (0)
54 #ifndef FIO_HAVE_ODIRECT
57 #define OS_O_DIRECT O_DIRECT
60 #ifndef FIO_HAVE_HUGETLB
63 #define FIO_HUGE_PAGE 0
67 #define FIO_HUGE_PAGE 4194304
72 #define FIO_O_NOATIME 0
76 #define OS_RAND_MAX RAND_MAX
79 #ifndef FIO_HAVE_RAWBIND
80 #define fio_lookup_raw(dev, majdev, mindev) 1
83 #ifndef FIO_HAVE_BLKTRACE
84 static inline int is_blktrace(const char *fname)
89 static inline int load_blktrace(struct thread_data *td, const char *fname)
95 #define FIO_DEF_CL_SIZE 128
97 static inline int os_cache_line_size(void)
99 #ifdef FIO_HAVE_CL_SIZE
100 int ret = arch_cache_line_size();
103 return FIO_DEF_CL_SIZE;
107 return FIO_DEF_CL_SIZE;
111 #ifdef FIO_USE_GENERIC_BDEV_SIZE
112 static inline int blockdev_size(int fd, unsigned long long *bytes)
118 end = lseek(fd, 0, SEEK_END);
127 #ifdef FIO_USE_GENERIC_RAND
128 typedef unsigned int os_random_state_t;
130 static inline void os_random_seed(unsigned long seed, os_random_state_t *rs)
135 static inline long os_random_long(os_random_state_t *rs)