[PATCH] Get closer to FreeBSD compile
[fio.git] / os-freebsd.h
1 #ifndef FIO_OS_FREEBSD_H
2 #define FIO_OS_FREEBSD_H
3
4 #undef FIO_HAVE_LIBAIO
5 #define FIO_HAVE_POSIXAIO
6 #undef FIO_HAVE_FADVISE
7 #undef FIO_HAVE_CPU_AFFINITY
8 #undef FIO_HAVE_DISK_UTIL
9 #undef FIO_HAVE_SGIO
10
11 #define OS_MAP_ANON             (MAP_ANON)
12
13 typedef unsigned long os_cpu_mask_t;
14
15 /*
16  * FIXME
17  */
18 static inline int blockdev_size(int fd, unsigned long long *bytes)
19 {
20         return 1;
21 }
22
23 static inline unsigned long long os_phys_mem(void)
24 {
25         int mib[2] = { CTL_HW, HW_PHYSMEM };
26         unsigned long long mem;
27         size_t len = sizeof(mem);
28
29         sysctl(mib, 2, &mem, &len, NULL, 0);
30         return mem;
31 }
32
33 #endif