1 #ifndef FIO_OS_FREEBSD_H
2 #define FIO_OS_FREEBSD_H
5 #include <sys/sysctl.h>
8 #define FIO_HAVE_POSIXAIO
9 #define FIO_HAVE_ODIRECT
10 #define FIO_HAVE_IOPRIO
11 #define FIO_HAVE_STRSEP
12 #define FIO_USE_GENERIC_RAND
13 #define FIO_HAVE_CHARDEV_SIZE
14 #define FIO_HAVE_CLOCK_MONOTONIC
16 #define OS_MAP_ANON MAP_ANON
18 typedef off_t off64_t;
20 static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
24 if (!ioctl(f->fd, DIOCGMEDIASIZE, &size)) {
33 static inline int chardev_size(struct fio_file *f, unsigned long long *bytes)
35 return blockdev_size(f->fd, bytes);
38 static inline int blockdev_invalidate_cache(struct fio_file *f)
43 static inline unsigned long long os_phys_mem(void)
45 int mib[2] = { CTL_HW, HW_PHYSMEM };
46 unsigned long long mem;
47 size_t len = sizeof(mem);
49 sysctl(mib, 2, &mem, &len, NULL, 0);
54 #define FIO_MADV_FREE MADV_FREE