Make fdatasync OS optional
[fio.git] / os / os-freebsd.h
1 #ifndef FIO_OS_FREEBSD_H
2 #define FIO_OS_FREEBSD_H
3
4 #include <errno.h>
5 #include <sys/sysctl.h>
6
7 #define FIO_HAVE_POSIXAIO
8 #define FIO_HAVE_ODIRECT
9 #define FIO_USE_GENERIC_BDEV_SIZE
10 #define FIO_USE_GENERIC_RAND
11 #define FIO_HAVE_FDATASYNC
12
13 #define OS_MAP_ANON             MAP_ANON
14
15 typedef unsigned long os_cpu_mask_t;
16
17 static inline int blockdev_invalidate_cache(int fd)
18 {
19         return EINVAL;
20 }
21
22 static inline unsigned long long os_phys_mem(void)
23 {
24         int mib[2] = { CTL_HW, HW_PHYSMEM };
25         unsigned long long mem;
26         size_t len = sizeof(mem);
27
28         sysctl(mib, 2, &mem, &len, NULL, 0);
29         return mem;
30 }
31
32 #ifdef MADV_FREE
33 #define FIO_MADV_FREE   MADV_FREE
34 #endif
35
36 #endif