[PATCH] fio: pretty close to compiling/working on FreeBSD now
[disktools.git] / os.h
1 #ifndef FIO_OS_H
2 #define FIO_OS_H
3
4 #if defined(__linux__)
5 #include "os-linux.h"
6 #elif defined(__FreeBSD__)
7 #include "os-freebsd.h"
8 #else
9 #error "unsupported os"
10 #endif
11
12 #ifdef FIO_HAVE_LIBAIO
13 #include <libaio.h>
14 #endif
15
16 #ifdef FIO_HAVE_POSIXAIO
17 #include <aio.h>
18 #endif
19
20 #ifndef FIO_HAVE_FADVISE
21 #define fadvise(fd, off, len, advice)   (0)
22
23 #define POSIX_FADV_DONTNEED     (0)
24 #define POSIX_FADV_SEQUENTIAL   (0)
25 #define POSIX_FADV_RANDOM       (0)
26 #endif /* FIO_HAVE_FADVISE */
27
28 #ifndef FIO_HAVE_CPU_AFFINITY
29 #define fio_setaffinity(td)             (0)
30 #define fio_getaffinity(pid, mask)      (0)
31 #endif
32
33 struct thread_data;
34 extern int fio_libaio_init(struct thread_data *);
35 extern void fio_libaio_cleanup(struct thread_data *);
36 extern int fio_posixaio_init(struct thread_data *);
37 extern void fio_posixaio_cleanup(struct thread_data *);
38
39 #endif