1 #ifndef FIO_OS_DRAGONFLY_H
2 #define FIO_OS_DRAGONFLY_H
4 #define FIO_OS os_dragonfly
9 #include <sys/sysctl.h>
10 #include <sys/statvfs.h>
14 #define FIO_HAVE_ODIRECT
15 #define FIO_USE_GENERIC_BDEV_SIZE
16 #define FIO_USE_GENERIC_RAND
17 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
18 #define FIO_HAVE_FS_STAT
19 #define FIO_HAVE_GETTID
21 #undef FIO_HAVE_CPU_AFFINITY /* XXX notyet */
23 #define OS_MAP_ANON MAP_ANON
25 #ifndef PTHREAD_STACK_MIN
26 #define PTHREAD_STACK_MIN 4096
29 #define fio_swap16(x) bswap16(x)
30 #define fio_swap32(x) bswap32(x)
31 #define fio_swap64(x) bswap64(x)
33 typedef off_t off64_t;
35 static inline int blockdev_invalidate_cache(struct fio_file *f)
40 static inline unsigned long long os_phys_mem(void)
42 int mib[2] = { CTL_HW, HW_PHYSMEM };
44 size_t len = sizeof(mem);
46 sysctl(mib, 2, &mem, &len, NULL, 0);
50 static inline int gettid(void)
52 return (int) lwp_gettid();
55 static inline unsigned long long get_fs_size(const char *path)
57 unsigned long long ret;
60 if (statvfs(path, &s) < 0)
64 ret *= (unsigned long long) s.f_bfree;
69 #define FIO_MADV_FREE MADV_FREE