1 #ifndef FIO_OS_FREEBSD_H
2 #define FIO_OS_FREEBSD_H
5 #define FIO_HAVE_POSIXAIO
6 #undef FIO_HAVE_FADVISE
7 #undef FIO_HAVE_CPU_AFFINITY
8 #undef FIO_HAVE_DISK_UTIL
11 #define OS_MAP_ANON (MAP_ANON)
13 typedef unsigned long os_cpu_mask_t;
14 typedef unsigned int os_random_state_t;
19 static inline int blockdev_size(int fd, unsigned long long *bytes)
24 static inline unsigned long long os_phys_mem(void)
26 int mib[2] = { CTL_HW, HW_PHYSMEM };
27 unsigned long long mem;
28 size_t len = sizeof(mem);
30 sysctl(mib, 2, &mem, &len, NULL, 0);
34 static inline void os_random_seed(unsigned long seed, os_random_state_t *rs)
39 static inline long os_random_long(os_random_state_t *rs)
47 static inline double os_random_double(os_random_state_t *rs)
51 val = (double) rand_r(rs);