1 #ifndef FIO_OS_FREEBSD_H
2 #define FIO_OS_FREEBSD_H
4 #include <sys/sysctl.h>
7 #define FIO_HAVE_POSIXAIO
8 #undef FIO_HAVE_FADVISE
9 #undef FIO_HAVE_CPU_AFFINITY
10 #undef FIO_HAVE_DISK_UTIL
12 #define FIO_HAVE_ODIRECT
14 #define OS_MAP_ANON (MAP_ANON)
16 typedef unsigned long os_cpu_mask_t;
17 typedef unsigned int os_random_state_t;
22 static inline int blockdev_size(int fd, unsigned long long *bytes)
27 static inline int blockdev_invalidate_cache(int fd)
32 static inline unsigned long long os_phys_mem(void)
34 int mib[2] = { CTL_HW, HW_PHYSMEM };
35 unsigned long long mem;
36 size_t len = sizeof(mem);
38 sysctl(mib, 2, &mem, &len, NULL, 0);
42 static inline void os_random_seed(unsigned long seed, os_random_state_t *rs)
47 static inline long os_random_long(os_random_state_t *rs)
55 static inline double os_random_double(os_random_state_t *rs)
59 val = (double) rand_r(rs);