[PATCH] fio: pretty close to compiling/working on FreeBSD now
[disktools.git] / os-linux.h
1 #ifndef FIO_OS_LINUX_H
2 #define FIO_OS_LINUX_H
3
4 #define FIO_HAVE_LIBAIO
5 #define FIO_HAVE_POSIXAIO
6 #define FIO_HAVE_FADVISE
7 #define FIO_HAVE_CPU_AFFINITY
8 #define FIO_HAVE_DISK_UTIL
9
10 #define OS_MAP_ANON             (MAP_ANONYMOUS)
11
12 typedef cpu_set_t os_cpu_mask_t;
13
14 /*
15  * we want fadvise64 really, but it's so tangled... later
16  */
17 #define fadvise(fd, off, len, advice)   \
18         posix_fadvise((fd), (off_t)(off), (len), (advice))
19
20 #define fio_setaffinity(td)             \
21         sched_setaffinity((td)->pid, sizeof((td)->cpumask), &(td)->cpumask)
22 #define fio_getaffinity(pid, ptr)       \
23         sched_getaffinity((pid), sizeof(cpu_set_t), (ptr))
24
25 #endif