1 #ifndef FIO_OS_FREEBSD_H
2 #define FIO_OS_FREEBSD_H
5 #include <sys/sysctl.h>
7 #define FIO_HAVE_POSIXAIO
8 #define FIO_HAVE_ODIRECT
10 #define OS_MAP_ANON MAP_ANON
12 typedef unsigned long os_cpu_mask_t;
13 typedef unsigned int os_random_state_t;
15 static inline int blockdev_size(int fd, unsigned long long *bytes)
17 off_t end = lseek(fd, 0, SEEK_END);
26 static inline int blockdev_invalidate_cache(int fd)
31 static inline unsigned long long os_phys_mem(void)
33 int mib[2] = { CTL_HW, HW_PHYSMEM };
34 unsigned long long mem;
35 size_t len = sizeof(mem);
37 sysctl(mib, 2, &mem, &len, NULL, 0);
41 static inline void os_random_seed(unsigned long seed, os_random_state_t *rs)
46 static inline long os_random_long(os_random_state_t *rs)